Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xtensa-build-zephyr: fix DEFAULT_TOOLCHAIN_VARIANT spill on next platf
xtensa-build-zephyr.py has always defined XTENSA_ and other environment variables in the current environment shared by all platforms. This was always bad but apparently never a problem until the addition of the new DEFAULT_TOOLCHAIN_VARIANT (xcc or clang) variable. Before DEFAULT_TOOLCHAIN_VARIANT, each platform's environment would simply override the previous one. However with the new DEFAULT_TOOLCHAIN_VARIANT, the current environment has precedence for more flexibility. This makes each platform "spill" onto the next one and `xtensa-build-zephyr.py -p tgl mtl` fail like this: ``` -- Board: intel_adsp_ace15_mtpm -- Found toolchain: xcc (/home/XCC/install/tools) CMake Error at zephyr/cmake/compiler/xcc/generic.cmake:9 (message): Zephyr was unable to find the toolchain. Is the environment misconfigured? User-configuration: ZEPHYR_TOOLCHAIN_VARIANT: xcc Internal variables: CROSS_COMPILE: /home/XCC/install/tools/RI-2022.10-linux/XtensaTools/bin/xt- ``` To fix this, stop modifying the current os.environ and use a new, fresh os.environ.copy() for each platform instead. Fixes commit 309fa26 ("xtensa-build-zephyr.py: upgraded Xtensa toolchain for MTL") History repeats itself: commit 6bedd8e ("xtensa-build-zephyr: fix RIMAGE_KEY when building multiple platforms") fixed the same logical error months ago in a different script. Signed-off-by: Marc Herbert <[email protected]>
- Loading branch information