From: Joel Rosdahl Date: Tue, 25 Oct 2022 19:28:04 +0000 (+0200) Subject: fix: Use separate 32-bit and 64-bit inode cache files X-Git-Tag: v4.7.2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14ef97907211bb78ae8826b218e5a82cb29ae67b;p=thirdparty%2Fccache.git fix: Use separate 32-bit and 64-bit inode cache files The memory layout of the shared region differs between 32-bit and 64-bit ccache binaries, so use different inode cache files. --- diff --git a/src/InodeCache.cpp b/src/InodeCache.cpp index df928d4fd..5985cd5b6 100644 --- a/src/InodeCache.cpp +++ b/src/InodeCache.cpp @@ -498,7 +498,9 @@ InodeCache::drop() std::string InodeCache::get_file() { - return FMT("{}/inode-cache.v{}", m_config.temporary_dir(), k_version); + const uint8_t arch_bits = 8 * sizeof(void*); + return FMT( + "{}/inode-cache-{}.v{}", m_config.temporary_dir(), arch_bits, k_version); } int64_t diff --git a/test/suites/inode_cache.bash b/test/suites/inode_cache.bash index a09ac5d78..e53bf8b20 100644 --- a/test/suites/inode_cache.bash +++ b/test/suites/inode_cache.bash @@ -9,7 +9,7 @@ SUITE_inode_cache_PROBE() { touch test.c $CCACHE $COMPILER -c test.c - if [[ ! -f "${CCACHE_TEMPDIR}/inode-cache.v1" ]]; then + if [[ ! -f "${CCACHE_TEMPDIR}/inode-cache-32.v1" && ! -f "${CCACHE_TEMPDIR}/inode-cache-64.v1" ]]; then local fs_type=$(stat -fLc %T "${CCACHE_DIR}") echo "inode cache not supported on ${fs_type}" fi