There are a number of concerns with how
53c1ad8c4add9656b4ee3e0d1a1c1b643d617f84 introduced concurrency to
pkg-create:
- It is tied to MAKE_JOBS, which is affected by MAKE_JOBS_UNSAFE.
- It could affect compression ratio, depending on the pkg workload and the parallelism available to the system
- On top of (2), it implies packaging reproducibility issues
This commit aims to address all of these issues by adding a new
knob PKG_CREATE_THREADS_NUMBER, which has the following semantics:
- if defined, it must be >= 1
- if not defined, it defaults to the number of physical CPU cores if using the default tzst packaging format, otherwise defaults to 1
zstd guarantees deterministic builds on all _multithreaded_ compression
runs, so we must always pass the number of requested threads explicitly
to avoid --single-thread differences.
Discussed With: adamw, diizzy, vvd
Fixes: 53c1ad8c4add9656b4ee3e0d1a1c1b643d617f84