bazelbuild / bazelbuild/bazel

Do not create runfile trees unnecessarily when building without the bytes

Open
#18,580 6 comments 2 reactions 1 assignee Claimed by @fmeum View on GitHub
P1 team-Remote-Exec type: bug
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

Currently, `--remote_download_toplevel` causes *all* runfiles symlink trees to be created (not just the top-level ones), while `--remote_download_minimal` implies `--nobuild_runfile_symlinks` and activates a separate code path (see `RunfilesTreeUpdater`) to create input runfiles trees just before local action execution.

Instead, we should:

1. Return true from `RemoteOutputService#canCreateSymlinks` and provide an empty `RemoteOutputService#createSymlinks` implementation; this ensures the runfiles tree is never materialized as a direct result of running the `SymlinkTreeAction`.
2. Have `SpawnRunner#prefetchInputs` create the runfiles tree before local action execution (as is already the case for other local action inputs).
3. Have `AbstractActionInputPrefetcher#finalizeAction` create the runfiles tree for toplevel targets (as is already the case for other top-level outputs).

This would ensure a minimal set of runfile trees is created in all cases, and let us omit `--nobuild_runfile_links` from the expansion of `--remote_download_minimal`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.