mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-04 22:45:21 +00:00
The west build command has historically tried not to rm -rf directories that don't look like zephyr build directories. The way it does this is by checking for the presence of a CMake cache with a Zephyr-specific variable (ZEPHYR_TOOLCHAIN_VARIANT) in it. The problem with this approach is that if the build system fails before this cache variable is set, the directory doesn't look like a zephyr build directory, and therefore west build won't make it pristine even with --pristine=always, even though build directories resulting from failed runs like that are almost certainly irrecoverably broken and need to be made pristine before anything will work. This leads to users having to rm -rf their directories manually, which is not so nice. To avoid this from happening, just check for ZEPHYR_BASE, which is set early on in ZephyrConfig.cmake in 'modern' zephyr build systems. Keep the ZEPHYR_TOOLCHAIN_VARIANT check in place for compatibility. We could consider being less selective and just using shutil.rmtree() whenever we have --pristine=always, but that would be a bigger behavioral change than I'm comfortable doing without a good reason. Fixes: #28876 Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no> |
||
---|---|---|
.. | ||
checkpatch | ||
ci | ||
coccinelle | ||
coredump | ||
dts | ||
footprint | ||
gitlint | ||
kconfig | ||
net | ||
release | ||
sanity_chk | ||
support | ||
tests | ||
tracing | ||
west_commands | ||
.gitignore | ||
checkpatch.pl | ||
checkstack.pl | ||
coccicheck | ||
dir_is_writeable.py | ||
file2hex.py | ||
filter-known-issues.py | ||
gen_app_partitions.py | ||
gen_cfb_font_header.py | ||
gen_gcov_files.py | ||
gen_kobject_list.py | ||
gen_offset_header.py | ||
gen_relocate_app.py | ||
gen_syscalls.py | ||
get_maintainer.py | ||
mergehex.py | ||
parse_syscalls.py | ||
process_gperf.py | ||
requirements-base.txt | ||
requirements-build-test.txt | ||
requirements-compliance.txt | ||
requirements-doc.txt | ||
requirements-extras.txt | ||
requirements-run-test.txt | ||
requirements.txt | ||
sanitycheck | ||
series-push-hook.sh | ||
spelling.txt | ||
subfolder_list.py | ||
tags.sh | ||
user_wordsize.py | ||
valgrind.supp | ||
west-commands.yml | ||
zephyr_module.py |