rules.mk: do not set CCACHE_NOHASHDIR
authorErik Karlsson <[email protected]>
Mon, 6 Oct 2025 13:46:36 +0000 (15:46 +0200)
committerRobert Marko <[email protected]>
Tue, 7 Oct 2025 09:40:58 +0000 (11:40 +0200)
commit11820ef8016878482dc4aa61692ffc30464f3af5
treea354af2b6e31f3cc7eb40b17a44131b08840ba34
parent133c91823cfb238c89c6a1b03032052cb09c2e57
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 <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20317
Signed-off-by: Robert Marko <[email protected]>
rules.mk