You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling a crate that has jemallocator-sys as a dependency with cargo build -j4, I see a short spike where the number of cpu cores used is 8 instead of 4. The cause is this crate using the NUM_JOBS env var to call make, which ignores that cargo already has other running jobs, thus bringing the total number of running jobs to be higher than NUM_JOBS. This doesn't happen in any of the other *-sys crates, I guess because they use the cc crate with the parallel feature enabled instead of manually calling make.
The fix is to remove the -jN arg to make if the CARGO_MAKEFLAGS env var exists, and set MAKEFLAGS to CARGO_MAKEFLAGS instead.
I expect the implementation to be similar to this:
I guess using a crate to call make instead of doing it manually would handle this and other issues automatically, but I don't know what's the standard so I can't recommend any crates.
The text was updated successfully, but these errors were encountered:
I tried to run cargo build but it gave me a strange error "configure: error: cannot find sources (Makefile.in)", and I didn't find any documentation on what should I do to fix it, so I will let some other contributor implement it.
When compiling a crate that has jemallocator-sys as a dependency with
cargo build -j4
, I see a short spike where the number of cpu cores used is 8 instead of 4. The cause is this crate using theNUM_JOBS
env var to call make, which ignores that cargo already has other running jobs, thus bringing the total number of running jobs to be higher thanNUM_JOBS
. This doesn't happen in any of the other*-sys
crates, I guess because they use thecc
crate with the parallel feature enabled instead of manually callingmake
.The fix is to remove the
-jN
arg tomake
if theCARGO_MAKEFLAGS
env var exists, and setMAKEFLAGS
toCARGO_MAKEFLAGS
instead.I expect the implementation to be similar to this:
https://github.com/rust-lang/cmake-rs/blob/c4a60dd154dd90e469dffc41a1faa717704f90b3/src/lib.rs#L830
I guess using a crate to call make instead of doing it manually would handle this and other issues automatically, but I don't know what's the standard so I can't recommend any crates.
The text was updated successfully, but these errors were encountered: