Skip to content

fix: Mitigate the -L dependency= consolidation races on Windows under cc_common.link - #82

Merged
dzbarsky merged 1 commit into
hermeticbuild:mainfrom
ArchangelX360:archangelx360/races
Oct 5, 2026
Merged

dzbarsky merged 1 commit into
hermeticbuild:mainfrom
ArchangelX360:archangelx360/races

Conversation

@ArchangelX360

Copy link
Copy Markdown

Keep .a files out of the unified dependency directory of the Windows process wrapper.

On Windows, process_wrapper merges every -Ldependency= directory into one, to keep the command line short. It scans each directory with read_dir, so it also sees files that are no input of the action. rules_rust puts a lib<name>.a symlink next to each rlib, for cc_common.link. With experimental_use_cc_common_link, Bazel builds those symlinks while sibling Rustc actions scan the directory, and the copy fails with "Access is denied".

-L dependency= only searches for crates, and no crate is a .a file, so skip the extension.

Relates to #48

… `cc_common.link`

Keep `.a` files out of the unified dependency directory of the Windows process wrapper.

On Windows, `process_wrapper` merges every `-Ldependency=` directory into one, to keep the command line short. It scans each directory with `read_dir`, so it also sees files that are no input of the action. `rules_rust` puts a `lib<name>.a` symlink next to each rlib, for `cc_common.link`. With `experimental_use_cc_common_link`, Bazel builds those symlinks while sibling `Rustc` actions scan the directory, and the copy fails with "Access is denied".

`-L dependency=` only searches for crates, and no crate is a `.a` file, so skip the extension.

Relates to hermeticbuild#48
@dzbarsky
dzbarsky merged commit e51ad65 into hermeticbuild:main Oct 5, 2026
0 of 3 checks passed
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.

2 participants