Skip to content

Lazily create local symlinks with BwoB #26045

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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented May 9, 2025

Unconditionally creating symlinks results in unnecessary I/O and may not even be supported by the host (e.g. on Windows). Instead, only create symlinks in the remote action file system and rely on the prefetcher to materialize them when needed by downstream actions. This applies to both "alias" symlinks (declare_file, but materialized as a symlink to some other file) and "unresolved" symlinks (declare_symlink).

Fixes #21747

RELNOTES[inc]: Symlinks are now treated just like regular files with --remote_download_minimal and --remote_download_toplevel and may not be materialized on disk if not requested explicitly. Symlinks created for outputs declared via ctx.actions.declare_file may now be materialized with absolute target paths, even when the action creating them uses a relative symlink. Use ctx.actions.declare_symlink for precise control over the target path.

@fmeum
Copy link
Collaborator Author

fmeum commented May 9, 2025

FYI @tjgq

@fmeum fmeum force-pushed the 21747-remote-only-symlinks branch 5 times, most recently from c25cdd7 to 15828ca Compare May 15, 2025 20:43
fmeum added 9 commits May 15, 2025 22:46
Unconditionally creating symlinks results in unnecessary I/O and may not even be supported by the host (e.g. on Windows). Instead, only create it in the remote action file system and rely on the prefetcher to materialize it when needed by downstream actions.
# Conflicts:
#	src/main/java/com/google/devtools/build/lib/remote/RemoteActionFileSystem.java
@fmeum fmeum force-pushed the 21747-remote-only-symlinks branch from 15828ca to b7886e5 Compare May 15, 2025 20:47
@fmeum fmeum force-pushed the 21747-remote-only-symlinks branch from b7886e5 to 0847339 Compare May 15, 2025 20:50
@fmeum fmeum marked this pull request as ready for review May 15, 2025 22:47
@fmeum fmeum requested a review from a team as a code owner May 15, 2025 22:47
@github-actions github-actions bot added team-Performance Issues for Performance teams team-Remote-Exec Issues and PRs for the Execution (Remote) team awaiting-review PR is awaiting review from an assigned reviewer labels May 15, 2025
@fmeum fmeum requested a review from tjgq May 15, 2025 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review PR is awaiting review from an assigned reviewer team-Performance Issues for Performance teams team-Remote-Exec Issues and PRs for the Execution (Remote) team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ctx.actions.symlink + building without the bytes misbehaves on Windows
1 participant