Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ValveSoftware/Proton.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Eikum <aeikum@codeweavers.com>2022-03-03 20:21:32 +0300
committerArkadiusz Hiler <ahiler@codeweavers.com>2022-03-04 13:31:39 +0300
commit9a782460f32edd8e7838bed5ab6fca4609aada34 (patch)
treecb800e42febdc02ac8600be0b3da50d145a6b923
parent18f9923c0f3217a234118beea93f20b886aaecf5 (diff)
Use CARGO_HOME on the host
This lets cargo's cache persist across builds, so there are fewer (often zero) network pulls during the build process.
-rw-r--r--Makefile.in4
-rw-r--r--make/rules-common.mk1
2 files changed, 4 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in
index e507c7fb..ef699323 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -67,6 +67,9 @@ else
override DOCKER_OPTS := $(CCACHE_ENV) -e CCACHE_DISABLE=1 $(DOCKER_OPTS)
endif
+export CARGO_HOME := $(if $(CARGO_HOME),$(CARGO_HOME),$(HOME)/.cargo)
+override DOCKER_OPTS := -v $(CARGO_HOME):$(CARGO_HOME)$(CONTAINER_MOUNT_OPTS) -e CARGO_HOME=$(CARGO_HOME) $(DOCKER_OPTS)
+
ifneq ($(ROOTLESS_CONTAINER),1)
override DOCKER_OPTS := -e HOME -e USER -e USERID=$(shell id -u) -u $(shell id -u):$(shell id -g) $(DOCKER_OPTS)
endif
@@ -113,6 +116,7 @@ J := $(shell nproc)
ifeq ($(ENABLE_CCACHE),1)
container-build: $(shell mkdir -p $(CCACHE_DIR))
endif
+container-build: $(shell mkdir -p $(CARGO_HOME))
container-build: private SHELL := $(CONTAINER_SHELL)
container-build:
+$(MAKE) -j$(J) $(filter -j%,$(MAKEFLAGS)) -f $(firstword $(MAKEFILE_LIST)) $(MFLAGS) $(MAKEOVERRIDES) CONTAINER=1 $(CONTAINERGOALS)
diff --git a/make/rules-common.mk b/make/rules-common.mk
index 9f246e69..78f0f61f 100644
--- a/make/rules-common.mk
+++ b/make/rules-common.mk
@@ -113,7 +113,6 @@ $(2)_LIBFLAGS$(3) = $$(foreach d,$$($(2)_DEPS$(3)),-L$$($$(d)_LIBDIR$(3))) \
# native version doesn't exist.
$(2)_ENV$(3) = \
- CARGO_HOME=$$(OBJ)/.cargo \
CARGO_TARGET_$$(call toupper,$$(CARGO_TARGET_$(3)))_LINKER="$$(TARGET_$(4)$(3))-gcc" \
CCACHE_BASEDIR="$$(CCACHE_BASEDIR)" \
STRIP="$$(STRIP)" \