From 0074a7c4ac4b3455db283f47b52e1d9427017348 Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Tue, 29 Jun 2021 12:06:26 +0200 Subject: [PATCH] tool/depot: fix forwarding of CCACHE The depot tool 'build_bin_archive' used to ask only whether CCACHE is empty or not and, if it wasn't empty, the tool added 'CCACHE := yes' to the build.conf of the temporary build dir. This caused the sub-build processes to use ccache even when the top-level CCACHE variable was set to a bogus value. Also adds documentation of the CCACHE variable to the help message of the 'build' and 'build_bin_archive' tool. Ref #4212 --- tool/depot/build | 2 ++ tool/depot/mk/build_bin_archive | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tool/depot/build b/tool/depot/build index eeaec6ef25..d3b9818b9a 100755 --- a/tool/depot/build +++ b/tool/depot/build @@ -45,6 +45,8 @@ define HELP_MESSAGE KEEP_BUILD_DIR=1 Do not remove build directories of built binary packages. This is useful for debugging build problems. + + CCACHE=1 Compiler calls will use the C/C++ compiler cache. endef export GENODE_DIR := $(realpath $(dir $(MAKEFILE_LIST))/../..) diff --git a/tool/depot/mk/build_bin_archive b/tool/depot/mk/build_bin_archive index 59019633f0..37b9afdd20 100755 --- a/tool/depot/mk/build_bin_archive +++ b/tool/depot/mk/build_bin_archive @@ -12,11 +12,12 @@ define HELP_MESSAGE usage: - $(firstword $(MAKEFILE_LIST)) SPEC= USER= + $(firstword $(MAKEFILE_LIST)) SPEC= USER= CCACHE= name of the source archive to build build spec, e.g., x86_32, x86_64 identity of the archive creator + compiler calls will use the C/C++ compiler cache if this is 1 endef @@ -158,12 +159,18 @@ ifneq ($(MISSING_API_DIRS),) @false endif +ifeq ($(CCACHE),1) +BUILD_CONF_CCACHE := yes +else +BUILD_CONF_CCACHE := +endif + $(BUILD_CONF): checked_src_archive checked_api_archives $(VERBOSE)mkdir -p $(dir $@) $(VERBOSE) \ ( echo "GENODE_DIR := $(GENODE_DIR)"; \ echo "BASE_DIR := $(GENODE_DIR)/repos/base"; \ - echo "override CCACHE := $(if $(CCACHE),yes)"; \ + echo "override CCACHE := $(BUILD_CONF_CCACHE)"; \ echo "REPOSITORIES := $(SRC_DIR)"; \ for api in $(USED_APIS); do \ echo "REPOSITORIES += $(DEPOT_API_DIR)/$$api"; done \