-
Notifications
You must be signed in to change notification settings - Fork 283
Fails to work if source directory is read only #775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails 8000 .
Already on GitHub? Sign in to your account
Comments
In https://github.com/gcovr/gcovr/blob/master/gcovr/formats/gcov/read.py#L312 it says
But I don't think this is true if the program has been built with absolute paths.
|
gcov also has the "--stdout" option. I guess it could be used to run gcov from the source directory but write the .gcov files somewhere else? |
With gcovr 5.0, in Fedora 37 it works... apparently because it uses, somehow, a temporary directory (/tmp/tmpaeroqqpv).
With gcovr 6.0, the problem also seems to be that it's not In
gcc runs in |
Even if you use absolute paths for calling the compiler the files referenced in
There is a heuristic to get the correct working directory for running gcovr. The temporary directory was removed in version 5.1 with #525 because there was always a Can you try to run gcovr in the build directory and remove the option
This option was introduced 2018 so it's not available in older versions of gcov and it's not usable for the newer json intermediate format. |
I guess it may depend on the version, but
Even when using gcovr
With
As does not using any
Naturally, the output is different, though (has "src" in the path)
vs
|
The root directory is used for running gcov if no object directory is given. With following command you should be able to run gcovr without using the src directory as working directory to execute gcov: gcovr --xml /gcovr_test/coverage.xml -r /gcovr_test/src --object-directory /gcovr_test/build /gcovr_test/build |
I played a little bit yesterday, with gcc-11 the behavior is as expected, we grep the error message in the output of gcov and try the next directory. But gcc-mirror/gcc@815f15d introduced proper exit codes and is released first with gcc-12. I'll first extend our test matrix with gcc-13 or gcc-12 and then I'll fix this problem. For now the workaround from the last comment is the only thing I can do for you. |
It works for me! |
@reddwarf69 Can you test the branch from #781 with your old command line? |
(ERROR) Error occurred while reading reports: GCOV produced the following errors processing F:\add\add.gcda: |
Posting the same log in 3 closed issues without any information doesn't help. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
Fails to work if source directory is read only.
Given the following directory structure
I get this error
when
src
doesn't have write permissions.Desktop:
Additional context
After running it with verbose, I can see the problem is that
gcov
is called fromsrc
. When running the gcov command by hand, I getMaking the source directory writable, makes the gcovr invocation work.
The text was updated successfully, but these errors were encountered: