build-manifest: avoid collecting SHAs in parallel on legacy mode

This avoids overloading the old server, and disrupting the other
programs running on it.
This commit is contained in:
Pietro Albini 2020-10-01 17:25:54 +02:00
parent acd8e59b66
commit fde1135916
No known key found for this signature in database
GPG key ID: 3E06ABE80BAAF19C

View file

@ -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());