Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions scripts/xtensa-build-zephyr.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,10 +787,20 @@ def build_platforms():
_dict = dataclasses.asdict(platform_configs[platform])
platform_dict = { k:v for (k,v) in _dict.items() if _dict[k] is not None }

xtensa_tools_version = os.getenv("XTENSA_TOOLS_VERSION")
if not xtensa_tools_version:
xtesna_tools_version = platform_dict["XTENSA_TOOLS_VERSION"]
Copy link

Copilot AI Mar 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in the variable name 'xtesna_tools_version'; it should be 'xtensa_tools_version' to match its usage elsewhere.

Suggested change
xtesna_tools_version = platform_dict["XTENSA_TOOLS_VERSION"]
xtensa_tools_version = platform_dict["XTENSA_TOOLS_VERSION"]

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a good one! Supposedly that branch wasn't tested

xtensa_tools_root_dir = os.getenv("XTENSA_TOOLS_ROOT")

# when XTENSA_TOOLS_ROOT environmental variable is set,
# use user installed Xtensa tools not Zephyr SDK
if "XTENSA_TOOLS_VERSION" in platform_dict and xtensa_tools_root_dir:
if xtensa_tools_version and xtensa_tools_root_dir:
# These are external input, so log for posterity (and
# build dependency tracking)
print("Building using Cadence Xtensa Tools")
print(f" XTENSA_TOOLS_VERSION = {xtensa_tools_version}")
print(f" XTENSA_TOOLS_ROOT = {xtensa_tools_root_dir}")

xtensa_tools_root_dir = pathlib.Path(xtensa_tools_root_dir)
if not xtensa_tools_root_dir.is_dir():
raise RuntimeError(f"Platform {platform} uses Xtensa toolchain."
Expand All @@ -811,7 +821,7 @@ def build_platforms():
xtensa_tools_root_dir / "install" / "tools"
)
# Toolchain sub-directory
TOOLCHAIN_VER = platform_dict["XTENSA_TOOLS_VERSION"]
TOOLCHAIN_VER = xtensa_tools_version
platf_build_environ["TOOLCHAIN_VER"] = TOOLCHAIN_VER

# This XTENSA_SYSTEM variable was copied as is from XTOS
Expand Down
Loading