diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2018-11-19 13:24:02 -0600 |
---|---|---|
committer | Joshua Watt <JPEWhacker@gmail.com> | 2018-11-21 11:11:42 -0600 |
commit | 7d1abb4b93851ca3923f75a3c4bfd121a3ed1ed1 (patch) | |
tree | 953595396c825bc1c6f197430beab4d4906ecd74 | |
parent | a4dcea944b56f50d8825be260ef4948a0170f931 (diff) |
classes/toolchain-scripts-mingw32: Ensure exit code is success
The "set" command in Windows has some unfortunate behaviors that can
frequently make it look like the toolchain script had an error. This
makes automated testing of the SDK more difficult, so add a line to the
environment setup script that ensures the script exits with success.
[YOCTO #13020]
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
-rw-r--r-- | classes/toolchain-scripts-mingw32.bbclass | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/classes/toolchain-scripts-mingw32.bbclass b/classes/toolchain-scripts-mingw32.bbclass index a64f5f5..32493d7 100644 --- a/classes/toolchain-scripts-mingw32.bbclass +++ b/classes/toolchain-scripts-mingw32.bbclass @@ -81,6 +81,17 @@ toolchain_shared_env_script_sdkmingw32 () { FOR %%x IN (%OECORE_NATIVE_SYSROOT%\\environment-setup.d\\*.bat) DO call "%%x" ) EOF + + # set has some annoying properties: + # 1) If it is successful %ERRORLEVEL% is unchanged (as opposed to being set + # to 0 to indicate success) + # 2) Making an assignment like "set A=" is considered an error and sets + # %ERRORLEVEL% to 1. + # + # Practically, this means that if any of the set calls make an empty + # assignment that error will be propagated. To prevent this, a command is + # run to ensure that the "exit code" of this script is 0 + echo "@%COMSPEC% /C exit 0 > NUL" >> $script } toolchain_create_sdk_siteconfig_append_sdkmingw32 () { |