diff --git a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/profile.bashrc b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/profile.bashrc index 3e4b812f6e..bbf8d895b9 100644 --- a/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/profile.bashrc +++ b/sdk_container/src/third_party/coreos-overlay/profiles/coreos/base/profile.bashrc @@ -99,3 +99,10 @@ SYSROOT_WRAPPERS_BIN="/usr/lib/sysroot-wrappers/bin" if [[ "$PATH" != *"$SYSROOT_WRAPPERS_BIN"* ]]; then export PATH="$SYSROOT_WRAPPERS_BIN:$PATH" fi + +# Improve the chance that ccache is valid across versions by making all +# paths under $S relative to $S, avoiding encoding the package version +# contained in the path into __FILE__ expansions and debug info. +if [[ -z "${CCACHE_BASEDIR}" ]] && [[ -d "${S}" ]]; then + export CCACHE_BASEDIR="${S}" +fi