bazel: remote_coverage_tools/Main cannot locate runfiles directory when building with `--nobuild_runfile_links`
Description of the bug:
Whenever --nobuild_runfiles_links is enabled I encounter a failure where the remote_coverage_tools/Main tool errors and fails to find runfiles. The logging is confusing as searching appears as though it should be inhibited.
https://buildkite.com/bazel/rules-rust-rustlang/builds/10120#018c7929-4564-4947-9fa6-ea73aa7e0e26
+ JAVA_RUNFILES=
+ exec bazel-out/k8-opt-exec-ST-13d3ddad9198/bin/external/remote_coverage_tools/Main --coverage_dir=/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/3234/execroot/rules_rust/bazel-out/k8-fastbuild/testlogs/test/rust_test_suite/tests_suite_tests/integrated_test_b/_coverage --output_file=/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/3234/execroot/rules_rust/bazel-out/k8-fastbuild/testlogs/test/rust_test_suite/tests_suite_tests/integrated_test_b/coverage.dat --filter_sources=/usr/bin/.+ --filter_sources=/usr/lib/.+ --filter_sources=/usr/include.+ --filter_sources=/Applications/.+ --source_file_manifest=/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/3234/execroot/rules_rust/bazel-out/k8-fastbuild/bin/test/rust_test_suite/tests_suite_tests/integrated_test_b.instrumented_files
/var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/ec321eb2cc2d0f8f91b676b6d4c66c29/sandbox/linux-sandbox/3234/execroot/rules_rust/bazel-out/k8-opt-exec-ST-13d3ddad9198/bin/external/remote_coverage_tools/Main: Cannot locate runfiles directory. (Set $JAVA_RUNFILES to inhibit searching.)
This issue is reproduced on https://github.com/bazelbuild/rules_rust/pull/2340
Which category does this issue belong to?
No response
What’s the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
This issue is reproduced on https://github.com/bazelbuild/rules_rust/pull/2340
Which operating system are you running Bazel on?
Linux, MacOS
What is the output of bazel info release?
7.0.0
If bazel info release returns development version or (@non-git), tell us how you built Bazel.
No response
What’s the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?
No response
Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 32 (23 by maintainers)
Commits related to this issue
- Verify in tests that coverage supports `--nobuild_runfile_links` Fixes #20577 Closes #22676. PiperOrigin-RevId: 649065192 Change-Id: I0a57f580c1cb3a03184950e3e5ea24e9ef4962b4 — committed to EngFlow/bazel by fmeum 2 years ago
- Verify in tests that coverage supports `--nobuild_runfile_links` Fixes #20577 Closes #22676. PiperOrigin-RevId: 649065192 Change-Id: I0a57f580c1cb3a03184950e3e5ea24e9ef4962b4 — committed to fmeum/bazel by fmeum 2 years ago
- Verify in tests that coverage supports `--nobuild_runfile_links` Fixes #20577 Closes #22676. PiperOrigin-RevId: 649065192 Change-Id: I0a57f580c1cb3a03184950e3e5ea24e9ef4962b4 — committed to bazel-io/bazel by fmeum 2 years ago
- Fix coverage tests with experimental flags Adds the new `test/shell/test_coverage_helper.sh` file, which defines (amongst other helpers) `COVERAGE_FLAGS` as containing: - `--experimental_fetch_all_c... — committed to mbland/rules_scala by mbland 2 years ago
+1 to reopening, given that the cherry-pick was aborted.
I’m seeing the same thing with coverage on rules_python targets.
Edit: Due to unrelated blockers, I haven’t been able to test if this was fixed in Bazel 8.0.0 yet
I just discovered that this has been fixed by https://github.com/bazelbuild/bazel/commit/404d8d97fafedb7c43a3c164a7446d2e1bf2e436. I sent https://github.com/bazelbuild/bazel/pull/22676 to verify this in tests.
Even after this change was merged, and I bumped
rules_rustto Bazel 7.4.1, I still see issues running coverage with this flag enabled https://github.com/bazelbuild/rules_rust/pull/3054Should this be re-opened?
@bazel-io fork 7.4.0