Replies: 3 comments 3 replies
-
|
For a bit on the status quo:
|
Beta Was this translation helpful? Give feedback.
-
|
Also worth talking about the Brioche side a bit. Today, the Maybe it'd make sense to have a |
Beta Was this translation helpful? Give feedback.
-
|
I was thinking to have a something similar to what we already have through the function getCurrentPlatform(): Platform {
const { op_brioche_current_platform } = (globalThis as any).Deno.core.ops;
if (op_brioche_current_platform === undefined) {
return "x86_64-linux";
}
return op_brioche_current_platform();
}
export const CURRENT_PLATFORM = getCurrentPlatform();We could have a function getting the number of CPU core / threads or whatever on Brioche side, this number would be exposed as a value through Deno, and we could then use it in the recipes. Of course, it would still give us some flexibility to disable parallelism or override the number of cores seen by introducing a new flag
I think in the CI, we could override the flag to always have a value greater or equal to 8 if the number of cores is less than 8. But just to understand something, let's take the following example, what if the CI builds a package and published it with let's say |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
For many packages, the build instructions will recommend running the build like
make -j$(nproc), which will allow the build steps to run in parallel, up to the number of CPU cores on the host system. Running Make in parallel like this-- or other sources of parallelism in a build-- could introduce non-deterministic builds or flakey builds. The Reproducible Builds project even includes it in their list of "commandments of reproducible builds":...but this is very dependent on the build itself. If a package has a Makefile where all the dependencies are specified properly and where each step is itself reproducible, then adding parallelism shouldn't influence the final result. The benefit is the build itself will take only a fraction of the time: a 30 minute build could finish in less than a minute with enough CPU cores!
While we don't currently aim for making packages Reproducible today (by the "Reproducible Builds" definition), it'd be nice to keep the door open. Also, even ignoring Reproducibility, there are potential concerns around flakiness: a build that works with a parallelism of one could fail with some higher level of parallelism due to missing Makefile dependencies (or equivalent in some other build system)
So, we should have some standard guidance when authoring packages about if/when we should enable parallelism
Beta Was this translation helpful? Give feedback.
All reactions