From 8fc49b25f7fcf339542916a0ca320d2cf59269ac Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Tue, 10 May 2022 21:04:23 +0200 Subject: [PATCH] make: create cargo folders --- makefiles/cargo-targets.inc.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/makefiles/cargo-targets.inc.mk b/makefiles/cargo-targets.inc.mk index e6b9809ed6..0a208232f0 100644 --- a/makefiles/cargo-targets.inc.mk +++ b/makefiles/cargo-targets.inc.mk @@ -34,3 +34,9 @@ $(APPLICATION_RUST_MODULE).module: $(CARGO_LIB) FORCE $(Q)cd $(BINDIR)/$(APPLICATION_RUST_MODULE)/ && $(AR) x $< $(Q)# ... and move them back if any exist, careful to err if anything is duplicate $(Q)rmdir $(BINDIR)/$(APPLICATION_RUST_MODULE)/bin/ || (mv -n $(BINDIR)/$(APPLICATION_RUST_MODULE)/bin/* $(BINDIR)/$(APPLICATION_RUST_MODULE)/ && rmdir $(BINDIR)/$(APPLICATION_RUST_MODULE)/bin/) + +# create cargo folders +# This prevents cargo inside docker from creating them with root permissions +# (should they not exist), and also from re-building everything every time +# because the .cargo inside is as ephemeral as the build container. +$(shell mkdir -p ~/.cargo/git ~/.cargo/registry)