summaryrefslogtreecommitdiff
path: root/util/twister_launcher.py
diff options
context:
space:
mode:
authorYuval Peress <peress@google.com>2022-09-08 14:01:59 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-09-08 21:34:52 +0000
commit6ec358cf577437aa1bc1580ef08123056298eb34 (patch)
treeca9e2d0deacc3a502a492353b4504aa7c4b329a4 /util/twister_launcher.py
parent3a21889edd456028bb2a82c0f041212b260e5b75 (diff)
downloadchrome-ec-6ec358cf577437aa1bc1580ef08123056298eb34.tar.gz
twister: update launcher for out-of-chroot builds
Update the default environment configuration so it will account for running things outside the chroot using the host toolchain. BRANCH=none BUG=none TEST=build and test using twister_launcher outside the chroot Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I29dc9c7cfa7678ee062f078dae222dc9efc70223 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3885396 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
Diffstat (limited to 'util/twister_launcher.py')
-rwxr-xr-xutil/twister_launcher.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/twister_launcher.py b/util/twister_launcher.py
index 820a0b4898..4dd520fa0f 100755
--- a/util/twister_launcher.py
+++ b/util/twister_launcher.py
@@ -149,12 +149,14 @@ def main():
# Prepare environment variables for export to Twister. Inherit the parent
# process's environment, but set some default values if not already set.
twister_env = dict(os.environ)
+ is_in_chroot = os.environ.get("CROS_WORKON_SRCROOT") is not None
extra_env_vars = {
"TOOLCHAIN_ROOT": os.environ.get(
- "TOOLCHAIN_ROOT", str(ec_base / "zephyr")
+ "TOOLCHAIN_ROOT",
+ str(ec_base / "zephyr") if is_in_chroot else zephyr_base,
),
"ZEPHYR_TOOLCHAIN_VARIANT": os.environ.get(
- "ZEPHYR_TOOLCHAIN_VARIANT", "llvm"
+ "ZEPHYR_TOOLCHAIN_VARIANT", "llvm" if is_in_chroot else "host"
),
}
twister_env.update(extra_env_vars)