Skip to content

Commit 251fd0c

Browse files
tbitcsoz-agent
andcommitted
fix(ci): install minimal Zephyr SDK + set ZEPHYR_TOOLCHAIN_VARIANT=host
Zephyr CMake calls find_package(Zephyr-sdk) even for native_sim to locate host tools (DTC, cmake config files). The minimal SDK bundle (~10 MB) provides only the cmake registration files with no cross-compiler. setup.sh -c writes ~/.cmake/packages/Zephyr-sdk/ so CMake resolves it. ZEPHYR_TOOLCHAIN_VARIANT=host tells Zephyr to use system GCC for native_sim instead of any cross-compiler. Co-Authored-By: Oz <oz-agent@warp.dev>
1 parent 1c9499e commit 251fd0c

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ jobs:
5858
zephyr:
5959
name: Zephyr Twister Tests
6060
runs-on: ubuntu-latest
61+
env:
62+
# native_sim uses host GCC; skip cross-compiler toolchain lookup.
63+
ZEPHYR_TOOLCHAIN_VARIANT: host
6164
steps:
6265
- uses: actions/checkout@v4
6366
with:
@@ -103,6 +106,20 @@ jobs:
103106
- name: Install Zephyr Python requirements
104107
run: pip install -r zephyr/scripts/requirements.txt
105108

109+
# Zephyr CMake requires find_package(Zephyr-sdk) even for native_sim
110+
# (host tools: DTC, cmake config files). The minimal bundle is ~10 MB
111+
# and contains no cross-compiler — only the cmake registration files.
112+
# setup.sh -c writes ~/.cmake/packages/Zephyr-sdk/ so CMake finds it.
113+
- name: Install Zephyr SDK (minimal, cmake files only)
114+
run: |
115+
SDK_VER=$(cat zephyr/sdk-version | tr -d '[:space:]')
116+
wget -q \
117+
"https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${SDK_VER}/zephyr-sdk-${SDK_VER}_linux-x86_64_minimal.tar.xz" \
118+
-O /tmp/zephyr-sdk-minimal.tar.xz
119+
mkdir -p ~/zephyr-sdk
120+
tar -xf /tmp/zephyr-sdk-minimal.tar.xz --strip-components=1 -C ~/zephyr-sdk
121+
~/zephyr-sdk/setup.sh -c
122+
106123
# Unit tests run as native executables on native_sim.
107124
- name: Twister — unit tests
108125
run: |

0 commit comments

Comments
 (0)