[openwrt/openwrt] rules.mk: do not set CCACHE_NOHASHDIR
LEDE Commits
lede-commits at lists.infradead.org
Tue Oct 7 02:41:02 PDT 2025
robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/11820ef8016878482dc4aa61692ffc30464f3af5
commit 11820ef8016878482dc4aa61692ffc30464f3af5
Author: Erik Karlsson <erik.karlsson at iopsys.eu>
AuthorDate: Mon Oct 6 15:46:36 2025 +0200
rules.mk: do not set CCACHE_NOHASHDIR
Not hashing CWD is potentially unsafe since it involves deliberately
poisoning the cache in certain situations in exchange for performance
gain. It can lead to debug information pointing out either no longer
existing or much worse incorrect source files, possibly leading
developers onto a false track and wasting a lot of time.
If one wishes to save build time by sharing the cache between multiple
source trees, this can be achieved safely by enabling reproducible
debug information, like this:
CONFIG_CCACHE_DIR="$(HOME)/.ccache"
CONFIG_REPRODUCIBLE_DEBUG_INFO=y
Note that CWD hashing gets disabled implicitly when reproducible debug
information is enabled. The CCACHE_NOHASHDIR option is only for
disabling CWD hashing in cases where it is not safe to do so.
Signed-off-by: Erik Karlsson <erik.karlsson at iopsys.eu>
Link: https://github.com/openwrt/openwrt/pull/20317
Signed-off-by: Robert Marko <robimarko at gmail.com>
---
rules.mk | 1 -
1 file changed, 1 deletion(-)
diff --git a/rules.mk b/rules.mk
index 47c5f5de62..60aab167f0 100644
--- a/rules.mk
+++ b/rules.mk
@@ -349,7 +349,6 @@ ifneq ($(CONFIG_CCACHE),)
TARGET_CXX:= ccache $(TARGET_CXX)
HOSTCC:= ccache $(HOSTCC)
HOSTCXX:= ccache $(HOSTCXX)
- export CCACHE_NOHASHDIR:=true
export CCACHE_NOCOMPRESS:=true
export CCACHE_BASEDIR:=$(TOPDIR)
export CCACHE_DIR:=$(if $(call qstrip,$(CONFIG_CCACHE_DIR)),$(call qstrip,$(CONFIG_CCACHE_DIR)),$(TOPDIR)/.ccache)
More information about the lede-commits
mailing list