Skip to content

Commit 6efd7e6

Browse files
committed
Unrolled build for #160697 in rollup 162853
Rollup merge of #160697 - petrochenkov:jobtweak, r=bjorn3 rustc: Tweak the effect of `--jobs` on frontend parallelism We need to be able to express both of these things for the frontend parallelism: - "Use exactly `N` threads", `--jobs-frontend=N` does this. - "Use some default number of threads, but not larger than `N`", `--jobs=N` will do it after this PR. The "default number" may be 1 now, or 2 during the upcoming nightly testing, or 4 or 8 after the stabilization if we decide to cap the parallelism. Part of rust-lang/compiler-team#1005. r? @bjorn3
2 parents e15cecc + 3e034b3 commit 6efd7e6

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎compiler/rustc_session/src/config.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,7 @@ fn parse_jobs_all(
17541754
check_upper_limit(frontend, opt_name);
17551755
frontend
17561756
}
1757-
None => jobs.flatten(),
1757+
None => None, // default to 1 thread irrespectively of `jobs` for now
17581758
},
17591759
};
17601760
let backend = match matches.opt_str("jobs-backend") {

‎src/doc/rustc/src/command-line-arguments.md‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -498,8 +498,8 @@ more specific `jobs-*` options cannot specify larger values.
498498
Parallelism used by compilation stages from lexing to generation of backend IR (e.g. LLVM IR).
499499

500500
- If `jobs-frontend` is passed, then it is used as the limit,
501-
- otherwise if `jobs` is passed, then it is used as the limit,
502-
- otherwise `1` is used as the limit (parallelism is disabled), this default may change.
501+
- otherwise `1` is used as the limit (parallelism is disabled), this default may change,
502+
but if it's changed to a larger value the limit from `jobs` will still be respected.
503503

504504
In any case the parallelism here may be additionally limited dynamically by jobserver
505505
passed from a higher level build system like cargo.
@@ -510,8 +510,7 @@ Parallelism used by compilation stages converting backend IR to object files.
510510

511511
- If `jobs-backend` is passed, then it is used as the limit,
512512
- otherwise if `jobs` is passed, then it is used as the limit,
513-
- otherwise `32` is used as the limit or there's no limit in case of an inherited jobserver,
514-
this default may change.
513+
- otherwise the number of available logical CPUs is used as the limit, this default may change.
515514

516515
In any case the parallelism here may be additionally limited dynamically by jobserver
517516
passed from a higher level build system like cargo.

0 commit comments

Comments
 (0)