diff --git a/config/rules.mk b/config/rules.mk index 09d22548b89e..d253c05d6e68 100644 --- a/config/rules.mk +++ b/config/rules.mk @@ -913,8 +913,11 @@ else rust_debug_info=2 endif +# We use the + prefix to pass down the jobserver fds to cargo, but we +# don't use the prefix when make -n is used, so that cargo doesn't run +# in that case) define RUN_CARGO -env $(environment_cleaner) $(rust_unlock_unstable) $(rustflags_override) $(sccache_wrap) \ +$(if $(findstring n,$(filter-out --%, $(MAKEFLAGS))),,+)env $(environment_cleaner) $(rust_unlock_unstable) $(rustflags_override) $(sccache_wrap) \ CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \ RUSTC=$(RUSTC) \ RUSTFLAGS='-C debuginfo=$(rust_debug_info)' \