From 14ef97907211bb78ae8826b218e5a82cb29ae67b Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Tue, 25 Oct 2022 21:28:04 +0200 Subject: [PATCH] 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. --- src/InodeCache.cpp | 4 +++- test/suites/inode_cache.bash | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) 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 -- 2.47.2