-
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
bazel run
when using --experimental_remote_spawn_cache
is broken
#4041
Comments
@hhclam We talked about this briefly at Bazel conf |
Saw this problem too. Will look. |
I verified that master still has this issue. Also I verified that --spawn_strategy=remote --remote_rest_cache works with both 0.7.0 and master. This seems to be a problem with --experimental_remote_spawn_cache only. |
I have a fix. |
- remove BaseSpawn.Local; instead, all callers pass in the full set of execution requirements they want to set - disable caching and sandboxing for the symlink tree action - it does not declare outputs, so it can't be cached or sandboxed (fixes bazelbuild#4041) - centralize the existing execution requirements in the ExecutionRequirements class - centralize checking for execution requirements in the Spawn class (it's possible that we may need a more decentralized, extensible design in the future, but for now having them in a single place is simple and effective) - update the documentation - forward the relevant tags to execution requirements in TargetUtils (progress on bazelbuild#3960) - this also contributes to bazelbuild#4153 PiperOrigin-RevId: 177288598
We ran into this when rolling out remote cache, and it's causing some havoc. Any chance of a 0.8.1 release in the near term including this fix, or should I build my own to hold us over to 0.9.0? |
Instead use SimpleSpawn. Also set the execution requirements properly - in particular, we need to disable caching and sandboxing for these spawns. Fixes bazelbuild#4041. PiperOrigin-RevId: 177132445 Change-Id: Iaaa2f2b8ff75d14c70a70de47616671e0bf5d697
Gulp, ok I'll give it a shot. Thank you |
Will this fix be included in the next release? If so, when will be the next release? Thanks! |
FYI, here's the version I built. |
Cool. Let me try it out. Thanks again! |
Looks like the newest release 0.8.1 didn't include the fix? So sad... |
For others who are tracking this, it looks like the above-mentioned commits (well, cherry-picks of them) are in the |
Description of the problem / feature request / question:
bazel run
, of at leastsh_binary
andjava_binary
targets, does not work when the target is fetched from the remote cache. The runfiles directory for the target is not recreated. I get output like:This problem does not seem to exist for executable
genrule
s. This problem occurs both with and without using the--script_path
flag. We usebazel run
commands for significant portions of our deployment process, so this is blocking our adoption of remote caching.If possible, provide a minimal example to reproduce the problem:
Start with cold local and remote caches.
Run
bazel run //:script
and notice that it succeeds, i.e. its output is:Clean the local cache with
bazel clean
, but leave the remote cache warmed.Run
bazel run //:script
again and notice that it fails, i.e. its output is:Environment info
Operating System:
Ubuntu 16.04
Bazel version (output of
bazel info release
):Release
0.7.0
and built fromHEAD
(commit67c84b1036ad02ba2384fa75fb28e779a488f3d4
on Nov 6, 2017)Have you found anything relevant by searching the web?
#3934 looked maybe related, but this problem is still occurring with Bazel built from HEAD, so apparently it isn't. It might be the same problem as this: https://groups.google.com/forum/#!topic/bazel-discuss/O-pockbTV8M
Anything else, information or logs or outputs that would be helpful?
(If they are large, please upload as attachment or provide link).
The text was updated successfully, but these errors were encountered: