about summary refs log tree commit diff
path: root/library/std
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-10-19 10:55:40 +0000
committerbors <bors@rust-lang.org>2024-10-19 10:55:40 +0000
commitc926476d013fbb2ca43bd5259d0a7228009a9cb2 (patch)
treee2c8f8986a802c7c179c601fcb7a68d0d0037a15 /library/std
parentb27f33a4d9c42ee6b5347a75a8a990a883437da9 (diff)
parentbae25968dd802596093212766f4fbd34d33ce416 (diff)
downloadrust-c926476d013fbb2ca43bd5259d0a7228009a9cb2.tar.gz
rust-c926476d013fbb2ca43bd5259d0a7228009a9cb2.zip
Auto merge of #131816 - Zalathar:profiler-feature, r=Kobzol
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.

Fixes #131812.

---

Background: The `profiler_builtins` crate has been an optional dependency of std (behind a cargo feature) ever since it was added back in #42433. But as far as I can tell that has only ever been a convenient way to force the crate to be built, not a genuine dependency.

The side-effect of this false dependency is that toggling `build.profiler` causes a rebuild of std and the compiler, which shouldn't be necessary. This PR therefore makes `profiler_builtins` an optional dependency of the dummy sysroot crate (#108865), rather than a dependency of std.

What makes this change so small is that all of the necessary infrastructure already exists. Previously, bootstrap would enable the `profiler` feature on the sysroot crate, which would forward that feature to std. Now, enabling that feature directly enables sysroot's `profiler_builtins` dependency instead.

---

I believe this is more of a bootstrap change than a libs change, so tentatively:
r? bootstrap
Diffstat (limited to 'library/std')
-rw-r--r--library/std/Cargo.toml2
1 files changed, 0 insertions, 2 deletions
diff --git a/library/std/Cargo.toml b/library/std/Cargo.toml
index 5f8dcde189b..00bebf1b2f7 100644
--- a/library/std/Cargo.toml
+++ b/library/std/Cargo.toml
@@ -18,7 +18,6 @@ panic_unwind = { path = "../panic_unwind", optional = true }
 panic_abort = { path = "../panic_abort" }
 core = { path = "../core", public = true }
 compiler_builtins = { version = "0.1.133" }
-profiler_builtins = { path = "../profiler_builtins", optional = true }
 unwind = { path = "../unwind" }
 hashbrown = { version = "0.15", default-features = false, features = [
     'rustc-dep-of-std',
@@ -98,7 +97,6 @@ backtrace = [
 ]
 
 panic-unwind = ["panic_unwind"]
-profiler = ["profiler_builtins"]
 compiler-builtins-c = ["alloc/compiler-builtins-c"]
 compiler-builtins-mem = ["alloc/compiler-builtins-mem"]
 compiler-builtins-no-asm = ["alloc/compiler-builtins-no-asm"]