Skip to content

Commit

Permalink
overzealously mark sysroot deps private
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Jan 14, 2025
1 parent 4693040 commit 560b580
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 40 deletions.
6 changes: 4 additions & 2 deletions library/alloc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cargo-features = ["public-dependency"]

[package]
name = "alloc"
version = "0.0.0"
Expand All @@ -9,8 +11,8 @@ autobenches = false
edition = "2021"

[dependencies]
core = { path = "../core" }
compiler_builtins = { version = "=0.1.140", features = ['rustc-dep-of-std'] }
core = { path = "../core", public = true }
compiler_builtins = { version = "=0.1.140", features = ['rustc-dep-of-std'], public = false }

[dev-dependencies]
rand = { version = "0.8.5", default-features = false, features = ["alloc"] }
Expand Down
12 changes: 7 additions & 5 deletions library/panic_abort/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cargo-features = ["public-dependency"]

[package]
name = "panic_abort"
version = "0.0.0"
Expand All @@ -12,10 +14,10 @@ bench = false
doc = false

[dependencies]
alloc = { path = "../alloc" }
cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
core = { path = "../core" }
compiler_builtins = "0.1.0"
alloc = { path = "../alloc", public = true }
cfg-if = { version = "1.0", features = ['rustc-dep-of-std'], public = false }
core = { path = "../core", public = false }
compiler_builtins = { version = "0.1.0", public = false }

[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
libc = { version = "0.2", default-features = false }
libc = { version = "0.2", default-features = false, public = false }
14 changes: 8 additions & 6 deletions library/panic_unwind/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cargo-features = ["public-dependency"]

[package]
name = "panic_unwind"
version = "0.0.0"
Expand All @@ -12,14 +14,14 @@ bench = false
doc = false

[dependencies]
alloc = { path = "../alloc" }
core = { path = "../core" }
unwind = { path = "../unwind" }
compiler_builtins = "0.1.0"
cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
alloc = { path = "../alloc", public = true }
core = { path = "../core", public = true }
unwind = { path = "../unwind", public = false }
compiler_builtins = { version = "0.1.0", public = false }
cfg-if = { version = "1.0", features = ['rustc-dep-of-std'], public = false }

[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
libc = { version = "0.2", default-features = false }
libc = { version = "0.2", default-features = false, public = false }

[lints.rust.unexpected_cfgs]
level = "warn"
Expand Down
28 changes: 14 additions & 14 deletions library/std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@ crate-type = ["dylib", "rlib"]

[dependencies]
alloc = { path = "../alloc", public = true }
cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
panic_unwind = { path = "../panic_unwind", optional = true }
panic_abort = { path = "../panic_abort" }
cfg-if = { version = "1.0", features = ['rustc-dep-of-std'], public = false }
panic_unwind = { path = "../panic_unwind", optional = true, public = false }
panic_abort = { path = "../panic_abort", public = false }
core = { path = "../core", public = true }
compiler_builtins = { version = "=0.1.140" }
compiler_builtins = { version = "=0.1.140", public = false }
unwind = { path = "../unwind" }
hashbrown = { version = "0.15", default-features = false, features = [
'rustc-dep-of-std',
] }
], public = false }
std_detect = { path = "../stdarch/crates/std_detect", default-features = false, features = [
'rustc-dep-of-std',
] }
], public = false }

# Dependencies of the `backtrace` crate
rustc-demangle = { version = "0.1.24", features = ['rustc-dep-of-std'] }
rustc-demangle = { version = "0.1.24", features = ['rustc-dep-of-std'], public = false }

[target.'cfg(not(all(windows, target_env = "msvc", not(target_vendor = "uwp"))))'.dependencies]
miniz_oxide = { version = "0.8.0", optional = true, default-features = false }
addr2line = { version = "0.24.0", optional = true, default-features = false }
miniz_oxide = { version = "0.8.0", optional = true, default-features = false, public = false }
addr2line = { version = "0.24.0", optional = true, default-features = false, public = false }

