From: Ian Jackson Date: Sat, 30 Jan 2021 14:33:39 +0000 (+0000) Subject: Makefile: pass cargo --workspace, (nearly) always X-Git-Tag: otter-0.4.0~622 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=383ee701980eeaebfda67286d32a7439537ee3e0;p=otter.git Makefile: pass cargo --workspace, (nearly) always This seems to work around https://github.com/rust-lang/cargo/issues/9114 https://github.com/rust-lang/cargo/issues/9114 The WASM call doesn't have it because (i) we want that to be minimal (ii) there's only the one call to cargo for that architecture. Build times: touch src/updates.rs; (time make -j12 wdt) 2>&1 |ts -s %.s before 26s after 19s touch src/updates.rs; (time make -j12) 2>&1 |ts -s %.s before 33s after 27s Signed-off-by: Ian Jackson --- diff --git a/Makefile b/Makefile index 9556f657..c1673549 100644 --- a/Makefile +++ b/Makefile @@ -161,18 +161,18 @@ CARGOES=$(foreach t, wasm-,$(addprefix $t,check $(DR))) $(addprefix stamp/cargo.,$(DR)):: \ stamp/cargo.%: $(call rsrcs,. ! -path './wasm/*') - $(CARGO) build $(call cr,$*) -p otter -p otter-daemon + $(CARGO) build --workspace $(call cr,$*) -p otter -p otter-daemon $(stamp) $(TARGET_DIR)/debug/%: $(call rsrcs, ! -path './wasm/*') - $(CARGO) build -p otter --bin $* + $(CARGO) build --workspace -p otter --bin $* stamp/cargo.check: $(call rsrcs,.) $(CARGO) test --workspace $(stamp) stamp/cargo-wdt.debug: $(call rsrcs,.) - $(CARGO) build $(call cr,$*) -p otter-webdriver-tests + $(CARGO) build --workspace $(call cr,$*) -p otter-webdriver-tests $(stamp) stamp/cargo.doc: $(call rsrcs,.) @@ -180,7 +180,7 @@ stamp/cargo.doc: $(call rsrcs,.) $(stamp) stamp/cargo.doc-otter-only: $(call rsrcs,.) - $(CARGO) doc -p otter --no-deps + $(CARGO) doc --workspace -p otter --no-deps $(stamp) $(addprefix stamp/cargo.wasm-,$(DR)):: \ @@ -189,7 +189,7 @@ stamp/cargo.wasm-%: $(call rsrcs, zcoord wasm Cargo.*) $(stamp) stamp/cargo.deploy-build: $(call rsrcs,.) - $(CARGO) -T$(DEPLOY_ARCH) build $(call cr,$(DEPLOY_RELEASE)) -p otter -p otter-daemon + $(CARGO) -T$(DEPLOY_ARCH) build --workspace $(call cr,$(DEPLOY_RELEASE)) -p otter -p otter-daemon $(stamp) #---------- wasm ----------