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 1 commit 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 7 times, most recently 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
@brentleyjones
Copy link
Contributor

@tjgq Bump on this, would be great to get into 8.3.0 rc1 🙏.

@fmeum fmeum force-pushed the 21747-remote-only-symlinks branch 2 times, most recently from 9c1fe35 to 2adab54 Compare May 30, 2025 17:53
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.
@fmeum fmeum force-pushed the 21747-remote-only-symlinks branch from 2adab54 to e5b350e Compare May 30, 2025 18:01
@tjgq
Copy link
Contributor

tjgq commented Jun 11, 2025

I won't be able to review this in time for 8.3.0, sorry.

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
3 participants