Use the in-tree `compiler-builtins` for the sysroot Many of `std`'s dependency have a dependency on the crates.io `compiler-builtins` when used with the feature `rustc-std-workspace-core`. Use a Cargo patch to select the in-tree version instead. `compiler-builtins` is also added as a dependency of `rustc-std-workspace-core` so these crates can remove their crates.io dependency in the future. Zulip discussion: [#t-compiler > Using in-tree compiler-builtins](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Using.20in-tree.20compiler-builtins/with/522445336) Once this merges, the following PRs will need to make it to a release for the relevant crates: - https://github.com/rust-lang/getopts/pull/119 (can merge at any time) - https://github.com/rust-lang/hashbrown/pull/625 (can merge at any time) - https://github.com/rust-lang/stdarch/pull/1825 - https://github.com/rust-lang/rustc-demangle/pull/80 - https://github.com/rust-lang/cfg-if/pull/84 - https://github.com/unicode-rs/unicode-width/pull/77 The above should cover all tier 1 targets with no `std` features enabled. The remaining cover the rest: - https://github.com/alexcrichton/dlmalloc-rs/pull/50 (wasm, xous, sgx) - https://github.com/gimli-rs/gimli/pull/769 - https://github.com/r-efi/r-efi/pull/89 (efi) - https://github.com/r-efi/r-efi-alloc/pull/9 (efi) - https://github.com/fortanix/rust-sgx/pull/770 (sgx) - https://github.com/hermit-os/hermit-rs/pull/718 (hermit) - https://github.com/bytecodealliance/wasi-rs/pull/108 (wasi) - https://github.com/gimli-rs/addr2line/pull/345 - https://github.com/oyvindln/adler2/pull/2 - https://github.com/BurntSushi/memchr/pull/180 - https://github.com/Frommi/miniz_oxide/pull/173 - https://github.com/gimli-rs/object/pull/777 try-job: x86_64-gnu try-job: test-various
172 lines
5.6 KiB
TOML
172 lines
5.6 KiB
TOML
cargo-features = ["public-dependency"]
|
|
|
|
[package]
|
|
name = "std"
|
|
version = "0.0.0"
|
|
license = "MIT OR Apache-2.0"
|
|
repository = "https://github.com/rust-lang/rust.git"
|
|
description = "The Rust Standard Library"
|
|
edition = "2024"
|
|
autobenches = false
|
|
|
|
[lib]
|
|
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" }
|
|
core = { path = "../core", public = true }
|
|
compiler_builtins = { path = "../compiler-builtins/compiler-builtins" }
|
|
unwind = { path = "../unwind" }
|
|
hashbrown = { version = "0.15", default-features = false, features = [
|
|
'rustc-dep-of-std',
|
|
] }
|
|
std_detect = { path = "../stdarch/crates/std_detect", default-features = false, features = [
|
|
'rustc-dep-of-std',
|
|
] }
|
|
|
|
# Dependencies of the `backtrace` crate
|
|
rustc-demangle = { version = "0.1.24", features = ['rustc-dep-of-std'] }
|
|
|
|
[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 }
|
|
|
|
[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
|
|
libc = { version = "0.2.172", default-features = false, features = [
|
|
'rustc-dep-of-std',
|
|
], public = true }
|
|
|
|
[target.'cfg(all(not(target_os = "aix"), not(all(windows, target_env = "msvc", not(target_vendor = "uwp")))))'.dependencies]
|
|
object = { version = "0.36.0", default-features = false, optional = true, features = [
|
|
'read_core',
|
|
'elf',
|
|
'macho',
|
|
'pe',
|
|
'unaligned',
|
|
'archive',
|
|
] }
|
|
|
|
[target.'cfg(target_os = "aix")'.dependencies]
|
|
object = { version = "0.36.0", default-features = false, optional = true, features = [
|
|
'read_core',
|
|
'xcoff',
|
|
'unaligned',
|
|
'archive',
|
|
] }
|
|
|
|
[target.'cfg(any(windows, target_os = "cygwin"))'.dependencies.windows-targets]
|
|
path = "../windows_targets"
|
|
|
|
[dev-dependencies]
|
|
rand = { version = "0.9.0", default-features = false, features = ["alloc"] }
|
|
rand_xorshift = "0.4.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'] }
|
|
|
|
[target.x86_64-fortanix-unknown-sgx.dependencies]
|
|
fortanix-sgx-abi = { version = "0.5.0", features = [
|
|
'rustc-dep-of-std',
|
|
], public = true }
|
|
|
|
[target.'cfg(target_os = "hermit")'.dependencies]
|
|
hermit-abi = { version = "0.5.0", features = [
|
|
'rustc-dep-of-std',
|
|
], public = true }
|
|
|
|
[target.'cfg(target_os = "wasi")'.dependencies]
|
|
wasi = { version = "0.11.0", features = [
|
|
'rustc-dep-of-std',
|
|
], default-features = false }
|
|
|
|
[target.'cfg(target_os = "uefi")'.dependencies]
|
|
r-efi = { version = "5.2.0", features = ['rustc-dep-of-std'] }
|
|
r-efi-alloc = { version = "2.0.0", features = ['rustc-dep-of-std'] }
|
|
|
|
[features]
|
|
backtrace = [
|
|
'addr2line/rustc-dep-of-std',
|
|
'object/rustc-dep-of-std',
|
|
'miniz_oxide/rustc-dep-of-std',
|
|
]
|
|
|
|
panic-unwind = ["panic_unwind"]
|
|
compiler-builtins-c = ["alloc/compiler-builtins-c"]
|
|
compiler-builtins-mem = ["alloc/compiler-builtins-mem"]
|
|
compiler-builtins-no-asm = ["alloc/compiler-builtins-no-asm"]
|
|
compiler-builtins-no-f16-f128 = ["alloc/compiler-builtins-no-f16-f128"]
|
|
compiler-builtins-mangled-names = ["alloc/compiler-builtins-mangled-names"]
|
|
llvm-libunwind = ["unwind/llvm-libunwind"]
|
|
system-llvm-libunwind = ["unwind/system-llvm-libunwind"]
|
|
|
|
# Make panics and failed asserts immediately abort without formatting any message
|
|
panic_immediate_abort = [
|
|
"core/panic_immediate_abort",
|
|
"alloc/panic_immediate_abort",
|
|
]
|
|
# Choose algorithms that are optimized for binary size instead of runtime performance
|
|
optimize_for_size = ["core/optimize_for_size", "alloc/optimize_for_size"]
|
|
|
|
# Make `RefCell` store additional debugging information, which is printed out when
|
|
# a borrow error occurs
|
|
debug_refcell = ["core/debug_refcell"]
|
|
# Make `TypeId` store a reference to the name of the type, so that it can print that name.
|
|
debug_typeid = ["core/debug_typeid"]
|
|
|
|
|
|
# Enable std_detect default features for stdarch/crates/std_detect:
|
|
# https://github.com/rust-lang/stdarch/blob/master/crates/std_detect/Cargo.toml
|
|
std_detect_file_io = ["std_detect/std_detect_file_io"]
|
|
std_detect_dlsym_getauxval = ["std_detect/std_detect_dlsym_getauxval"]
|
|
|
|
# Enable using raw-dylib for Windows imports.
|
|
# This will eventually be the default.
|
|
windows_raw_dylib = ["windows-targets/windows_raw_dylib"]
|
|
|
|
[package.metadata.fortanix-sgx]
|
|
# Maximum possible number of threads when testing
|
|
threads = 125
|
|
# Maximum heap size
|
|
heap_size = 0x8000000
|
|
|
|
[[test]]
|
|
name = "pipe-subprocess"
|
|
path = "tests/pipe_subprocess.rs"
|
|
harness = false
|
|
|
|
[[test]]
|
|
name = "sync"
|
|
path = "tests/sync/lib.rs"
|
|
|
|
[[test]]
|
|
name = "floats"
|
|
path = "tests/floats/lib.rs"
|
|
|
|
[[test]]
|
|
name = "thread_local"
|
|
path = "tests/thread_local/lib.rs"
|
|
|
|
[[bench]]
|
|
name = "stdbenches"
|
|
path = "benches/lib.rs"
|
|
test = true
|
|
|
|
[lints.rust.unexpected_cfgs]
|
|
level = "warn"
|
|
check-cfg = [
|
|
# #[cfg(bootstrap)] loongarch32
|
|
'cfg(target_arch, values("loongarch32"))',
|
|
# std use #[path] imports to portable-simd `std_float` crate
|
|
# and to the `backtrace` crate which messes-up with Cargo list
|
|
# of declared features, we therefor expect any feature cfg
|
|
'cfg(feature, values(any()))',
|
|
# Internal features aren't marked known config by default, we use these to
|
|
# gate tests.
|
|
'cfg(target_has_reliable_f16)',
|
|
'cfg(target_has_reliable_f16_math)',
|
|
'cfg(target_has_reliable_f128)',
|
|
'cfg(target_has_reliable_f128_math)',
|
|
]
|