diff --git a/.gitignore b/.gitignore index 8333c953251..b461aa29bd8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ *.tar.* /packages/*/*.crate **/target/ +/.cargo diff --git a/Dockerfile b/Dockerfile index 67d57d0f5c3..5a4283d4480 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,7 +49,10 @@ RUN --mount=target=/host \ builddep rpmbuild/SPECS/${PACKAGE}.spec USER builder -RUN rpmbuild -ba --clean rpmbuild/SPECS/${PACKAGE}.spec +RUN --mount=source=.cargo,target=/home/builder/.cargo \ + --mount=type=cache,target=/home/builder/.cache,uid=1000,id=${PACKAGE} \ + --mount=source=workspaces,target=/home/builder/rpmbuild/BUILD/workspaces \ + rpmbuild -ba --clean rpmbuild/SPECS/${PACKAGE}.spec FROM scratch AS rpm COPY --from=rpmbuild /home/builder/rpmbuild/RPMS/*/*.rpm / diff --git a/Makefile b/Makefile index 6b6c37701d6..375a42cf32d 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,8 @@ VARS = $(SPECS:.spec=.makevar) PKGS = $(SPECS:.spec=.makepkg) OUTPUT ?= $(TOPDIR)/build -OUTVAR := $(shell mkdir -p $(OUTPUT)) +CARGO_HOME ?= $(TOPDIR)/.cargo +OUTVAR := $(shell mkdir -p $(OUTPUT) $(CARGO_HOME)) ARCH ?= $(shell uname -m)