Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DONT MERGE] fix(libstd): switch to -Zpublic-dependency cargo flag #121710

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions library/std/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
cargo-features = ["public-dependency"]

[package]
name = "std"
version = "0.0.0"
Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap/src/core/build_steps/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ macro_rules! clean_crate_tree {
// Since https://github.com/rust-lang/rust/pull/111076 enables
// unstable cargo feature (`public-dependency`), we need to ensure
// that unstable features are enabled before reading libstd Cargo.toml.
cargo.env("RUSTC_BOOTSTRAP", "1");
cargo.env("RUSTC_BOOTSTRAP", "1")
.arg("-Zpublic-dependency");

for krate in &*self.crates {
cargo.arg("-p");
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/src/core/build_steps/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,7 @@ impl Step for PlainSourceTarball {
// Will read the libstd Cargo.toml
// which uses the unstable `public-dependency` feature.
.env("RUSTC_BOOTSTRAP", "1")
.arg("-Zpublic-dependency")
.current_dir(plain_dst_src);

let config = if !builder.config.dry_run() {
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2899,6 +2899,7 @@ impl Step for Distcheck {
// Will read the libstd Cargo.toml
// which uses the unstable `public-dependency` feature.
.env("RUSTC_BOOTSTRAP", "1")
.arg("-Zpublic-dependency")
.arg("generate-lockfile")
.arg("--manifest-path")
.arg(&toml)
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/src/core/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1799,6 +1799,9 @@ impl<'a> Builder<'a> {

// Enable usage of unstable features
cargo.env("RUSTC_BOOTSTRAP", "1");
// In addition, we enable Cargo's `-Zpublic-dependency` so that every
// build runs `exported-private-dependencies` and suppress unstable warnings.
cargo.arg("-Zpublic-dependency");

if self.config.dump_bootstrap_shims {
prepare_behaviour_dump_dir(self.build);
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/src/core/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ fn workspace_members(build: &Build) -> impl Iterator<Item = Package> {
// Will read the libstd Cargo.toml
// which uses the unstable `public-dependency` feature.
.env("RUSTC_BOOTSTRAP", "1")
.arg("-Zpublic-dependency")
.arg("metadata")
.arg("--format-version")
.arg("1")
Expand Down
Loading