From fde113591680c96459abdc4aae5d2b0dc21da87b Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Thu, 1 Oct 2020 17:25:54 +0200 Subject: [PATCH] build-manifest: avoid collecting SHAs in parallel on legacy mode This avoids overloading the old server, and disrupting the other programs running on it. --- src/tools/build-manifest/src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs index 91f042a07d4b..1a698bbac053 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -207,6 +207,14 @@ fn main() { // related code in this tool and ./x.py dist hash-and-sign can be removed. let legacy = env::var("BUILD_MANIFEST_LEGACY").is_ok(); + // Avoid overloading the old server in legacy mode. + if legacy { + rayon::ThreadPoolBuilder::new() + .num_threads(1) + .build_global() + .expect("failed to initialize Rayon"); + } + let mut args = env::args().skip(1); let input = PathBuf::from(args.next().unwrap()); let output = PathBuf::from(args.next().unwrap());