mirror of
https://github.com/Noratrieb/does-it-build.git
synced 2026-01-14 10:25:01 +01:00
hacky way to configure parallelism
This commit is contained in:
parent
5ef63686f3
commit
ae1f0b96e3
2 changed files with 10 additions and 5 deletions
|
|
@ -5,12 +5,13 @@ A webapp that checks which Rust targets build at any nightly.
|
||||||
It does this by executing `cargo build --release -Zbuild-std=core` for every target and every nightly and displaying the result.
|
It does this by executing `cargo build --release -Zbuild-std=core` for every target and every nightly and displaying the result.
|
||||||
|
|
||||||
There's a background job that continously builds every target for every target that it hasn't built yet.
|
There's a background job that continously builds every target for every target that it hasn't built yet.
|
||||||
It does this in parallel, using half of the available threads.
|
It does this in parallel, using half of the available threads (or `DOES_IT_BUILD_PARALLEL_JOBS`).
|
||||||
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
- `DB_PATH`: Path to SQlite DB to store the results
|
- `DB_PATH`: Path to SQlite DB to store the results
|
||||||
|
- `DOES_IT_BUILD_PARALLEL_JOBS`: Parallel build jobs, defaults to cores/2.
|
||||||
|
|
||||||
## Deployment
|
## Deployment
|
||||||
|
|
||||||
|
|
|
||||||
12
src/build.rs
12
src/build.rs
|
|
@ -172,10 +172,14 @@ pub async fn build_every_target_for_toolchain(
|
||||||
.await
|
.await
|
||||||
.wrap_err("failed to get targets")?;
|
.wrap_err("failed to get targets")?;
|
||||||
|
|
||||||
let concurrent = std::thread::available_parallelism()
|
let concurrent = std::env::var("DOES_IT_BUILD_PARALLEL_JOBS")
|
||||||
.unwrap_or(NonZeroUsize::new(2).unwrap())
|
.map(|jobs| jobs.parse().unwrap())
|
||||||
.get()
|
.unwrap_or_else(|_| {
|
||||||
/ 2;
|
std::thread::available_parallelism()
|
||||||
|
.unwrap_or(NonZeroUsize::new(2).unwrap())
|
||||||
|
.get()
|
||||||
|
/ 2
|
||||||
|
});
|
||||||
|
|
||||||
let results = futures::stream::iter(
|
let results = futures::stream::iter(
|
||||||
targets
|
targets
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue