Skip to content

Commit 64025bb

Browse files
committed
bootstrap: enable Cargo public-dependency feature for libstd
1 parent d300bff commit 64025bb

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

library/std/Cargo.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
cargo-features = ["public-dependency"]
2+
13
[package]
24
name = "std"
35
version = "0.0.0"
@@ -10,12 +12,12 @@ edition = "2021"
1012
crate-type = ["dylib", "rlib"]
1113

1214
[dependencies]
13-
alloc = { path = "../alloc" }
15+
alloc = { path = "../alloc", public = true }
1416
cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
1517
panic_unwind = { path = "../panic_unwind", optional = true }
1618
panic_abort = { path = "../panic_abort" }
17-
core = { path = "../core" }
18-
libc = { version = "0.2.143", default-features = false, features = ['rustc-dep-of-std'] }
19+
core = { path = "../core", public = true }
20+
libc = { version = "0.2.143", default-features = false, features = ['rustc-dep-of-std'], public = true }
1921
compiler_builtins = { version = "0.1.92" }
2022
profiler_builtins = { path = "../profiler_builtins", optional = true }
2123
unwind = { path = "../unwind" }
@@ -25,7 +27,7 @@ std_detect = { path = "../stdarch/crates/std_detect", default-features = false,
2527
# Dependencies of the `backtrace` crate
2628
addr2line = { version = "0.19.0", optional = true, default-features = false }
2729
rustc-demangle = { version = "0.1.21", features = ['rustc-dep-of-std'] }
28-
miniz_oxide = { version = "0.6.0", optional = true, default-features = false }
30+
miniz_oxide = { version = "0.6.0", optional = true, default-features = false, public = false }
2931
[dependencies.object]
3032
version = "0.30.0"
3133
optional = true

library/std/tests/common/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#![allow(unused)]
22

3+
#![allow(exported_private_dependencies)]
4+
35
use std::env;
46
use std::fs;
57
use std::path::{Path, PathBuf};

src/bootstrap/metadata.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ fn workspace_members(build: &Build) -> impl Iterator<Item = Package> {
7474
let collect_metadata = |manifest_path| {
7575
let mut cargo = Command::new(&build.initial_cargo);
7676
cargo
77+
.env("RUSTC_BOOTSTRAP", "1")
7778
.arg("metadata")
7879
.arg("--format-version")
7980
.arg("1")

src/tools/tidy/src/main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ use std::sync::atomic::{AtomicBool, Ordering};
1616
use std::thread::{self, scope, ScopedJoinHandle};
1717

1818
fn main() {
19+
// Allow using unstable cargo features in the standard library.
20+
// `setenv` might not be thread safe, so run it before using multiple threads.
21+
env::set_var("RUSTC_BOOTSTRAP", "1");
22+
1923
let root_path: PathBuf = env::args_os().nth(1).expect("need path to root of repo").into();
2024
let cargo: PathBuf = env::args_os().nth(2).expect("need path to cargo").into();
2125
let output_directory: PathBuf =

0 commit comments

Comments
 (0)