about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorThe 8472 <git@infinite-source.de>2022-08-15 16:24:07 +0200
committerThe 8472 <git@infinite-source.de>2022-08-15 16:24:07 +0200
commit84531229bb923cdad698f271bdc1311f67f174e8 (patch)
tree2cab28f1b7a68f578c808c70705c5d54c1fa9e46 /src/tools
parent6ce76091c7cef21692a15dce1f0a4c415d245be4 (diff)
downloadrust-84531229bb923cdad698f271bdc1311f67f174e8.tar.gz
rust-84531229bb923cdad698f271bdc1311f67f174e8.zip
Revert "Revert "Remove num_cpus dependency from bootstrap, build-manifest and rustc_session""
This reverts commit 1ae4b258267462da0b1aae1badcf83578153c799.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/build-manifest/Cargo.toml1
-rw-r--r--src/tools/build-manifest/src/main.rs2
2 files changed, 1 insertions, 2 deletions
diff --git a/src/tools/build-manifest/Cargo.toml b/src/tools/build-manifest/Cargo.toml
index c022d3aa0ac..c437bde5ae6 100644
--- a/src/tools/build-manifest/Cargo.toml
+++ b/src/tools/build-manifest/Cargo.toml
@@ -13,4 +13,3 @@ tar = "0.4.29"
 sha2 = "0.10.1"
 rayon = "1.5.1"
 hex = "0.4.2"
-num_cpus = "1.13.0"
diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs
index efe3f2b618b..1a6760d8c68 100644
--- a/src/tools/build-manifest/src/main.rs
+++ b/src/tools/build-manifest/src/main.rs
@@ -210,7 +210,7 @@ fn main() {
     let num_threads = if let Some(num) = env::var_os("BUILD_MANIFEST_NUM_THREADS") {
         num.to_str().unwrap().parse().expect("invalid number for BUILD_MANIFEST_NUM_THREADS")
     } else {
-        num_cpus::get()
+        std::thread::available_parallelism().map_or(1, std::num::NonZeroUsize::get)
     };
     rayon::ThreadPoolBuilder::new()
         .num_threads(num_threads)