Skip to content

rust: Fix evasion of the Rust multicore job handler when using -j1

amyspark requested to merge amyspark/cerbero:fix-rust-choke-evasion into main

Hi all,

When using -j1 in a suitably small Mac machine, determine_num_cargo_jobs() returns 1, but also self.config.num_of_cpus returns None. Therefore, while gst-plugins-rs gets restricted in its number of parallel recipe builds appropriately, the allow_parallel_build never takes effect and cargo proceeds to build at max core speed.

This PR fixes that by ensuring the num_of_cpus is capped by the number of cargo jobs, and otherwise returns 1, simulating what happens with GNU Make when no parallel parameter is specified.

/cc @nirbheek

Merge request reports

Loading