cargo test --doc does not respect CARGO_BUILD_JOBS env variable #97551
Labels
C-discussion
Category: Discussion or questions that doesn't represent real issues.
T-cargo
Relevant to the cargo team, which will review and decide on the PR/issue.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
I originally reported this issue in the cargo repo: rust-lang/cargo#10702 but I was told that "this behaviour is controlled by rustdoc".
Problem
I use a global variable CARGO_BUILD_JOBS=4 because the default configuration results in my machine running out of memory when compiling some rust projects. However recently I noticed that this fails when there are many doc tests in the project, because it looks like all the doc tests are compiled in parallel.
Steps
pidof rustc
and notice how there are as multiple processes, instead of the expected 1.Possible Solution(s)
In my opinion the correct behavior is to respect CARGO_BUILD_JOBS when compiling the tests.
As a workaround, you can use
to limit the number of build jobs to 1, however this also affects normal tests, so running tests will be much slower.
Version
Comments
@weihanglo provided helpful comments:
The text was updated successfully, but these errors were encountered: