Skip to content

Reduce inputs for remote actions - #4384

Open
patrickmscott wants to merge 1 commit into
bazelbuild:mainfrom
patrickmscott:reduce-remote-inputs
Open

patrickmscott wants to merge 1 commit into
bazelbuild:mainfrom
patrickmscott:reduce-remote-inputs

Conversation

@patrickmscott

Copy link
Copy Markdown
Contributor

Similar to #4235, this change reduces the files needed for all rust actions.

Rustc, Clippy, Rustdoc and unpretty actions took toolchain.all_files (cargo, clippy-driver, rustdoc, rustfmt, cargo-clippy and the whole C++ toolchain) plus the C++ linker files and runtime libs, for every crate type, and remote executors stage every input of every action.

They now take toolchain.compile_files, the sysroot without those tools, and the C++ linker files and runtime libs only where linker inputs already went. Clippy and Rustdoc add their own tool. compile_files also holds dlltool or, on Windows GNU without one, the C++ toolchain's files, where rustc finds the dlltool it runs for rlibs too. toolchain.all_files is unchanged.

_symlink_sysroot_tree stripped the target's repository from each path, not the file's own, so files that a target forwards from another repository, such as a main-repository rustc_lib filtering a toolchain's libraries, landed in /external//lib instead of /lib, where rustc's $ORIGIN/../lib RUNPATH looks. rustc found librustc_driver only by resolving its own symlink, which fails where inputs are staged as plain files, as on remote executors. Strip each file's own repository instead.

Similar to bazelbuild#4235, this
change reduces the files needed for all rust actions.

Rustc, Clippy, Rustdoc and unpretty actions took toolchain.all_files
(cargo, clippy-driver, rustdoc, rustfmt, cargo-clippy and the whole C++
toolchain) plus the C++ linker files and runtime libs, for every crate
type, and remote executors stage every input of every action.

They now take toolchain.compile_files, the sysroot without those tools,
and the C++ linker files and runtime libs only where linker inputs
already went. Clippy and Rustdoc add their own tool. compile_files
also holds dlltool or, on Windows GNU without one, the C++ toolchain's
files, where rustc finds the dlltool it runs for rlibs too.
toolchain.all_files is unchanged.

_symlink_sysroot_tree stripped the target's repository from each path,
not the file's own, so files that a target forwards from another
repository, such as a main-repository rustc_lib filtering a toolchain's
libraries, landed in <sysroot>/external/<repo>/lib instead of
<sysroot>/lib, where rustc's $ORIGIN/../lib RUNPATH looks. rustc
found librustc_driver only by resolving its own symlink, which fails
where inputs are staged as plain files, as on remote executors.
Strip each file's own repository instead.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant