cpp-coveralls icon indicating copy to clipboard operation
cpp-coveralls copied to clipboard

Git submodules breaks this

Open luke-jr opened this issue 11 years ago • 16 comments

Please see https://travis-ci.org/luke-jr/bfgminer/jobs/35702927

It seems to be putting the relative path twice.

luke-jr avatar Sep 19 '14 07:09 luke-jr

Hi, @luke-jr Thanks for reporting this. I will looking into this soon.

eddyxu avatar Sep 19 '14 17:09 eddyxu

“soon” :trollface:

zbeekman avatar Feb 27 '15 01:02 zbeekman

Soon would be nice, also hitting this problem

ariscop avatar Sep 11 '15 23:09 ariscop

@ariscop sorry for late. Kinda forget this issue.

Could you give me some details about how you encounter the issue?

eddyxu avatar Sep 11 '15 23:09 eddyxu

Traceback (most recent call last):
  File "/home/andrew/.local/bin/coveralls", line 9, in <module>
    load_entry_point('cpp-coveralls==0.3.9', 'console_scripts', 'coveralls')()
  File "/home/andrew/.local/lib/python3.4/site-packages/cpp_coveralls/__init__.py", line 96, in run
    cov_report = coverage.collect(args)
  File "/home/andrew/.local/lib/python3.4/site-packages/cpp_coveralls/coverage.py", line 375, in collect
    with io.open(source_file_path, mode='rb') as src_file:
FileNotFoundError: [Errno 2] No such file or directory: '/home/andrew/Software/elemental-ircd/libratbox/src/netio/netio/epoll.c'

I believe this is actually the result of using automakes subdir-objects option, it happens for every source file a directory below its makefile

ariscop avatar Sep 11 '15 23:09 ariscop

The path in epoll.o is netio/epoll.c, so compiler is being run from the makefiles directory

ariscop avatar Sep 11 '15 23:09 ariscop

@ariscop could you mind take a look of https://github.com/eddyxu/cpp-coveralls/tree/subproj ?

I am not sure how to reproduce the problem. Could you give some hints?

eddyxu avatar Sep 12 '15 00:09 eddyxu

This change here demonstrates the issue https://github.com/ariscop/cpp-coveralls/commit/3a0f2109770231539df7f1419f5056b527bf9ab6

I believe it is the same bug @luke-jr had, and doesn't have anything to do with subprojects

ariscop avatar Sep 12 '15 01:09 ariscop

I don't think @ariscop's problem is remotely related to this. See http://github.com/luke-jr/bfgminer for an example

luke-jr avatar Sep 12 '15 05:09 luke-jr

I suspect it is, your makefile is in ccan.bfg/, but the source files in ccan-upstream/. it's searching for ../ccan-upstream/ccan/opt/opt.c with a working dir of ccan-upstream/ccan/opt/

IOError: [Errno 2] No such file or directory: '/home/travis/build/luke-jr/bfgminer/ccan-upstream/ccan/ccan-upstream/ccan/opt/opt.c'

ariscop avatar Sep 12 '15 05:09 ariscop

But the compilers working dir during the build was ccan.bfg/

ariscop avatar Sep 12 '15 05:09 ariscop

Oh, hm. I missed that, and assumed it simply failed to clone ccan-upstream...

luke-jr avatar Sep 12 '15 05:09 luke-jr

it is difficult than I thought. There are so many ways you can set the the relative paths between files...

Could you give some suguesstions?

eddyxu avatar Sep 12 '15 07:09 eddyxu

There does seem to be a source dir in objects (as can be seen via strings), i'll see how gdb finds sources, it handles this case

ariscop avatar Sep 12 '15 07:09 ariscop

From an objects debug information, joining the DW_AT_comp_dir and DW_AT_name tags give you an absolute source path. readelf --debug-dump will dump those, there's a library called pyelftools with a dwarf parser but i've never used it

ariscop avatar Sep 12 '15 08:09 ariscop

I have the same problem. Someone already got run?

joaojunior avatar Jan 06 '17 15:01 joaojunior