-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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.
Already on GitHub? Sign in to your account
//src/test/shell/bazel:bazel_cc_code_coverage_test
is failing in Bazel postsubmit
#16229
Comments
Turns out it's caused by the docker image update for |
To reproduce
|
@c-mita @oquenchil Can you help debug why |
Since the test is broken with latest Ubuntu 20.04 LTS release (perhaps due to different |
…2004 Due to #16229 PiperOrigin-RevId: 472701380 Change-Id: Ib0611fbe96a55f6e6330b250430bf8bfb1c11245
Failures in 20.04 can be explained by this change in GCC: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=1f2bb38a85710f650d1ea87f0765cb50e19c3212 With this change, the filenames for output Except this test only appears to have started failing recently with the latest LTS release, during which GCC was updated from 9.3.0 to 9.4.0. I cannot explain why it would have been passing before. Later versions of GCC also introduce some changes. Given a simple project structure:
And the following compile and run commands.
What we end up with will vary significantly depending on the version of GCC. GCC 8.4.0With this version, there's a bug where the
GCC 9.4.0With this version, we start seeing mangled paths. The full absolute path for the gcno file appears to be taken and converted into a "friendly" form (i.e. separators are replaced with
GCC 10.4.0This is the same as 9.4.0 GCC 11.4.0The gcno file is now put next to the compiled object. This changes the name of the gcda file slightly too.
GCC 12.1.0This is the same as 11.4.0 The documentation for
Converting everything to a full path yields identical outputs for versions 8, 9 and 10.
That's three distinct cases to handle for just this test. I do not yet know how this interacts with Bazel's regular C++ coverage logic; |
Removing the There is still some differences in behaviour as to exactly where the |
…erences * -fprofile-dir shouldn't be used because on the g++ command line because it has different behaviour with different versions (w.r.t. where the output gcda file ends up). * The gcda and gcno files may end up in the same directory as the object file or in the current working directory. * The output of the gcov call in collect_cc_coverage may be "*.gcda.gcov.json.gz" or "*.gcov.json.gz" (as well as the original text file for much older GCC versions). Also re-enable the test for Ubuntu 20.04 pre and postsubmits. Fixes bazelbuild#16229
A quick test with GCC 9.3.0 I think explains why this test passed before:
With 9.3.0, both the gcno and gcda file names are mangled, but the gcno file can be found by the test script because it's in the expected location and is still matched by the wildcard in the With the move to 9.4.0 the latter is no longer true, so |
…erences * -fprofile-dir shouldn't be used because on the g++ command line because it has different behaviour with different versions (w.r.t. where the output gcda file ends up). * The gcda and gcno files may end up in the same directory as the object file or in the current working directory. * The output of the gcov call in collect_cc_coverage may be "*.gcda.gcov.json.gz" or "*.gcov.json.gz" (as well as the original text file for much older GCC versions). Also re-enable the test for Ubuntu 20.04 pre and postsubmits. Fixes bazelbuild#16229
@bazel-io flag |
@meteorcloudy This issue also affects the pipeline for the release-5.3.1 branch, see #16253. |
…erences * -fprofile-dir shouldn't be used because on the g++ command line because it has different behaviour with different versions (w.r.t. where the output gcda file ends up). * The gcda and gcno files may end up in the same directory as the object file or in the current working directory. * The output of the gcov call in collect_cc_coverage may be "*.gcda.gcov.json.gz" or "*.gcov.json.gz" (as well as the original text file for much older GCC versions). Also re-enable the test for Ubuntu 20.04 pre and postsubmits. Fixes bazelbuild#16229 Closes bazelbuild#16235. PiperOrigin-RevId: 473218955 Change-Id: I1f4887f251da8f56f8ea525c1a1410e6257bf31b
@bazel-io fork 5.3.1 |
…erences (#16254) * -fprofile-dir shouldn't be used because on the g++ command line because it has different behaviour with different versions (w.r.t. where the output gcda file ends up). * The gcda and gcno files may end up in the same directory as the object file or in the current working directory. * The output of the gcov call in collect_cc_coverage may be "*.gcda.gcov.json.gz" or "*.gcov.json.gz" (as well as the original text file for much older GCC versions). Also re-enable the test for Ubuntu 20.04 pre and postsubmits. Fixes #16229 Closes #16235. PiperOrigin-RevId: 473218955 Change-Id: I1f4887f251da8f56f8ea525c1a1410e6257bf31b Co-authored-by: Charles Mita <cmita@google.com>
…2004 Due to bazelbuild#16229 PiperOrigin-RevId: 472701380 Change-Id: Ib0611fbe96a55f6e6330b250430bf8bfb1c11245
…erences * -fprofile-dir shouldn't be used because on the g++ command line because it has different behaviour with different versions (w.r.t. where the output gcda file ends up). * The gcda and gcno files may end up in the same directory as the object file or in the current working directory. * The output of the gcov call in collect_cc_coverage may be "*.gcda.gcov.json.gz" or "*.gcov.json.gz" (as well as the original text file for much older GCC versions). Also re-enable the test for Ubuntu 20.04 pre and postsubmits. Fixes bazelbuild#16229 Closes bazelbuild#16235. PiperOrigin-RevId: 473218955 Change-Id: I1f4887f251da8f56f8ea525c1a1410e6257bf31b
Build: https://buildkite.com/bazel/bazel-bazel/builds/20593#018316e3-41c1-4899-b92d-4f2f8dd3f468
Test log: https://storage.googleapis.com/bazel-untrusted-buildkite-artifacts/01831621-521b-4076-8bbf-169cf72b957b/src/test/shell/bazel/bazel_cc_code_coverage_test/test_attempts/attempt_1.log
The text was updated successfully, but these errors were encountered: