-
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
Directory artifact not present in sandbox using Bazel 6.0.0rc2 #16789
Comments
cc @fmeum |
cc @alexeagle |
@bazel-io flag |
@bazel-io fork 6.0.0 |
Does this issue also happen with Bazel@HEAD? I wonder what change we need to make/cherry-pick to fix this. |
I tried
I'll try a local build @Head. |
@meteorcloudy I tested with a local built at HEAD:
and the repro is still failing |
/cc @coeuvre Can you look into this issue? |
bisect points me to dfccbf9. Working on the fix. |
…rame later Currently, they are symlinks. For other outputs, let skyframe read action file system to construct the metadata. Before this change, we inject metadata of symlink outputs, tree outputs and file outputs inside `RemoteActionFileSystem#flush()` if these outputs are stored inside the in-memory fs. If the outputs are somehow generated in the local fs, skyframe will read the fs later to construct metadata for them. However, for tree outputs, skyframe always create an empty directory before action execution in the in-memory fs. So inside the `flush`, we always inject metadata for it. It means local tree outputs are ignored. We could update the code to also read local file system when reading tree files, but then the problem is how to construct metadata from file status which is well done by skyframe. So instead of injecting metadata by traversal the filesystem inside `flush`, we just let skyframe to do the job. Fixes bazelbuild#16789. Closes bazelbuild#16812. PiperOrigin-RevId: 491622005 Change-Id: I10434e6856a1b2a207f39e07122a9b646edf518c
… by skyf… (#16879) * Update RemoteActionFileSystem to apply permission changes to local files even if remote file exists. Previously, it only applies permission changes to local files when the remote one doesn't exist. It is fine because the call sites only use these method when remote file are missing. However, this isn't true with future changes. PiperOrigin-RevId: 490872822 Change-Id: I7a19d99cd828294cbafa7b5f3fdc368d64e556ec * Fix permission operations for the case of only remote directory. PiperOrigin-RevId: 491280334 Change-Id: I30afef9f069eca8aee4d983664f42b3961e95adf * Only inject metadata for outputs that cannot be reconstructed by skyframe later Currently, they are symlinks. For other outputs, let skyframe read action file system to construct the metadata. Before this change, we inject metadata of symlink outputs, tree outputs and file outputs inside `RemoteActionFileSystem#flush()` if these outputs are stored inside the in-memory fs. If the outputs are somehow generated in the local fs, skyframe will read the fs later to construct metadata for them. However, for tree outputs, skyframe always create an empty directory before action execution in the in-memory fs. So inside the `flush`, we always inject metadata for it. It means local tree outputs are ignored. We could update the code to also read local file system when reading tree files, but then the problem is how to construct metadata from file status which is well done by skyframe. So instead of injecting metadata by traversal the filesystem inside `flush`, we just let skyframe to do the job. Fixes #16789. Closes #16812. PiperOrigin-RevId: 491622005 Change-Id: I10434e6856a1b2a207f39e07122a9b646edf518c Co-authored-by: kshyanashree <[email protected]>
Confirmed that this change fixes the problem observed on rules_js with Bazel 6.0.0rc1 & rc2. aspect-build/rules_js#659 updates rules_js to Thanks for the quick fix @coeuvre ! |
Thanks for confirming! |
Description of the bug:
Using Bazel 6.0.0rc1 or rc2 and with
--remote_download_outputs=toplevel
(orminimal
),remote_cache
(ordisk_cache
) & sandboxed execution, directory artifacts are not present in runfiles in the sandbox.Conditions for issue
ctx.actions.declare_directory
) in runfiles of a test or binary target--remote_cache
(or--disk_cache
enabled)--remote_download_outputs=toplevel
(orminimal
)Issue
The output directory is not present in the sandbox when the test or binary target is run.
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Clone https://github.com/gregmagolan/bazel_6_remote_download_outputs_repro
Run
./repro.sh
to run a test that fails if the directory artifact is not present in runfiles. Removing the--remote_download_outputs
flag -or- running with--spawn_strategy=local
makes the test pass.Which operating system are you running Bazel on?
MacOS (but the issue has also been observed on Linux CI)
What is the output of
bazel info release
?release 6.0.0rc2
If
bazel info release
returnsdevelopment 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
?Have you found anything relevant by searching the web?
No
Any other information, logs, or outputs that you want to share?
First observed when updating rules_js to Bazel 6.0.0rc1. rules_js makes heavy use of directory artifacts for the node_modules virtual store
The text was updated successfully, but these errors were encountered: