gcovr
gcovr copied to clipboard
Gcovr fails with hyphen in path
Describe the bug
I have a repository which has a hyphen in its name. With this repository collecting coverage using gcovr
fails with errors about a readonly filesystem. I put the log of the fail below. When I rename the repo to the same name without the hyphen and rebuild/retest and rerun gcovr, the issue disappears.
To Reproduce
- Have a repo with a hyphen in its name
- Build/test
- Run gcovr
Expected behavior Gcovr runs without issues
Screenshots See log below
Desktop (please complete the following information):
- OS: macOS 12.7.1
- GCC version: Apple clang version 14.0.0 (clang-1400.0.29.202)
- GCOVR version: Tried both 6.0 and 7.0
- Project directory layout:
- Roots: The path with the hyphen in it
Additional context Log:
File '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/new'
Lines executed:84.62% of 13
Branches executed:100.00% of 2
Taken at least once:50.00% of 2
No calls
Creating 'new##c8248d0c10c8a902d7ffa4776cad83da.gcov'
<< End of stdout
Stderr of gcov was >>Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
<< End of stderr
Current processed gcov file was '/forward.h##4d245d795dd97adc43f8cd857a883c88.gcov'.
Use option --verbose to get extended information.
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/workers.py", line 80, in worker
work(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 422, in process_datafile
done = run_gcov_and_process_files(
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 709, in run_gcov_and_process_files
process_gcov_data(fname, abs_filename, covdata, options)
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 173, in process_gcov_data
with io.open(
FileNotFoundError: [Errno 2] No such file or directory: '/forward.h##4d245d795dd97adc43f8cd857a883c88.gcov'
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/workers.py", line 80, in worker
work(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 422, in process_datafile
done = run_gcov_and_process_files(
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 709, in run_gcov_and_process_files
process_gcov_data(fname, abs_filename, covdata, options)
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 173, in process_gcov_data
with io.open(
FileNotFoundError: [Errno 2] No such file or directory: '/forward.h##4d245d795dd97adc43f8cd857a883c88.gcov'
(ERROR) Error occurred while reading reports:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/gcovr/__main__.py", line 362, in main
covdata: CovData = gcovr_formats.read_reports(options)
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/__init__.py", line 66, in read_reports
covdata = GcovHandler(options).read_report()
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/__init__.py", line 202, in read_report
return read_report(self.options)
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 86, in read_report
contexts = pool.wait()
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/workers.py", line 173, in __exit__
self.wait()
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/workers.py", line 164, in wait
raise self.exceptions[0][1]
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 86, in read_report
contexts = pool.wait()
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/workers.py", line 164, in wait
raise self.exceptions[0][1]
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/workers.py", line 80, in worker
work(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 422, in process_datafile
done = run_gcov_and_process_files(
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 709, in run_gcov_and_process_files
process_gcov_data(fname, abs_filename, covdata, options)
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 173, in process_gcov_data
with io.open(
FileNotFoundError: [Errno 2] No such file or directory: '/forward.h##4d245d795dd97adc43f8cd857a883c88.gcov'
[Errno 2] No such file or directory: '/forward.h##4d245d795dd97adc43f8cd857a883c88.gcov'
Sorry, from this log I don't see an issue with a hyphen. For me it looks more lake a misconfiguration because gcov is trying to create the file in the root of your disk.
As stated in the log Use option --verbose to get extended information.
, can you check this? I guess that gcovr can't find the correct working directory of gcov.
I have added the whole log of the failed run. I can see it goes wrong when it starts descending in the file tree, but not sure why that happens.
$ gcovr -r ${CI_PROJECT_DIR} --cobertura --html-details details.html --print-summary -e "/.*/build/_deps/" -e "/.*/rapidjson/" -e "/.*/test/" -o coverage.xml --verbose
(DEBUG) File system is case insensitive.
(DEBUG) Filters for --root: (1)
(DEBUG) - re.compile('^/Users/macdev/builds/uyt5Zwhj/0/application\\-library/jsobject/')
(DEBUG) Filters for --filter: (1)
(DEBUG) - DirectoryPrefixFilter(/Users/macdev/builds/uyt5Zwhj/0/application\-library/jsobject/)
(DEBUG) Filters for --exclude: (3)
(DEBUG) - AbsoluteFilter(/.*/build/_deps/)
(DEBUG) - AbsoluteFilter(/.*/rapidjson/)
(DEBUG) - AbsoluteFilter(/.*/test/)
(DEBUG) Filters for --gcov-filter: (1)
(DEBUG) - AlwaysMatchFilter()
(DEBUG) Filters for --gcov-exclude: (0)
(DEBUG) Filters for --gcov-exclude-directories: (0)
(INFO) Reading coverage data...
(DEBUG) Scanning directory ../.. for gcda/gcno files...
(DEBUG) Found 52 files (and will process 26)
(DEBUG) Pool started with 1 threads
(DEBUG) Processing file: /Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir/jsUuid_test.cpp.gcda
(DEBUG) Running gcov: 'gcov --help' in '.'
(DEBUG) Running gcov: 'gcov --help-hidden' in '.'
(DEBUG) Running gcov: 'gcov /Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir/jsUuid_test.cpp.gcda --branch-counts --branch-probabilities --all-blocks --demangled-names --hash-filenames --object-directory build/test/CMakeFiles/jsObject_test.dir' in '/Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject'
(DEBUG) Running gcov: 'gcov /Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir/jsUuid_test.cpp.gcda --branch-counts --branch-probabilities --all-blocks --demangled-names --hash-filenames --object-directory .' in '/Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir'
(DEBUG) Running gcov: 'gcov /Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir/jsUuid_test.cpp.gcda --branch-counts --branch-probabilities --all-blocks --demangled-names --hash-filenames --object-directory jsObject_test.dir' in '/Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles'
(DEBUG) Running gcov: 'gcov /Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir/jsUuid_test.cpp.gcda --branch-counts --branch-probabilities --all-blocks --demangled-names --hash-filenames --object-directory CMakeFiles/jsObject_test.dir' in '/Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test'
(DEBUG) Running gcov: 'gcov /Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir/jsUuid_test.cpp.gcda --branch-counts --branch-probabilities --all-blocks --demangled-names --hash-filenames --object-directory test/CMakeFiles/jsObject_test.dir' in '/Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build'
(DEBUG) Running gcov: 'gcov /Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir/jsUuid_test.cpp.gcda --branch-counts --branch-probabilities --all-blocks --demangled-names --hash-filenames --object-directory build/test/CMakeFiles/jsObject_test.dir' in '/Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject'
(DEBUG) Running gcov: 'gcov /Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir/jsUuid_test.cpp.gcda --branch-counts --branch-probabilities --all-blocks --demangled-names --hash-filenames --object-directory jsobject/build/test/CMakeFiles/jsObject_test.dir' in '/Users/macdev/builds/uyt5Zwhj/0/application-library'
(DEBUG) Running gcov: 'gcov /Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir/jsUuid_test.cpp.gcda --branch-counts --branch-probabilities --all-blocks --demangled-names --hash-filenames --object-directory application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir' in '/Users/macdev/builds/uyt5Zwhj/0'
(DEBUG) Running gcov: 'gcov /Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir/jsUuid_test.cpp.gcda --branch-counts --branch-probabilities --all-blocks --demangled-names --hash-filenames --object-directory 0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir' in '/Users/macdev/builds/uyt5Zwhj'
(DEBUG) Running gcov: 'gcov /Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir/jsUuid_test.cpp.gcda --branch-counts --branch-probabilities --all-blocks --demangled-names --hash-filenames --object-directory uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir' in '/Users/macdev/builds'
(DEBUG) Running gcov: 'gcov /Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir/jsUuid_test.cpp.gcda --branch-counts --branch-probabilities --all-blocks --demangled-names --hash-filenames --object-directory builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir' in '/Users/macdev'
(DEBUG) Running gcov: 'gcov /Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir/jsUuid_test.cpp.gcda --branch-counts --branch-probabilities --all-blocks --demangled-names --hash-filenames --object-directory macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir' in '/Users'
(DEBUG) Running gcov: 'gcov /Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir/jsUuid_test.cpp.gcda --branch-counts --branch-probabilities --all-blocks --demangled-names --hash-filenames --object-directory Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir' in '/'
(ERROR) Trouble processing '/Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir/jsUuid_test.cpp.gcda' with working directory '/'.
Stdout of gcov was >>File '/Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/test/jsUuid_test.cpp'
Lines executed:100.00% of 41
Branches executed:100.00% of 232
Taken at least once:39.66% of 232
No calls
Creating 'jsUuid_test.cpp##a8d7154b630cebaa46fb46357a7f697b.gcov'
File '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/string'
Lines executed:71.19% of 59
Branches executed:80.00% of 10
Taken at least once:50.00% of 10
No calls
Creating 'string##4914da67b4dc835e467440e04d551b78.gcov'
File '/Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/.dependencies/googletest-src/googletest/include/gtest/internal/gtest-internal.h'
Lines executed:3.70% of 27
Branches executed:25.00% of 48
Taken at least once:12.50% of 48
No calls
Creating 'gtest-internal.h##54b9c1264b54bf5c2d235184c1996715.gcov'
File '/Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/test/../include/jsObject/jsUuid.h'
Lines executed:100.00% of 2
No branches
No calls
Creating 'jsUuid.h##444dc0913df8f1b536f50de4f75314c9.gcov'
File '/Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/.dependencies/googletest-src/googletest/include/gtest/gtest-assertion-result.h'
Lines executed:0.00% of 6
Branches executed:0.00% of 2
Taken at least once:0.00% of 2
No calls
Creating 'gtest-assertion-result.h##b9601bd0a6ba77d6277ebb34430c6ac2.gcov'
File '/Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/.dependencies/googletest-src/googletest/include/gtest/gtest-message.h'
Lines executed:nan% of 0
No branches
No calls
Creating 'gtest-message.h##dfc9251a45ade99c495b4b6a85016dd5.gcov'
File '/Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/test/../include/jsObject/unique_id.h'
Lines executed:100.00% of 16
Branches executed:100.00% of 8
Taken at least once:50.00% of 8
No calls
Creating 'unique_id.h##79834c26599fca7e161773d264b6e9a4.gcov'
File '/Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/.dependencies/googletest-src/googletest/include/gtest/gtest.h'
Lines executed:0.00% of 5
No branches
No calls
Creating 'gtest.h##e1de013162b5cf98d673a2a1141cd1d8.gcov'
File '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/__memory/unique_ptr.h'
Lines executed:0.00% of 17
Branches executed:0.00% of 10
Taken at least once:0.00% of 10
No calls
Creating 'unique_ptr.h##faaf6c60421268e41765c7cd8a592ba2.gcov'
File '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/__memory/compressed_pair.h'
Lines executed:81.25% of 16
No branches
No calls
Creating 'compressed_pair.h##478becee3202634787394b26fa4fb4df.gcov'
File '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/array'
Lines executed:100.00% of 4
No branches
No calls
Creating 'array##f5b7f5fcbcf908c5209f09825e77cb8b.gcov'
File '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/__utility/forward.h'
Lines executed:100.00% of 2
No branches
No calls
Creating 'forward.h##4d245d795dd97adc43f8cd857a883c88.gcov'
File '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/__memory/allocator.h'
Lines executed:40.00% of 5
Branches executed:0.00% of 2
Taken at least once:0.00% of 2
No calls
Creating 'allocator.h##054382a03463af1d8a7b35d24d728e31.gcov'
File '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/__memory/allocator_traits.h'
Lines executed:0.00% of 3
No branches
No calls
Creating 'allocator_traits.h##32e4317e691d1c286f1fa4216cf66803.gcov'
File '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/__string'
Lines executed:16.67% of 6
No branches
No calls
Creating '__string##5308f569ee7da86bb4f7a7d2e3bf0fea.gcov'
File '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/new'
Lines executed:0.00% of 13
Branches executed:0.00% of 2
Taken at least once:0.00% of 2
No calls
Creating 'new##c8248d0c10c8a902d7ffa4776cad83da.gcov'
File '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/__utility/move.h'
Lines executed:100.00% of 2
No branches
No calls
Creating 'move.h##b962364907a70df241b2652f8b750ca9.gcov'
File '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/__memory/pointer_traits.h'
Lines executed:100.00% of 4
No branches
No calls
Creating 'pointer_traits.h##4ae3cbbd3c247fa2a454aa5359424651.gcov'
File '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/__memory/addressof.h'
Lines executed:100.00% of 2
No branches
No calls
Creating 'addressof.h##dce7a1b8fe065448982cce248989b45a.gcov'
File '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/ostream'
Lines executed:0.00% of 21
Branches executed:0.00% of 24
Taken at least once:0.00% of 24
No calls
Creating 'ostream##3fd775785662b3b7b50a86a8fb483ab6.gcov'
File '/Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/.dependencies/googletest-src/googletest/include/gtest/internal/gtest-port.h'
Lines executed:0.00% of 1
No branches
No calls
Creating 'gtest-port.h##d445ecc15e7e1b52621e6fa0ffef33a6.gcov'
File '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/locale'
Lines executed:0.00% of 29
Branches executed:0.00% of 21
Taken at least once:0.00% of 21
No calls
Creating 'locale##6a9c925a88672b1a024ae11411cfb218.gcov'
File '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/__iterator/ostreambuf_iterator.h'
Lines executed:0.00% of 3
Branches executed:0.00% of 2
Taken at least once:0.00% of 2
No calls
Creating 'ostreambuf_iterator.h##c142c692fd0b5495354d5cc1e0e783ff.gcov'
File '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/ios'
Lines executed:0.00% of 22
Branches executed:0.00% of 6
Taken at least once:0.00% of 6
No calls
Creating 'ios##71a98a0ebdfe57418d96324cc92f38c4.gcov'
File '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/streambuf'
Lines executed:0.00% of 2
No branches
No calls
Creating 'streambuf##e2657e47f88bd433422a67ba0e93f722.gcov'
File '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/__locale'
Lines executed:0.00% of 4
No branches
No calls
Creating '__locale##6931866373648ea3efb5ff23897a601d.gcov'
<< End of stdout
Stderr of gcov was >>Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
Read-only file system
<< End of stderr
Current processed gcov file was '/allocator.h##054382a03463af1d8a7b35d24d728e31.gcov'.
Use option --verbose to get extended information.
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/workers.py", line 80, in worker
work(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 422, in process_datafile
done = run_gcov_and_process_files(
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 709, in run_gcov_and_process_files
process_gcov_data(fname, abs_filename, covdata, options)
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 173, in process_gcov_data
with io.open(
FileNotFoundError: [Errno 2] No such file or directory: '/allocator.h##054382a03463af1d8a7b35d24d728e31.gcov'
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/workers.py", line 80, in worker
work(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 422, in process_datafile
done = run_gcov_and_process_files(
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 709, in run_gcov_and_process_files
process_gcov_data(fname, abs_filename, covdata, options)
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 173, in process_gcov_data
with io.open(
FileNotFoundError: [Errno 2] No such file or directory: '/allocator.h##054382a03463af1d8a7b35d24d728e31.gcov'
(ERROR) Error occurred while reading reports:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/gcovr/__main__.py", line 362, in main
covdata: CovData = gcovr_formats.read_reports(options)
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/__init__.py", line 66, in read_reports
covdata = GcovHandler(options).read_report()
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/__init__.py", line 202, in read_report
return read_report(self.options)
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 86, in read_report
contexts = pool.wait()
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/workers.py", line 173, in __exit__
self.wait()
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/workers.py", line 164, in wait
raise self.exceptions[0][1]
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 86, in read_report
contexts = pool.wait()
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/workers.py", line 164, in wait
raise self.exceptions[0][1]
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/workers.py", line 80, in worker
work(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 422, in process_datafile
done = run_gcov_and_process_files(
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 709, in run_gcov_and_process_files
process_gcov_data(fname, abs_filename, covdata, options)
File "/usr/local/lib/python3.9/site-packages/gcovr/formats/gcov/read.py", line 173, in process_gcov_data
with io.open(
FileNotFoundError: [Errno 2] No such file or directory: '/allocator.h##054382a03463af1d8a7b35d24d728e31.gcov'
[Errno 2] No such file or directory: '/allocator.h##054382a03463af1d8a7b35d24d728e31.gcov'
Uploading artifacts for failed job
00:02
Uploading artifacts...
Runtime platform arch=amd64 os=darwin pid=59805 revision=f5da3c5a version=16.6.1
build/test/result.xml: found 1 matching artifact files and directories
WARNING: build/test/details.*: no matching files. Ensure that the artifact path is relative to the working directory (/Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject)
Uploading artifacts as "archive" to coordinator... 201 Created id=22238 responseStatus=201 Created token=64_dsHxx
Uploading artifacts...
Runtime platform arch=amd64 os=darwin pid=59807 revision=f5da3c5a version=16.6.1
build/test/result.xml: found 1 matching artifact files and directories
Uploading artifacts as "junit" to coordinator... 201 Created id=22238 responseStatus=201 Created token=64_dsHxx
Uploading artifacts...
Runtime platform arch=amd64 os=darwin pid=59809 revision=f5da3c5a version=16.6.1
WARNING: build/test/coverage.xml: no matching files. Ensure that the artifact path is relative to the working directory (/Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject)
ERROR: No files to upload
ERROR: Job failed: exit status 1
Can you execute the command gcov /Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject/build/test/CMakeFiles/jsObject_test.dir/jsUuid_test.cpp.gcda --branch-counts --branch-probabilities --all-blocks --demangled-names --hash-filenames --object-directory build/test/CMakeFiles/jsObject_test.dir
in /Users/macdev/builds/uyt5Zwhj/0/application-library/jsobject
and check the output?
@latk I'm wondering here why the exception is matched and re thrown here: https://github.com/gcovr/gcovr/blob/1c0e1d5a603586f01d6cad686efd1aedb9ba0400/gcovr/formats/gcov/read.py#L726-L734
and not in the outer loop: https://github.com/gcovr/gcovr/blob/1c0e1d5a603586f01d6cad686efd1aedb9ba0400/gcovr/formats/gcov/read.py#L421
We loose her the output of the failed gcov execution and why we used the next working directory.
I prepared a branch to get all the error messages from the gcov executions. Please can you try https://github.com/Spacetown/gcovr/tree/catch_additional_gcov_error?
I think I figured it out, your branch helped massively. Our CI was deleting the folder containing all dependencies before running gcovr
which is why it failed, as it couldn't find certain files which should be in the dependencies folder. I think the added debug logging of your branch would be a helpful addition to the mainline of gcovr too. From my side this issue can be closed, thanks!