File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -96,8 +96,6 @@ struct Flavor {
9696 target : String ,
9797}
9898
99- const NUM_THREADS : usize = 4 ;
100-
10199fn load_manifest_bytes ( crate_path : & Path ) -> Vec < u8 > {
102100 let manifest_path = crate_path. join ( "Cargo.toml" ) ;
103101 fs:: read ( & manifest_path) . unwrap ( )
@@ -170,6 +168,14 @@ fn main() -> io::Result<()> {
170168 let mut zup_tree = zup:: write:: Tree :: new ( ) ;
171169 let mut zup_flavors = Vec :: new ( ) ;
172170
171+ let mut num_threads = 1usize ;
172+ if let Ok ( v) = env:: var ( "BUILDER_THREADS" ) {
173+ if let Ok ( n) = v. parse ( ) {
174+ num_threads = n;
175+ }
176+ }
177+ println ! ( "using {} threads" , num_threads) ;
178+
173179 let args: Vec < _ > = env:: args ( ) . collect ( ) ;
174180 let crate_path = PathBuf :: from ( & args[ 1 ] ) ;
175181 let output_path = PathBuf :: from ( & args[ 2 ] ) ;
@@ -197,7 +203,7 @@ fn main() -> io::Result<()> {
197203
198204 thread:: scope ( |s| {
199205 // Spawn workers
200- for i in 0 ..NUM_THREADS {
206+ for i in 0 ..num_threads {
201207 let j = i;
202208 let rx = & rx;
203209 let crate_path = & crate_path;
You can’t perform that action at this time.
0 commit comments