Skip to content

Add configurable skip patterns for cargo build script execroot symlinking#7

Open
walter-zeromatter wants to merge 25 commits intohermeticbuild:mainfrom
walter-zeromatter:pr/cargo-symlink-skip
Open

Add configurable skip patterns for cargo build script execroot symlinking#7
walter-zeromatter wants to merge 25 commits intohermeticbuild:mainfrom
walter-zeromatter:pr/cargo-symlink-skip

Conversation

@walter-zeromatter
Copy link
Copy Markdown

@walter-zeromatter walter-zeromatter commented Mar 20, 2026

Summary

  • New symlink_exec_root_skip_patterns setting for controlling which execroot entries are skipped during CARGO_MANIFEST_DIR symlinking
  • Defaults skip worker temp dirs and VCS directories
  • Windows symlink handling improvements: correct file/directory/junction handling, tolerate missing runfile entries, downgrade removal failures to warnings

dzbarsky and others added 22 commits March 13, 2026 12:43
Replace the --rustc-quit-on-rmeta / .rmeta approach with Buck2-style
hollow rlibs: the RustcMetadata action runs rustc to completion with
-Zno-codegen, emitting a .rlib archive (named -hollow.rlib) that
contains only metadata and optimized MIR.

Key fixes:
- Main Rustc action uses full rlib --extern deps so the SVH embedded
  in the full rlib matches what downstream binaries expect (avoiding
  E0460 with non-deterministic proc macros).
- RUSTC_BOOTSTRAP=1 is set on both actions: it changes the crate hash,
  so inconsistent use would cause SVH mismatch even for deterministic
  crates.
- -Ldependency= points to the _hollow/ subdirectory so the full rlib
  and hollow rlib never appear in the same search path (avoids E0463).
- transitive_metadata_outputs are always included in the sandbox so
  rustc can resolve transitive -Ldependency= references.

Adds an SVH mismatch test that demonstrates the problem with
non-deterministic proc macros (uses a HashMap-based derive macro whose
output varies by OS-seeded random seed).
…king

Adds symlink_exec_root_skip_patterns setting to cargo/settings, allowing
users to control which execroot entries are skipped during CARGO_MANIFEST_DIR
symlinking. Defaults skip worker temp dirs and VCS directories.

Also improves Windows symlink handling:
- Correctly handle file symlinks, directory symlinks, and junctions
- Tolerate missing runfile entries
- Downgrade symlink removal failures to warnings on Windows
…king

Adds symlink_exec_root_skip_patterns setting to cargo/settings, allowing
users to control which execroot entries are skipped during CARGO_MANIFEST_DIR
symlinking. Defaults skip worker temp dirs and VCS directories.

Also improves Windows symlink handling:
- Correctly handle file symlinks, directory symlinks, and junctions
- Tolerate missing runfile entries
- Downgrade symlink removal failures to warnings on Windows
@walter-zeromatter walter-zeromatter marked this pull request as ready for review March 21, 2026 00:38
@dzbarsky dzbarsky force-pushed the main branch 2 times, most recently from d97ab75 to e1ed0e4 Compare April 1, 2026 19:48
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.

4 participants