Bug 1367940 - Pass the make jobserver file descriptors down to cargo. r?gps
cargo 1.19, and later cargo 1.20/rustc 1.19 gained support for the make
jobserver. But that doesn't work unless make passes the jobserver file
descriptors down to subprocesses, which it only does when there is a +
prefixing commands.
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -908,18 +908,21 @@ endif
# XXX hack to work around dsymutil failing on cross-OSX builds (bug 1380381)
ifeq ($(HOST_OS_ARCH)-$(OS_ARCH),Linux-Darwin)
rust_debug_info=1
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)' \
MOZ_SRC=$(topsrcdir) \
MOZ_DIST=$(ABS_DIST) \
LIBCLANG_PATH="$(MOZ_LIBCLANG_PATH)" \
CLANG_PATH="$(MOZ_CLANG_PATH)" \
PKG_CONFIG_ALLOW_CROSS=1 \