Make profiler_builtins an optional dependency of sysroot, not std

This avoids unnecessary rebuilds of std (and the compiler) when
`build.profiler` is toggled off or on.
This commit is contained in:
Zalathar 2024-10-17 16:54:22 +11:00
parent 7342830c05
commit bae25968dd
3 changed files with 4 additions and 5 deletions

View File

@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo. # This file is automatically @generated by Cargo.
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3 version = 4
[[package]] [[package]]
name = "addr2line" name = "addr2line"
@ -340,7 +340,6 @@ dependencies = [
"object", "object",
"panic_abort", "panic_abort",
"panic_unwind", "panic_unwind",
"profiler_builtins",
"r-efi", "r-efi",
"r-efi-alloc", "r-efi-alloc",
"rand", "rand",
@ -368,6 +367,7 @@ name = "sysroot"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"proc_macro", "proc_macro",
"profiler_builtins",
"std", "std",
"test", "test",
] ]

View File

@ -18,7 +18,6 @@ panic_unwind = { path = "../panic_unwind", optional = true }
panic_abort = { path = "../panic_abort" } panic_abort = { path = "../panic_abort" }
core = { path = "../core", public = true } core = { path = "../core", public = true }
compiler_builtins = { version = "0.1.133" } compiler_builtins = { version = "0.1.133" }
profiler_builtins = { path = "../profiler_builtins", optional = true }
unwind = { path = "../unwind" } unwind = { path = "../unwind" }
hashbrown = { version = "0.15", default-features = false, features = [ hashbrown = { version = "0.15", default-features = false, features = [
'rustc-dep-of-std', 'rustc-dep-of-std',
@ -98,7 +97,6 @@ backtrace = [
] ]
panic-unwind = ["panic_unwind"] panic-unwind = ["panic_unwind"]
profiler = ["profiler_builtins"]
compiler-builtins-c = ["alloc/compiler-builtins-c"] compiler-builtins-c = ["alloc/compiler-builtins-c"]
compiler-builtins-mem = ["alloc/compiler-builtins-mem"] compiler-builtins-mem = ["alloc/compiler-builtins-mem"]
compiler-builtins-no-asm = ["alloc/compiler-builtins-no-asm"] compiler-builtins-no-asm = ["alloc/compiler-builtins-no-asm"]

View File

@ -6,6 +6,7 @@ edition = "2021"
# this is a dummy crate to ensure that all required crates appear in the sysroot # this is a dummy crate to ensure that all required crates appear in the sysroot
[dependencies] [dependencies]
proc_macro = { path = "../proc_macro" } proc_macro = { path = "../proc_macro" }
profiler_builtins = { path = "../profiler_builtins", optional = true }
std = { path = "../std" } std = { path = "../std" }
test = { path = "../test" } test = { path = "../test" }
@ -23,7 +24,7 @@ system-llvm-libunwind = ["std/system-llvm-libunwind"]
panic-unwind = ["std/panic_unwind"] panic-unwind = ["std/panic_unwind"]
panic_immediate_abort = ["std/panic_immediate_abort"] panic_immediate_abort = ["std/panic_immediate_abort"]
optimize_for_size = ["std/optimize_for_size"] optimize_for_size = ["std/optimize_for_size"]
profiler = ["std/profiler"] profiler = ["dep:profiler_builtins"]
std_detect_file_io = ["std/std_detect_file_io"] std_detect_file_io = ["std/std_detect_file_io"]
std_detect_dlsym_getauxval = ["std/std_detect_dlsym_getauxval"] std_detect_dlsym_getauxval = ["std/std_detect_dlsym_getauxval"]
std_detect_env_override = ["std/std_detect_env_override"] std_detect_env_override = ["std/std_detect_env_override"]