Skip to content

Add a dependency on the cc_wrapper, so it's present when rust_binary …#19

Merged
davidzchen merged 1 commit into
bazelbuild:masterfrom
kchodorow:master
Jul 25, 2016
Merged

Add a dependency on the cc_wrapper, so it's present when rust_binary …#19
davidzchen merged 1 commit into
bazelbuild:masterfrom
kchodorow:master

Conversation

@kchodorow
Copy link
Copy Markdown
Contributor

…is executed

Otherwise, the local_config_cc isn't written to the execroot on OS X because it
isn't a dependency of the build rule.

Fixes bazelbuild/bazel#1556.

…is executed

Otherwise, the local_config_cc isn't written to the execroot on OS X because it
isn't a dependency of the build rule.

Fixes bazelbuild/bazel#1556.
@davidzchen
Copy link
Copy Markdown
Member

LGTM. Thanks!

@davidzchen davidzchen merged commit 7c4f8d1 into bazelbuild:master Jul 25, 2016
walter-zeromatter added a commit to walter-zeromatter/rules_rust that referenced this pull request May 8, 2026
)

* When '--strategy=Rustc=local' is used with pipelined compilation, rustc's -Ldependency scan can pick up the _meta.rlib alongside the full '.rlbi', producing undefined-symbol link errors. To avoid this, emit the hollow metadata rlibs into a '_meta/' subdirectory, and add an explicit link to that directory for any metadata-consuming actions. (bazelbuild#17)

* Add RUSTC_BOOTSTRAP guardrail for -Zno-codegen pipelining

Injects RUSTC_BOOTSTRAP=1 + -Zallow-features= (empty list) on the metadata
and full compile actions when pipelined_compilation is enabled on a
stable/beta toolchain. The bootstrap env is required for -Zno-codegen on
non-nightly rustc and must match across both actions for SVH compatibility.
The empty allow-features list prevents the bootstrap env from silently
unlocking #![feature(...)] in user code.

Nightly toolchains skip both injections: unstable features are already
allowed, and the guardrail would break legitimate #![feature(...)] usage.

Escape hatch: if the user sets RUSTC_BOOTSTRAP in rustc_env / shell env or
passes -Zallow-features=... via rustc_flags / extra_rustc_flag, rules_rust
treats their configuration as authoritative and skips both injections.

Tests:
- //test/pipelining_bootstrap_gate: manual target that #![feature(trait_alias)]
  to validate E0725 fires on stable under the guardrail.
- //test/unit/pipelined_compilation: guardrail_{baseline,user_env,user_flag,
  space_form,global_env,global_flag}_optout_test variants.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants