Skip to content

Disable path mapping for Rust linking actions - #4193

Open
tamird wants to merge 1 commit into
bazelbuild:mainfrom
tamird:fix/rustc-linker-path-mapping
Open

Disable path mapping for Rust linking actions#4193
tamird wants to merge 1 commit into
bazelbuild:mainfrom
tamird:fix/rustc-linker-path-mapping

Conversation

@tamird

@tamird tamird commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

C/C++ toolchain APIs flatten selected linker paths and feature-expanded
arguments into strings. With path mapping enabled, generated linker,
library-search, resource, and CRT paths retain their real configuration
while the execution sandbox uses mapped paths, causing native links to
fail.

Do not advertise path mapping for actions that link native artifacts,
including WebAssembly links with native dependencies. Retain mapping
for Rust libraries, metadata-only actions, ordinary documentation, and
WebAssembly links without native dependencies.

Use configuration-independent substitution tokens for generated-file
paths in compiler environment files. Resolve each token from its File
in the consuming action so shared environment files remain valid for
both mapped and unmapped layouts.

Assisted-by: Codex

@tamird tamird closed this Aug 1, 2026
@tamird
tamird force-pushed the fix/rustc-linker-path-mapping branch from e21cb00 to 60231db Compare August 1, 2026 10:57
@tamird tamird reopened this Aug 1, 2026
@tamird
tamird force-pushed the fix/rustc-linker-path-mapping branch from 80faf8d to f475019 Compare August 1, 2026 11:11

@UebelAndre UebelAndre left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I had just one question

Comment thread rust/private/rustc.bzl Outdated
@tamird
tamird marked this pull request as draft August 1, 2026 13:27
@tamird

tamird commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

I'm not entirely happy with this; marking as draft for now.

@tamird
tamird force-pushed the fix/rustc-linker-path-mapping branch from f475019 to e99792b Compare August 1, 2026 14:42
@tamird tamird changed the title Fix path mapping for generated linker paths Disable path mapping for Rust linking actions Aug 1, 2026
@tamird
tamird marked this pull request as ready for review August 1, 2026 14:43
@tamird
tamird force-pushed the fix/rustc-linker-path-mapping branch 8 times, most recently from d6a5e4c to 7cd5916 Compare August 1, 2026 16:23
C/C++ toolchain APIs flatten selected linker paths and feature-expanded
arguments into strings. With path mapping enabled, generated linker,
library-search, resource, and CRT paths retain their real configuration
while the execution sandbox uses mapped paths, causing native links to
fail.

Do not advertise path mapping for actions that link native artifacts,
including WebAssembly native dependencies. Retain mapping for Rust
libraries, metadata, and ordinary documentation.

Represent generated-file paths in compiler environment files as
substitution tokens. Resolve each token from its File in the consuming
action so shared environment files remain valid for both mapped and
unmapped layouts.

Assisted-by: Codex
@tamird
tamird force-pushed the fix/rustc-linker-path-mapping branch from 7cd5916 to 0435525 Compare August 1, 2026 16:52
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