[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
libc = { version = "0.2.169", default-features = false, features = [
Expand All @@ -46,15 +46,15 @@ object = { version = "0.36.0", default-features = false, optional = true, featur
'pe',
'unaligned',
'archive',
] }
], public = false }

[target.'cfg(target_os = "aix")'.dependencies]
object = { version = "0.36.0", default-features = false, optional = true, features = [
'read_core',
'xcoff',
'unaligned',
'archive',
] }
], public = false }

[target.'cfg(windows)'.dependencies.windows-targets]
path = "../windows_targets"
Expand All @@ -64,7 +64,7 @@ rand = { version = "0.8.5", default-features = false, features = ["alloc"] }
rand_xorshift = "0.3.0"

[target.'cfg(any(all(target_family = "wasm", target_os = "unknown"), target_os = "xous", all(target_vendor = "fortanix", target_env = "sgx")))'.dependencies]
dlmalloc = { version = "0.2.4", features = ['rustc-dep-of-std'] }
dlmalloc = { version = "0.2.4", features = ['rustc-dep-of-std'], public = false }

[target.x86_64-fortanix-unknown-sgx.dependencies]
fortanix-sgx-abi = { version = "0.5.0", features = [
Expand All @@ -82,8 +82,8 @@ wasi = { version = "0.11.0", features = [
], default-features = false }

[target.'cfg(target_os = "uefi")'.dependencies]
r-efi = { version = "4.5.0", features = ['rustc-dep-of-std'] }
r-efi-alloc = { version = "1.0.0", features = ['rustc-dep-of-std'] }
r-efi = { version = "4.5.0", features = ['rustc-dep-of-std'], public = false }
r-efi-alloc = { version = "1.0.0", features = ['rustc-dep-of-std'], public = false }

[features]
backtrace = [
Expand Down
10 changes: 6 additions & 4 deletions library/sysroot/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
cargo-features = ["public-dependency"]

[package]
name = "sysroot"
version = "0.0.0"
edition = "2021"

# this is a dummy crate to ensure that all required crates appear in the sysroot
[dependencies]
proc_macro = { path = "../proc_macro" }
profiler_builtins = { path = "../profiler_builtins", optional = true }
std = { path = "../std" }
test = { path = "../test" }
proc_macro = { path = "../proc_macro", public = true }
profiler_builtins = { path = "../profiler_builtins", optional = true, public = false }
std = { path = "../std", public = true }
test = { path = "../test", public = false }

# Forward features to the `std` crate as necessary
[features]
Expand Down
10 changes: 6 additions & 4 deletions library/test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
cargo-features = ["public-dependency"]

[package]
name = "test"
version = "0.0.0"
edition = "2021"

[dependencies]
getopts = { version = "0.2.21", features = ['rustc-dep-of-std'] }
std = { path = "../std" }
core = { path = "../core" }
getopts = { version = "0.2.21", features = ['rustc-dep-of-std'], public = false }
std = { path = "../std", public = true }
core = { path = "../core", public = true }

[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
libc = { version = "0.2.150", default-features = false }
libc = { version = "0.2.150", default-features = false, public = false }
12 changes: 7 additions & 5 deletions library/unwind/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cargo-features = ["public-dependency"]

[package]
name = "unwind"
version = "0.0.0"
Expand All @@ -14,15 +16,15 @@ bench = false
doc = false

[dependencies]
core = { path = "../core" }
compiler_builtins = "0.1.0"
cfg-if = "1.0"
core = { path = "../core", public = true }
compiler_builtins = { version = "0.1.0", public = false }
cfg-if = { version = "1.0", public = false }

[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
libc = { version = "0.2.140", features = ['rustc-dep-of-std'], default-features = false }
libc = { version = "0.2.140", features = ['rustc-dep-of-std'], default-features = false, public = false }

[target.'cfg(target_os = "xous")'.dependencies]
unwinding = { version = "0.2.5", features = ['rustc-dep-of-std', 'unwinder', 'fde-custom'], default-features = false }
unwinding = { version = "0.2.5", features = ['rustc-dep-of-std', 'unwinder', 'fde-custom'], default-features = false, public = false }

[features]

Expand Down

0 comments on commit 560b580

Please sign in to comment.