-
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
--run_under discards analysis cache #10782
Comments
It looks like this is used in analysis, like: bazel/src/main/java/com/google/devtools/build/lib/analysis/RunfilesSupport.java Lines 103 to 105 in a0e7b67
Lines 157 to 160 in a11e2d0
Sending to @sdtwigg for triage and prioritization. He's been looking at similar territory. How tightly entwined is |
Correction: It doesn’t seem to throw away my repository rule caches, just the in-memory cache of the target graph. |
Currently, run_under is under CoreOptions, not TestOptions, so it will not benefit from --trim_test_configuration. As noted, references to it are very sparse so it may be possible to refer to it only in the TestActionBuilder and thus this could be moved to the TestConfiguration. This would then solve the related issues under the umbrella of 'productionizing' trim_test_configuration. (e.g. "what if someone has run_under in a select()?", "what if someone tries to transition run_under?", etc.) |
Stephen - didn't we find out that there are some real references that make it non-trivial to extract out? If it only affects actions top-level targets (vs. everything in the graph), I think that would open up better options. |
The --run_under option also applies to the run command when used with binary targets, not just to test targets. If run_under refers to a target, then it must be analyzed in the analysis phase. In other cases, it may be possible to rewrite the code to inject the flag in the execution phase instead. We do something similar for inherited env variables. |
What does this mean? How can it refer to a target? |
The most common workaround recommended for running a bazel target with Having |
FYI I wrote about the best workaround I know of, see https://blog.aspect.build/run-tools-installed-by-bazel
|
Description of the problem / feature request:
When I use
bazel run --run_under //sometarget
and thenbazel build //sometarget
after:Which completely discards all repository rules as well.
Feature requests: what underlying problem are you trying to solve with this feature?
Just trying to run stuff to test artifacts.
--run_under
is not even an option tobuild
, so why does it invalidate the analysis cache. It’s also only relevant to the execution of a generated artifact, so I don’t see why it should influence the build at all.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
as above
What operating system are you running Bazel on?
Nixos 20.01
What's the output of
bazel info release
?If
bazel info release
returns "development version" or "(@non-git)", tell us how you built Bazel.nixpkgs
Have you found anything relevant by searching the web?
doesn’t seem to be an issue in the tracker
The text was updated successfully, but these errors were encountered: