chiark / gitweb /
Makefile: pass cargo --workspace, (nearly) always
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 30 Jan 2021 14:33:39 +0000 (14:33 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 30 Jan 2021 14:39:46 +0000 (14:39 +0000)
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 <ijackson@chiark.greenend.org.uk>
Makefile

index 9556f657ee35ddf75dd404702eec27f2a453b4d0..c16735497c1c1dab669848882494f040027f6650 100644 (file)
--- 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 ----------