pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Minor discrepancy



> At the moment lang/rust is at 1.58.1 in pkgsrc-current;
> shells/starship has been upgraded to 1.4.2. The latter does not build
> with rust 1.58.1, it requires wip/rust, now at 1.59.0. Just
> mentioning, it might spoil someone's bulk builds (not that one can' t
> live without starship - which often hangs in git directories anyway).
> 
> Chavdar

Correct, std::thread::available_parallelism has been stabilised in 1.59.0.

The fix could be to not use this function at all, and let users relay on STARSHIP_NUM_THREADS environment variable. See the patch below.

Kind regards,
Adam


--- src/main.rs.orig	2022-03-20 12:00:23.000000000 +0000
+++ src/main.rs
@@ -2,7 +2,6 @@
 
 use clap::crate_authors;
 use std::io;
-use std::thread::available_parallelism;
 use std::time::SystemTime;
 
 use clap::{IntoApp, Parser, Subcommand};
@@ -232,7 +231,7 @@ fn init_global_threadpool() {
         .and_then(|s| s.parse().ok())
         // Default to the number of logical cores,
         // but restrict the number of threads to 8
-        .unwrap_or_else(|| available_parallelism().map(usize::from).unwrap_or(1).min(8));
+        .unwrap_or(1);
 
     rayon::ThreadPoolBuilder::new()
         .num_threads(num_threads)


Home | Main Index | Thread Index | Old Index