-
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
LcovMerger not properly declared as a tool by StandaloneTestStrategy #4033
Comments
Routing through @lberki to triage. |
Depending on where and how fast we're going with coverage, we may not need to fix this. |
The goal is to, for an action execution, make only a single skyframe edge to every required runfiles tree rather than an edge to every runfiles artifact directly. We accomplish this by pulling the runfiles artifacts' metadata for a particular runfiles tree through the appropriate runfiles middlemen artifact in one batch. This CL fixes #3217. This change makes runfiles middlemen more similar to aggregating middlemen. We however continue to treat runfiles middlemen slightly differently than true aggregating middlemen. Namely, we do not expand runfiles middlemen into the final action inputs. The reasons for this are: 1. It can make latent bugs like #4033 more severe. 2. The runfiles tree builder action's output MANIFEST contains absolute paths, which interferes with remote execution if its metadata is added to a cache hash. 3. In the sandbox, it causes the runfiles artifacts to be mounted at their exec path locations in addition to within the runfiles trees. This makes the sandbox less strict. (Perhaps tolerably?) 4. It saves a modicum of (transient) memory and time to not expand. If the first two issues are fixed, it could be a nice simplification to completely replace runfiles middlemen with aggregating middlemen. Change-Id: I2d2148297f897af4c4c6dc055d87f8a6fad0061e PiperOrigin-RevId: 198307109
We just came into this issue trying to implement |
The goal is to, for an action execution, make only a single skyframe edge to every required runfiles tree rather than an edge to every runfiles artifact directly. We accomplish this by pulling the runfiles artifacts' metadata for a particular runfiles tree through the appropriate runfiles middlemen artifact in one batch. This CL fixes bazelbuild/bazel#3217. This change makes runfiles middlemen more similar to aggregating middlemen. We however continue to treat runfiles middlemen slightly differently than true aggregating middlemen. Namely, we do not expand runfiles middlemen into the final action inputs. The reasons for this are: 1. It can make latent bugs like bazelbuild/bazel#4033 more severe. 2. The runfiles tree builder action's output MANIFEST contains absolute paths, which interferes with remote execution if its metadata is added to a cache hash. 3. In the sandbox, it causes the runfiles artifacts to be mounted at their exec path locations in addition to within the runfiles trees. This makes the sandbox less strict. (Perhaps tolerably?) 4. It saves a modicum of (transient) memory and time to not expand. If the first two issues are fixed, it could be a nice simplification to completely replace runfiles middlemen with aggregating middlemen. Change-Id: I2d2148297f897af4c4c6dc055d87f8a6fad0061e PiperOrigin-RevId: 198307109
Hi there! We're doing a clean up of old issues and will be closing this one. Please reopen (or ping me to reopen) if you’d like to discuss anything further. We’ll respond as soon as we have the bandwidth/resources to do so. |
The default lcov_merger (@bazel_tools//tools/test:lcov_merger) is a java_binary that requires runfiles to work. In StandaloneTestStrategy, it was added to the inputs of TestRunner spawns, but not to tools. This prevents the runfiles from being available to the action, preventing coverage to be collected during remote execution. Fixes bazelbuild#4033
The default lcov_merger (@bazel_tools//tools/test:lcov_merger) is a java_binary that requires runfiles to work. In StandaloneTestStrategy, it was added to the inputs of TestRunner spawns, but not to tools. This prevents the runfiles from being available to the action, preventing coverage to be collected during remote execution. Fixes bazelbuild#4033
I think this is fixed in Bazel 8 (tested on 8.0.0rc2). Can anyone else double check? |
If coverage is enabled,
TestActionBuilder
sticks theLcovMerger
tool'sFilesToRun
into the test action's inputs. This suffices to build theLcovMerger
executable and runfiles tree before running the test. However, sinceStandaloneTestStrategy
does not includeLcovMerger
as a tool in the underlying test-running spawn, the sandbox fails to mountLcovMerger
's runfiles tree into the sandbox execroot. This "works" now because the wrapper script for LcovMerger follows symlinks back into the real execroot. Given that such behavior isn't correct, a future stricter sandbox implementation could break coverage.The text was updated successfully, but these errors were encountered: