cmake: Introduce a key version to invalidate corrupted caches
When a bug in the caching mechanism is detected the cache format must be bumped to ensure that we no longer get a cache hit on old corrupted keys. This fixes #7246 when the cache is corrupted. Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
parent
5f08b106a8
commit
aa90d72116
1 changed files with 7 additions and 0 deletions
|
@ -622,8 +622,15 @@ function(zephyr_check_compiler_flag lang option check)
|
|||
# We need to create a unique key wrt. testing the toolchain
|
||||
# capability. This key must be a valid C identifier that includes
|
||||
# everything that can affect the toolchain test.
|
||||
|
||||
# The 'cacheformat' must be bumped if a bug in the caching mechanism
|
||||
# is detected and all old keys must be invalidated.
|
||||
set(cacheformat 2)
|
||||
|
||||
set(key_string "")
|
||||
set(key_string "${key_string}ZEPHYR_TOOLCHAIN_CAPABILITY_CACHE_")
|
||||
set(key_string "${key_string}cacheformat_")
|
||||
set(key_string "${key_string}${cacheformat}_")
|
||||
set(key_string "${key_string}${TOOLCHAIN_SIGNATURE}_")
|
||||
set(key_string "${key_string}${lang}_")
|
||||
set(key_string "${key_string}${option}_")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue