@typecad/framework-zephyr 1.0.0-alpha.14 → 1.0.0-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -47
- package/dist/as-built.d.ts +33 -0
- package/dist/as-built.js +188 -0
- package/dist/async/timer-polyfill.js +1 -1
- package/dist/boardgen.d.ts +128 -0
- package/dist/boardgen.js +1366 -0
- package/dist/chips/board-overrides.d.ts +7 -0
- package/dist/chips/board-overrides.js +11 -0
- package/dist/chips/esp32s3.js +49 -0
- package/dist/chips/index.d.ts +6 -12
- package/dist/chips/index.js +18 -34
- package/dist/chips/resolve.d.ts +16 -2
- package/dist/chips/resolve.js +267 -10
- package/dist/chips/soc/.d.ts +2 -0
- package/dist/chips/soc/.js +129 -0
- package/dist/chips/soc/esp32.d.ts +2 -0
- package/dist/chips/soc/esp32.js +120 -0
- package/dist/chips/soc/esp32c3.d.ts +2 -0
- package/dist/chips/soc/esp32c3.js +90 -0
- package/dist/chips/soc/esp32c6.d.ts +2 -0
- package/dist/chips/soc/esp32c6.js +109 -0
- package/dist/chips/soc/esp32s3.d.ts +2 -0
- package/dist/chips/soc/esp32s3.js +189 -0
- package/dist/chips/soc/index.d.ts +2 -0
- package/dist/chips/soc/index.js +23 -0
- package/dist/chips/soc/nrf52840.d.ts +2 -0
- package/dist/chips/soc/nrf52840.js +130 -0
- package/dist/chips/soc/rp2040.d.ts +2 -0
- package/dist/chips/soc/rp2040.js +141 -0
- package/dist/chips/soc/rp2350a.d.ts +2 -0
- package/dist/chips/soc/rp2350a.js +145 -0
- package/dist/chips/soc/samd21g18a.d.ts +2 -0
- package/dist/chips/soc/samd21g18a.js +143 -0
- package/dist/chips/soc/stm32f411xe.d.ts +2 -0
- package/dist/chips/soc/stm32f411xe.js +251 -0
- package/dist/chips/types.d.ts +319 -0
- package/dist/chips/xiao-ble.js +21 -0
- package/dist/display/profiles.js +1 -1
- package/dist/doctor.js +38 -4
- package/dist/dt-config/custom-board.d.ts +23 -0
- package/dist/dt-config/custom-board.js +227 -0
- package/dist/dt-config/kconfig.d.ts +72 -1
- package/dist/dt-config/kconfig.js +115 -26
- package/dist/dt-config/overlay.js +548 -28
- package/dist/framework.manifest.d.ts +3 -3
- package/dist/framework.manifest.js +122 -185
- package/dist/index.d.ts +4 -1
- package/dist/index.js +8 -2
- package/dist/lowering/adc.d.ts +20 -2
- package/dist/lowering/adc.js +121 -29
- package/dist/lowering/ble.js +31 -28
- package/dist/lowering/dac.js +9 -9
- package/dist/lowering/fs.js +18 -10
- package/dist/lowering/gpio.d.ts +2 -0
- package/dist/lowering/gpio.js +82 -5
- package/dist/lowering/http.js +39 -14
- package/dist/lowering/hwtimer.d.ts +4 -0
- package/dist/lowering/hwtimer.js +35 -10
- package/dist/lowering/i2c.js +46 -54
- package/dist/lowering/index.d.ts +5 -5
- package/dist/lowering/index.js +15 -16
- package/dist/lowering/interrupts.d.ts +22 -5
- package/dist/lowering/interrupts.js +104 -22
- package/dist/lowering/mqtt.js +3 -5
- package/dist/lowering/power.js +0 -4
- package/dist/lowering/preferences.js +49 -77
- package/dist/lowering/pulse.js +0 -31
- package/dist/lowering/pwm.d.ts +12 -1
- package/dist/lowering/pwm.js +78 -14
- package/dist/lowering/random.js +3 -3
- package/dist/lowering/sensor.d.ts +37 -0
- package/dist/lowering/sensor.js +119 -0
- package/dist/lowering/spi.d.ts +12 -0
- package/dist/lowering/spi.js +65 -40
- package/dist/lowering/thread.d.ts +14 -0
- package/dist/lowering/thread.js +55 -0
- package/dist/lowering/timing.js +20 -46
- package/dist/lowering/tone.js +16 -4
- package/dist/lowering/uart.d.ts +13 -0
- package/dist/lowering/uart.js +72 -51
- package/dist/lowering/usb.d.ts +34 -0
- package/dist/lowering/usb.js +206 -0
- package/dist/lowering/wdt.d.ts +1 -1
- package/dist/lowering/wdt.js +17 -7
- package/dist/lowering/wifi.d.ts +3 -2
- package/dist/lowering/wifi.js +97 -111
- package/dist/sdk/board-catalog-sync.d.ts +16 -0
- package/dist/sdk/board-catalog-sync.js +41 -0
- package/dist/sdk/board-data.generated.d.ts +2 -0
- package/dist/sdk/board-data.generated.js +4 -0
- package/dist/sdk/catalog-walker.d.ts +90 -0
- package/dist/sdk/catalog-walker.js +682 -0
- package/dist/sdk/dts-reader.d.ts +83 -0
- package/dist/sdk/dts-reader.js +596 -0
- package/dist/strategy.d.ts +136 -17
- package/dist/strategy.js +839 -222
- package/dist/toolchain/bossac-touch.d.ts +18 -0
- package/dist/toolchain/bossac-touch.js +88 -0
- package/dist/toolchain/compat.d.ts +2 -2
- package/dist/toolchain/compat.js +8 -3
- package/dist/toolchain/debug-config.d.ts +21 -26
- package/dist/toolchain/debug-config.js +226 -76
- package/dist/toolchain/env-check.d.ts +4 -4
- package/dist/toolchain/env-check.js +5 -5
- package/dist/toolchain/index.d.ts +115 -1
- package/dist/toolchain/index.js +680 -71
- package/dist/toolchain/scaffold.js +39 -7
- package/dist/toolchain/west-discover.d.ts +4 -0
- package/dist/toolchain/west-discover.js +17 -6
- package/installer/CHANGELOG.md +473 -0
- package/installer/README.md +328 -0
- package/installer/environment.yml +46 -0
- package/installer/etc/conda/activate.d/zephyr.bat +7 -0
- package/installer/etc/conda/activate.d/zephyr.ps1 +12 -0
- package/installer/etc/conda/activate.d/zephyr.sh +20 -0
- package/installer/etc/conda/deactivate.d/zephyr.bat +6 -0
- package/installer/etc/conda/deactivate.d/zephyr.ps1 +6 -0
- package/installer/etc/conda/deactivate.d/zephyr.sh +4 -0
- package/installer/install.mjs +580 -0
- package/installer/install.ps1 +619 -0
- package/installer/install.sh +310 -0
- package/installer/lib/detect-platform.sh +62 -0
- package/installer/lib/fetch-sdk.sh +304 -0
- package/installer/lib/init-workspace.sh +153 -0
- package/installer/lib/write-activation.sh +76 -0
- package/installer/patches/tfm-c-include-separators.patch +19 -0
- package/installer/patches/zephyr-tfm-nordic-zephyr-include.patch +24 -0
- package/installer/templates/project/.typecad/activate-zephyr.ps1 +31 -0
- package/installer/templates/project/.typecad/activate-zephyr.sh +31 -0
- package/installer/templates/project/.vscode/settings.json +30 -0
- package/installer/templates/project/README.md +58 -0
- package/installer/versions.env +110 -0
- package/package.json +15 -15
- package/src/as-built.ts +206 -0
- package/src/boardgen.ts +1428 -0
- package/src/chips/index.ts +35 -54
- package/src/chips/resolve.ts +285 -10
- package/src/chips/types.ts +325 -1
- package/src/display/profiles.ts +1 -1
- package/src/doctor.ts +110 -77
- package/src/dt-config/custom-board.ts +325 -0
- package/src/dt-config/kconfig.ts +165 -18
- package/src/dt-config/overlay.ts +537 -25
- package/src/framework.manifest.ts +123 -185
- package/src/index.ts +57 -41
- package/src/lowering/adc.ts +222 -118
- package/src/lowering/ble.ts +32 -28
- package/src/lowering/dac.ts +82 -82
- package/src/lowering/fs.ts +18 -10
- package/src/lowering/gpio.ts +242 -155
- package/src/lowering/http.ts +512 -488
- package/src/lowering/hwtimer.ts +139 -101
- package/src/lowering/i2c.ts +116 -126
- package/src/lowering/index.ts +91 -93
- package/src/lowering/interrupts.ts +113 -21
- package/src/lowering/mqtt.ts +3 -5
- package/src/lowering/preferences.ts +327 -354
- package/src/lowering/pwm.ts +167 -99
- package/src/lowering/random.ts +3 -3
- package/src/lowering/sensor.ts +155 -0
- package/src/lowering/spi.ts +164 -124
- package/src/lowering/thread.ts +63 -0
- package/src/lowering/timing.ts +46 -72
- package/src/lowering/uart.ts +73 -51
- package/src/lowering/usb.ts +221 -0
- package/src/lowering/wdt.ts +95 -84
- package/src/lowering/wifi.ts +97 -112
- package/src/sdk/board-catalog-sync.ts +62 -0
- package/src/strategy.ts +848 -237
- package/src/toolchain/bossac-touch.ts +112 -0
- package/src/toolchain/compat.ts +8 -3
- package/src/toolchain/debug-config.ts +676 -522
- package/src/toolchain/env-check.ts +9 -9
- package/src/toolchain/index.ts +1359 -645
- package/src/toolchain/scaffold.ts +38 -7
- package/src/toolchain/west-discover.ts +19 -6
- package/src/async/timer-polyfill.ts +0 -107
- package/src/chips/esp32.ts +0 -74
- package/src/chips/esp32s3.ts +0 -57
- package/src/chips/xiao-ble.ts +0 -82
- package/src/lowering/power.ts +0 -70
- package/src/lowering/pulse.ts +0 -93
- package/src/lowering/tone.ts +0 -60
- package/src/lowering/worker-backing.ts +0 -94
- package/src/lowering/worker.ts +0 -17
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
import { writeFileSync, existsSync, mkdirSync, readFileSync, readdirSync } from 'node:fs';
|
|
10
10
|
import { join } from 'node:path';
|
|
11
11
|
import { resolveKconfigFragments } from '../dt-config/kconfig.js';
|
|
12
|
+
import { scanSensorParts } from './index.js';
|
|
12
13
|
import { readCuttlefishLibrarySidecar } from '@typecad/cuttlefish/library-packages';
|
|
14
|
+
import { SENSOR_PART_INFO } from '@typecad/hal';
|
|
13
15
|
/** Write a file only if the content differs from the existing file.
|
|
14
16
|
* Returns true when the file was written (content changed or file was new). */
|
|
15
17
|
export function writeIfChanged(filePath, content) {
|
|
@@ -123,17 +125,28 @@ export function scaffoldZephyrProject(projectRoot, debug = false, userKconfig, p
|
|
|
123
125
|
usesDac: uses('dac_') || uses('__tc_dac'),
|
|
124
126
|
usesFS: uses('__tc_fs'),
|
|
125
127
|
usesHwtimer: uses('counter_') || uses('__tc_hw'),
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
128
|
+
// The __tc_<bus> alternative matches the shim's state block — a program
|
|
129
|
+
// that only calls begin() emits `(void)__tc_i2c1_dev;` (no driver API
|
|
130
|
+
// call yet), but the shim still declared DEVICE_DT_GET(DT_NODELABEL(...))
|
|
131
|
+
// so the overlay must enable the node or the device symbol is missing.
|
|
132
|
+
usesI2c: uses('i2c_') || uses('__tc_i2c'),
|
|
133
|
+
// DT-bound sensor parts: the __tc_sensor_* state references and the
|
|
134
|
+
// sensor_sample_fetch/sensor_channel_get calls both carry the token.
|
|
135
|
+
usesSensor: uses('sensor_') || uses('__tc_sensor'),
|
|
136
|
+
usesFloatFormat: /%[-0-9.]*[eEfFgG]/.test(src),
|
|
137
|
+
usesSpi: uses('spi_') || uses('__tc_spi'),
|
|
138
|
+
usesUart: uses('uart_') || uses('__tc_uart'),
|
|
139
|
+
// USB CDC serial: every usb.* lowering calls into the __tc_usb<N>_* shim
|
|
140
|
+
// (device + init helper emitted under usesUsb).
|
|
141
|
+
usesUsb: uses('__tc_usb'),
|
|
142
|
+
// STM32F4 DBGMCU keep-SWD-alive init present (emitted for stm32f4 socs).
|
|
143
|
+
usesStm32DebugSleep: uses('__tc_stm32_dbgmcu'),
|
|
129
144
|
usesWdt: uses('wdt_'),
|
|
130
145
|
usesBle: uses('bt_') || uses('bt_gatt') || uses('bt_le_'),
|
|
131
146
|
usesDisplay: uses('display_write') || uses('display_init') || uses('display_fill_rect') || uses('__tc_display_dev') || uses('CuttlefishDisplayTarget'),
|
|
132
147
|
usesTouch: uses('ft6336u') || uses('touch_'),
|
|
133
|
-
//
|
|
134
|
-
//
|
|
135
|
-
// with tx_power_dbm — removed.
|
|
136
|
-
usesPower: uses('pm_') || uses('k_sleep') || uses('PM_STATE_'),
|
|
148
|
+
// (The power HAL is removed; its former pm_/k_sleep token scan is gone —
|
|
149
|
+
// nothing here must match tx_power_dbm's `power` substring.)
|
|
137
150
|
usesWifi: uses('wifi_') || uses('net_mgmt') || uses('conn_mgr'),
|
|
138
151
|
// HTTP: the __tc_http_* shim + http_client_req + getaddrinfo. The '_'-anchored
|
|
139
152
|
// 'http_' token matches __tc_http_* and http_client_req (the core HTTP lib
|
|
@@ -164,6 +177,12 @@ export function scaffoldZephyrProject(projectRoot, debug = false, userKconfig, p
|
|
|
164
177
|
'# Auto-generated by @typecad/framework-zephyr from cuttlefish.config.ts.',
|
|
165
178
|
'cmake_minimum_required(VERSION 3.20.0)',
|
|
166
179
|
'',
|
|
180
|
+
'# The app is its own board root: MCU-only targets generate an out-of-tree',
|
|
181
|
+
'# custom board under boards/typecad/<name>/ that Zephyr must discover.',
|
|
182
|
+
'# Harmless when boards/ holds only .overlay files (BOARD_ROOT just needs',
|
|
183
|
+
'# the directory to exist).',
|
|
184
|
+
'list(APPEND BOARD_ROOT ${CMAKE_CURRENT_SOURCE_DIR})',
|
|
185
|
+
'',
|
|
167
186
|
'find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})',
|
|
168
187
|
'',
|
|
169
188
|
'project(zephyr_app)',
|
|
@@ -247,6 +266,19 @@ export function scaffoldZephyrProject(projectRoot, debug = false, userKconfig, p
|
|
|
247
266
|
}
|
|
248
267
|
}
|
|
249
268
|
}
|
|
269
|
+
// Per-part Kconfig exceptions: catalog parts whose driver is NOT default-y
|
|
270
|
+
// on its DT node carry extra lines here (empty today — every in-tree sensor
|
|
271
|
+
// driver lights up from the node; the path exists so the first exception
|
|
272
|
+
// found by the generator has somewhere to go).
|
|
273
|
+
const sensorParts = scanSensorParts(src);
|
|
274
|
+
if (sensorParts.length > 0) {
|
|
275
|
+
const extra = [...new Set(sensorParts.flatMap((sp) => SENSOR_PART_INFO[sp.part]?.kconfig ?? []))];
|
|
276
|
+
if (extra.length > 0) {
|
|
277
|
+
prjConf.push('', '# Sensor part Kconfig (catalog exceptions).');
|
|
278
|
+
for (const line of extra)
|
|
279
|
+
prjConf.push(line);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
250
282
|
// Emit user-specified Kconfig from cuttlefish.config.ts zephyr.kconfig.
|
|
251
283
|
// These override any matching auto-detected symbol (skipped above).
|
|
252
284
|
if (userKconfig) {
|
|
@@ -30,6 +30,10 @@ export declare function discoverFromPath(): WestInstall | null;
|
|
|
30
30
|
/** The canonical Zephyr workspace layout puts the venv beside the SDK:
|
|
31
31
|
* <workspace>/{.venv, zephyr}. So ${ZEPHYR_BASE}/../.venv is the venv. */
|
|
32
32
|
export declare function discoverFromZephyrBase(): WestInstall | null;
|
|
33
|
+
/** The installer-written ZEPHYR_BASE of the micromamba env, fs-only (no
|
|
34
|
+
* spawn) — the cheap probe shared by board-catalog overlay discovery.
|
|
35
|
+
* Undefined when the installer env or its env-vars file is absent. */
|
|
36
|
+
export declare function micromambaZephyrBase(envName?: string): string | undefined;
|
|
33
37
|
export declare function discoverFromMicromamba(envName?: string): WestInstall | null;
|
|
34
38
|
/** Candidate Zephyr workspace directories. Each may contain both `.venv/`
|
|
35
39
|
* and `zephyr/` (the SDK). Exported for test injection. */
|
|
@@ -42,13 +42,14 @@ function pythonRunsWest(exe) {
|
|
|
42
42
|
return false;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
/** True if `cmd` runs `west --version` successfully.
|
|
45
|
+
/** True if `cmd` runs `west --version` successfully. `cmd` comes from
|
|
46
|
+
* `where`/`which` output — a venv launcher (west.exe) or script path, spawned
|
|
47
|
+
* without a shell like every other command in this module. */
|
|
46
48
|
function westOnPath(cmd) {
|
|
47
49
|
try {
|
|
48
50
|
const r = spawnSync(cmd, ['--version'], {
|
|
49
51
|
encoding: 'utf8',
|
|
50
52
|
timeout: 15_000,
|
|
51
|
-
shell: IS_WIN,
|
|
52
53
|
windowsHide: true,
|
|
53
54
|
});
|
|
54
55
|
return r.status === 0;
|
|
@@ -67,12 +68,11 @@ export function isZephyrBase(dir) {
|
|
|
67
68
|
}
|
|
68
69
|
// ── Strategy 1: `west` on PATH ──────────────────────────────────────────────
|
|
69
70
|
export function discoverFromPath() {
|
|
70
|
-
// shell
|
|
71
|
-
//
|
|
72
|
-
//
|
|
71
|
+
// No shell: `where`/`which` are plain executables Node resolves from PATH
|
|
72
|
+
// (where.exe is a real PE, not a cmd builtin), and an args array with a
|
|
73
|
+
// truthy shell triggers Node's DEP0190 deprecation warning.
|
|
73
74
|
const which = spawnSync(IS_WIN ? 'where' : 'which', ['west'], {
|
|
74
75
|
encoding: 'utf8',
|
|
75
|
-
shell: IS_WIN,
|
|
76
76
|
windowsHide: true,
|
|
77
77
|
});
|
|
78
78
|
if (which.status !== 0)
|
|
@@ -160,6 +160,17 @@ function readMicromambaEnvVar(envDir, varName) {
|
|
|
160
160
|
}
|
|
161
161
|
return undefined;
|
|
162
162
|
}
|
|
163
|
+
/** The installer-written ZEPHYR_BASE of the micromamba env, fs-only (no
|
|
164
|
+
* spawn) — the cheap probe shared by board-catalog overlay discovery.
|
|
165
|
+
* Undefined when the installer env or its env-vars file is absent. */
|
|
166
|
+
export function micromambaZephyrBase(envName = process.env.TYPECAD_ZEPHYR_ENV || 'zephyr') {
|
|
167
|
+
const mm = findMicromamba();
|
|
168
|
+
if (!mm)
|
|
169
|
+
return undefined;
|
|
170
|
+
const envDir = join(mm.rootPrefix, 'envs', envName);
|
|
171
|
+
const zb = readMicromambaEnvVar(envDir, 'TYPECAD_ZEPHYR_BASE');
|
|
172
|
+
return zb && isZephyrBase(zb) ? zb : undefined;
|
|
173
|
+
}
|
|
163
174
|
export function discoverFromMicromamba(envName = process.env.TYPECAD_ZEPHYR_ENV || 'zephyr') {
|
|
164
175
|
const mm = findMicromamba();
|
|
165
176
|
if (!mm)
|
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
# @typecad/zephyr-installer
|
|
2
|
+
|
|
3
|
+
## 1.0.0-alpha.14
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ## ccache in the build env: fresh build dirs replay from cache
|
|
8
|
+
|
|
9
|
+
The micromamba env now installs `ccache` (conda-forge, all platforms). Zephyr's
|
|
10
|
+
`cmake/modules/ccache.cmake` automatically routes compiles and links through
|
|
11
|
+
ccache whenever it is on PATH — no extra wiring. Build dirs that legitimately
|
|
12
|
+
start fresh (config/board changes, the framework's dependency-cycle recovery)
|
|
13
|
+
then hit the cache for every unchanged Zephyr library object instead of
|
|
14
|
+
recompiling ~280 files from scratch. ccache's per-user default cache dir is
|
|
15
|
+
shared across projects; opt out with `USE_CCACHE=0`.
|
|
16
|
+
- ## `--delete`: uninstall everything after explicit confirmation
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npx @typecad/zephyr-installer --delete # shows what will be removed, asks 'yes'
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Removes everything the installer created:
|
|
23
|
+
|
|
24
|
+
- the conda env (`$MAMBA_ROOT_PREFIX/envs/<name>`)
|
|
25
|
+
- the Zephyr SDK (`$MAMBA_ROOT_PREFIX/zephyr-sdk/`)
|
|
26
|
+
- the west workspace (`~/zephyrproject`)
|
|
27
|
+
- micromamba itself (`$MAMBA_ROOT_PREFIX`) — **only when no other conda envs
|
|
28
|
+
exist**; otherwise the root is kept and the other envs are named in the summary
|
|
29
|
+
|
|
30
|
+
Safety model (destructive ops default-deny):
|
|
31
|
+
|
|
32
|
+
- Shows the exact paths **with on-disk sizes** before anything is touched.
|
|
33
|
+
- Requires typing `yes` exactly (Enter/cancel aborts with nothing deleted).
|
|
34
|
+
- Non-interactive stdin without `--yes` **refuses** (unlike install/modify,
|
|
35
|
+
which proceed) — `--delete --yes` is the explicit scripting form.
|
|
36
|
+
- The shell-profile hook from `micromamba shell init` is deliberately NOT
|
|
37
|
+
edited automatically; the summary names the file to trim by hand.
|
|
38
|
+
- Per-item results report `deleted`/`skipped` (locked files skip with the OS
|
|
39
|
+
error instead of aborting the rest).
|
|
40
|
+
- ## Selective platform installation + `--modify` reconfiguration
|
|
41
|
+
|
|
42
|
+
A full install downloads the 1.5 GB SDK bundle (all 25+ toolchains). Most users
|
|
43
|
+
need one or two platforms. The installer now downloads the ~10 MB minimal bundle
|
|
44
|
+
(cmake config + sdk_version) plus only the selected toolchains:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
npx @typecad/zephyr-installer # interactive platform checklist
|
|
48
|
+
npx @typecad/zephyr-installer --modify # add/remove platforms later
|
|
49
|
+
npx @typecad/zephyr-installer --platforms arm,esp32 # non-interactive
|
|
50
|
+
npx @typecad/zephyr-installer --platforms all # full bundle (previous behavior)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Platform groups
|
|
54
|
+
|
|
55
|
+
| Group | Toolchain(s) | Covers | ~Download |
|
|
56
|
+
|-------|-------------|--------|-----------|
|
|
57
|
+
| ARM Cortex-M | `arm-zephyr-eabi` | nRF, RP2040, STM32, SAMD | ~150 MB |
|
|
58
|
+
| ESP32 | `xtensa-espressif_esp32{,s2,s3}_zephyr-elf` | ESP32/S2/S3 | ~300 MB |
|
|
59
|
+
| RISC-V | `riscv64-zephyr-elf` | ESP32-C3/C6 | ~120 MB |
|
|
60
|
+
| x86 | `x86_64-zephyr-elf` | native_sim | ~100 MB |
|
|
61
|
+
| aarch64 | `aarch64-zephyr-elf` | ARM64 boards | ~100 MB |
|
|
62
|
+
| All | (full bundle) | everything | ~1.5 GB |
|
|
63
|
+
|
|
64
|
+
### Interactive checklist
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
Select platform toolchains to install:
|
|
68
|
+
|
|
69
|
+
[1] ARM Cortex-M (nRF, RP2040, STM32, SAMD, ...) ~150 MB installed
|
|
70
|
+
[2] ESP32 / ESP32-S2 / ESP32-S3 (Xtensa) ~300 MB
|
|
71
|
+
[3] RISC-V (ESP32-C3/C6, generic RISC-V) ~120 MB
|
|
72
|
+
[4] x86 / native_sim ~100 MB
|
|
73
|
+
[a] All (full bundle, ~1.5 GB download / ~11 GB extracted)
|
|
74
|
+
|
|
75
|
+
Enter selection (e.g. '1 2', 'arm,esp32', or 'all'):
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### `--modify` (reconfigure an existing install)
|
|
79
|
+
|
|
80
|
+
Re-runs the checklist with installed toolchains marked, then applies the delta:
|
|
81
|
+
new selections download (idempotent per-toolchain), deselections delete their
|
|
82
|
+
toolchain dirs. Skips the env/workspace steps — SDK platforms only. The
|
|
83
|
+
selection persists in `$SDK_INSTALL_DIR/.typecad-platforms`.
|
|
84
|
+
|
|
85
|
+
### Line-ending safety
|
|
86
|
+
|
|
87
|
+
`.gitattributes` now forces `*.sh`/`*.mjs`/`*.env`/`environment.yml` to LF-only
|
|
88
|
+
(`text eol=lf`), preventing CRLF conversion on Windows checkouts that would
|
|
89
|
+
break bash on Linux with `$'\r': command not found`.
|
|
90
|
+
|
|
91
|
+
### Patch Changes
|
|
92
|
+
|
|
93
|
+
- ## Fix: recover from a broken `.west/` (missing config) instead of failing west update
|
|
94
|
+
|
|
95
|
+
`init-workspace` checked only for `.west/` and skipped `west init` when present. But a
|
|
96
|
+
workspace can have `.west/` without `.west/config` (interrupted/partial init), which
|
|
97
|
+
makes `west update` fail:
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
west.configuration.MalformedConfig: local configuration file not found
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Now requires BOTH `.west/` and `.west/config`; if `.west/` exists without its config,
|
|
104
|
+
it removes the partial `.west/` and re-initializes. The cloned `zephyr/` and `modules/`
|
|
105
|
+
are preserved — `west update` re-syncs them, so there's no full re-clone. Mirrored in
|
|
106
|
+
`install.sh` and `install.ps1`.
|
|
107
|
+
- ## Fix: `npx @typecad/zephyr-installer` did nothing (symlinked-bin guard)
|
|
108
|
+
|
|
109
|
+
The entry-point guard compared `import.meta.url` to `path.resolve(process.argv[1])`,
|
|
110
|
+
but `path.resolve` does NOT follow symlinks. npx (and global installs) run the bin
|
|
111
|
+
through a symlink (`node_modules/.bin/zephyr-installer` → `…/install.mjs`), so the
|
|
112
|
+
guard evaluated false and `install.mjs` exited without dispatching — `npx …` produced
|
|
113
|
+
no output. Running `node …/install.mjs` directly worked because that path isn't a
|
|
114
|
+
symlink.
|
|
115
|
+
|
|
116
|
+
Fixed by resolving symlinks on both sides (`realpathSync`) before comparing — the
|
|
117
|
+
canonical "is main module" check that survives symlinked bins.
|
|
118
|
+
|
|
119
|
+
Also: the confirmation gate's non-interactive path now PROCEEDS instead of aborting.
|
|
120
|
+
Some npx invocations don't forward a TTY for stdin; the old behavior aborted there
|
|
121
|
+
("Non-interactive stdin with no --yes — aborting"). It now proceeds (the user invoked
|
|
122
|
+
it explicitly; `--yes` remains the explicit no-prompt flag), so `npx` works whether or
|
|
123
|
+
not it forwards a TTY.
|
|
124
|
+
|
|
125
|
+
## Unreleased
|
|
126
|
+
|
|
127
|
+
- ## dfu-util in the Windows env + pyusb everywhere
|
|
128
|
+
|
|
129
|
+
west flash's dfu-util runner (STM32 ROM DFU bootloader boards, e.g. the
|
|
130
|
+
WeAct Black Pill) shells out to dfu-util, and a missing executable dies
|
|
131
|
+
with a raw FileNotFoundError. conda-forge has no dfu-util, so the Windows
|
|
132
|
+
installer now fetches MSYS2's mingw64 dfu-util package plus its
|
|
133
|
+
libusb/libwinpthread DLLs (SHA256-pinned in versions.env) into the env's
|
|
134
|
+
Library/bin — on the activation PATH and on the PATH of the
|
|
135
|
+
'micromamba run -n zephyr west flash' the framework spawns. install.sh
|
|
136
|
+
prints the per-OS install command instead (no auto-sudo). environment.yml
|
|
137
|
+
also gains pyusb, which silences the "runner rtsflash could not be
|
|
138
|
+
imported" warning west prints on every invocation.
|
|
139
|
+
|
|
140
|
+
## 1.0.0-alpha.13
|
|
141
|
+
|
|
142
|
+
### Minor Changes
|
|
143
|
+
|
|
144
|
+
- 95c3692: ## ccache in the build env: fresh build dirs replay from cache
|
|
145
|
+
|
|
146
|
+
The micromamba env now installs `ccache` (conda-forge, all platforms). Zephyr's
|
|
147
|
+
`cmake/modules/ccache.cmake` automatically routes compiles and links through
|
|
148
|
+
ccache whenever it is on PATH — no extra wiring. Build dirs that legitimately
|
|
149
|
+
start fresh (config/board changes, the framework's dependency-cycle recovery)
|
|
150
|
+
then hit the cache for every unchanged Zephyr library object instead of
|
|
151
|
+
recompiling ~280 files from scratch. ccache's per-user default cache dir is
|
|
152
|
+
shared across projects; opt out with `USE_CCACHE=0`.
|
|
153
|
+
|
|
154
|
+
## 1.0.0-alpha.12
|
|
155
|
+
|
|
156
|
+
### Minor Changes
|
|
157
|
+
|
|
158
|
+
- 7e8cccd: ## `--delete`: uninstall everything after explicit confirmation
|
|
159
|
+
|
|
160
|
+
```sh
|
|
161
|
+
npx @typecad/zephyr-installer --delete # shows what will be removed, asks 'yes'
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Removes everything the installer created:
|
|
165
|
+
|
|
166
|
+
- the conda env (`$MAMBA_ROOT_PREFIX/envs/<name>`)
|
|
167
|
+
- the Zephyr SDK (`$MAMBA_ROOT_PREFIX/zephyr-sdk/`)
|
|
168
|
+
- the west workspace (`~/zephyrproject`)
|
|
169
|
+
- micromamba itself (`$MAMBA_ROOT_PREFIX`) — **only when no other conda envs
|
|
170
|
+
exist**; otherwise the root is kept and the other envs are named in the summary
|
|
171
|
+
|
|
172
|
+
Safety model (destructive ops default-deny):
|
|
173
|
+
|
|
174
|
+
- Shows the exact paths **with on-disk sizes** before anything is touched.
|
|
175
|
+
- Requires typing `yes` exactly (Enter/cancel aborts with nothing deleted).
|
|
176
|
+
- Non-interactive stdin without `--yes` **refuses** (unlike install/modify,
|
|
177
|
+
which proceed) — `--delete --yes` is the explicit scripting form.
|
|
178
|
+
- The shell-profile hook from `micromamba shell init` is deliberately NOT
|
|
179
|
+
edited automatically; the summary names the file to trim by hand.
|
|
180
|
+
- Per-item results report `deleted`/`skipped` (locked files skip with the OS
|
|
181
|
+
error instead of aborting the rest).
|
|
182
|
+
|
|
183
|
+
- 4824892: ## Selective platform installation + `--modify` reconfiguration
|
|
184
|
+
|
|
185
|
+
A full install downloads the 1.5 GB SDK bundle (all 25+ toolchains). Most users
|
|
186
|
+
need one or two platforms. The installer now downloads the ~10 MB minimal bundle
|
|
187
|
+
(cmake config + sdk_version) plus only the selected toolchains:
|
|
188
|
+
|
|
189
|
+
```sh
|
|
190
|
+
npx @typecad/zephyr-installer # interactive platform checklist
|
|
191
|
+
npx @typecad/zephyr-installer --modify # add/remove platforms later
|
|
192
|
+
npx @typecad/zephyr-installer --platforms arm,esp32 # non-interactive
|
|
193
|
+
npx @typecad/zephyr-installer --platforms all # full bundle (previous behavior)
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### Platform groups
|
|
197
|
+
|
|
198
|
+
| Group | Toolchain(s) | Covers | ~Download |
|
|
199
|
+
| ------------ | ------------------------------------------- | ------------------------ | --------- |
|
|
200
|
+
| ARM Cortex-M | `arm-zephyr-eabi` | nRF, RP2040, STM32, SAMD | ~150 MB |
|
|
201
|
+
| ESP32 | `xtensa-espressif_esp32{,s2,s3}_zephyr-elf` | ESP32/S2/S3 | ~300 MB |
|
|
202
|
+
| RISC-V | `riscv64-zephyr-elf` | ESP32-C3/C6 | ~120 MB |
|
|
203
|
+
| x86 | `x86_64-zephyr-elf` | native_sim | ~100 MB |
|
|
204
|
+
| aarch64 | `aarch64-zephyr-elf` | ARM64 boards | ~100 MB |
|
|
205
|
+
| All | (full bundle) | everything | ~1.5 GB |
|
|
206
|
+
|
|
207
|
+
### Interactive checklist
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
Select platform toolchains to install:
|
|
211
|
+
|
|
212
|
+
[1] ARM Cortex-M (nRF, RP2040, STM32, SAMD, ...) ~150 MB installed
|
|
213
|
+
[2] ESP32 / ESP32-S2 / ESP32-S3 (Xtensa) ~300 MB
|
|
214
|
+
[3] RISC-V (ESP32-C3/C6, generic RISC-V) ~120 MB
|
|
215
|
+
[4] x86 / native_sim ~100 MB
|
|
216
|
+
[a] All (full bundle, ~1.5 GB download / ~11 GB extracted)
|
|
217
|
+
|
|
218
|
+
Enter selection (e.g. '1 2', 'arm,esp32', or 'all'):
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### `--modify` (reconfigure an existing install)
|
|
222
|
+
|
|
223
|
+
Re-runs the checklist with installed toolchains marked, then applies the delta:
|
|
224
|
+
new selections download (idempotent per-toolchain), deselections delete their
|
|
225
|
+
toolchain dirs. Skips the env/workspace steps — SDK platforms only. The
|
|
226
|
+
selection persists in `$SDK_INSTALL_DIR/.typecad-platforms`.
|
|
227
|
+
|
|
228
|
+
### Line-ending safety
|
|
229
|
+
|
|
230
|
+
`.gitattributes` now forces `*.sh`/`*.mjs`/`*.env`/`environment.yml` to LF-only
|
|
231
|
+
(`text eol=lf`), preventing CRLF conversion on Windows checkouts that would
|
|
232
|
+
break bash on Linux with `$'\r': command not found`.
|
|
233
|
+
|
|
234
|
+
### Patch Changes
|
|
235
|
+
|
|
236
|
+
- ## Upgrade to Zephyr SDK 1.0.1 (Zephyr 4.4-compatible)
|
|
237
|
+
|
|
238
|
+
Zephyr 4.4 requires the SDK 1.0.x line, which renamed its artifacts — installing
|
|
239
|
+
1.0.x with the old names (or 0.17.4 against Zephyr 4.4) produced build errors.
|
|
240
|
+
|
|
241
|
+
- `versions.env`: `ZEPHYR_SDK_VERSION=1.0.1` + `ZEPHYR_SDK_BUNDLE_SUFFIX=_gnu`
|
|
242
|
+
(1.0.x dropped "full" bundles; `_gnu` = all GNU toolchains + host tools).
|
|
243
|
+
- **Full-bundle names** append the suffix everywhere (`install.sh`,
|
|
244
|
+
`install.ps1`, `install.mjs` summary):
|
|
245
|
+
`zephyr-sdk-1.0.1_<plat>_gnu.<ext>`.
|
|
246
|
+
- **Selective-install toolchain tarballs use the flavor infix** — 1.0.x names
|
|
247
|
+
them `toolchain_gnu_<plat>_<target>.<ext>` (0.17.x had no infix). Without
|
|
248
|
+
this, every `--platforms`/`--modify` download would 404. The minimal bundle
|
|
249
|
+
name is unchanged (`_minimal`, no flavor).
|
|
250
|
+
- Fresh SHA256s from the release's official `sha256.sum` for linux-x86_64,
|
|
251
|
+
linux-aarch64, macos-aarch64, and windows-x86_64 — verification is now
|
|
252
|
+
enforced on all four.
|
|
253
|
+
- **macOS Intel (`macos-x86_64`) has no 1.0.x build** — `SHA256_macos_x86_64`
|
|
254
|
+
is the explicit `NONE` sentinel and `fetch-sdk` fails fast with guidance
|
|
255
|
+
(use an ARM Mac, or `--sdk-version 0.17.4` for the Zephyr 4.3.x line).
|
|
256
|
+
- ESP32 note: the xtensa-espressif toolchains are **individual 1.0.x assets**
|
|
257
|
+
(`toolchain_gnu_<plat>_xtensa-espressif_esp32s3_zephyr-elf.tar.xz`, verified
|
|
258
|
+
in `sha256.sum`) so `--platforms esp32` works; the `_gnu` bundle itself may
|
|
259
|
+
not preinstall them, in which case Zephyr's espressif HAL fetches them during
|
|
260
|
+
the first ESP32 build.
|
|
261
|
+
|
|
262
|
+
All artifact URLs HEAD-checked against the v1.0.1 release (bundle, minimal,
|
|
263
|
+
and toolchain tarballs → 200). Tests updated: new hashes pinned, `_gnu` bundle
|
|
264
|
+
name asserted across entry points, toolchain-infix wiring guarded.
|
|
265
|
+
|
|
266
|
+
## 1.0.0-alpha.11
|
|
267
|
+
|
|
268
|
+
### Patch Changes
|
|
269
|
+
|
|
270
|
+
- 66f04cf: ## Fix: recover from a broken `.west/` (missing config) instead of failing west update
|
|
271
|
+
|
|
272
|
+
`init-workspace` checked only for `.west/` and skipped `west init` when present. But a
|
|
273
|
+
workspace can have `.west/` without `.west/config` (interrupted/partial init), which
|
|
274
|
+
makes `west update` fail:
|
|
275
|
+
|
|
276
|
+
```
|
|
277
|
+
west.configuration.MalformedConfig: local configuration file not found
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Now requires BOTH `.west/` and `.west/config`; if `.west/` exists without its config,
|
|
281
|
+
it removes the partial `.west/` and re-initializes. The cloned `zephyr/` and `modules/`
|
|
282
|
+
are preserved — `west update` re-syncs them, so there's no full re-clone. Mirrored in
|
|
283
|
+
`install.sh` and `install.ps1`.
|
|
284
|
+
|
|
285
|
+
- 66f04cf: ## Fix: `npx @typecad/zephyr-installer` did nothing (symlinked-bin guard)
|
|
286
|
+
|
|
287
|
+
The entry-point guard compared `import.meta.url` to `path.resolve(process.argv[1])`,
|
|
288
|
+
but `path.resolve` does NOT follow symlinks. npx (and global installs) run the bin
|
|
289
|
+
through a symlink (`node_modules/.bin/zephyr-installer` → `…/install.mjs`), so the
|
|
290
|
+
guard evaluated false and `install.mjs` exited without dispatching — `npx …` produced
|
|
291
|
+
no output. Running `node …/install.mjs` directly worked because that path isn't a
|
|
292
|
+
symlink.
|
|
293
|
+
|
|
294
|
+
Fixed by resolving symlinks on both sides (`realpathSync`) before comparing — the
|
|
295
|
+
canonical "is main module" check that survives symlinked bins.
|
|
296
|
+
|
|
297
|
+
Also: the confirmation gate's non-interactive path now PROCEEDS instead of aborting.
|
|
298
|
+
Some npx invocations don't forward a TTY for stdin; the old behavior aborted there
|
|
299
|
+
("Non-interactive stdin with no --yes — aborting"). It now proceeds (the user invoked
|
|
300
|
+
it explicitly; `--yes` remains the explicit no-prompt flag), so `npx` works whether or
|
|
301
|
+
not it forwards a TTY.
|
|
302
|
+
|
|
303
|
+
## 1.0.0-alpha.10
|
|
304
|
+
|
|
305
|
+
### Patch Changes
|
|
306
|
+
|
|
307
|
+
- 63433ea: ## Pin cmake <4 (Zephyr 4.3.x is incompatible with CMake 4.x)
|
|
308
|
+
|
|
309
|
+
Fresh installs resolved `cmake 4.4.x` (the `cmake>=3.20` constraint had no
|
|
310
|
+
upper bound), and `west build` then failed at CMake configure:
|
|
311
|
+
|
|
312
|
+
```
|
|
313
|
+
CMake Error at .../cmake/modules/FindZephyr-sdk.cmake:57 (if):
|
|
314
|
+
if given arguments:
|
|
315
|
+
"(" "zephyr" "STREQUAL" ")" "OR" ...
|
|
316
|
+
Unknown arguments specified
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
Zephyr 4.3.x's `FindZephyr-sdk.cmake` uses an **unquoted** `${ZEPHYR_TOOLCHAIN_VARIANT}`
|
|
320
|
+
in an `if()`. When that variable is undefined it expands to nothing; CMake **3.x**
|
|
321
|
+
treats the empty expansion leniently (as an empty string), but CMake **4.x**
|
|
322
|
+
rejects it as an unknown argument. Zephyr 4.3.x predates CMake 4.x.
|
|
323
|
+
|
|
324
|
+
`environment.yml` now constrains `cmake>=3.20,<4` so conda resolves a 3.x
|
|
325
|
+
(currently 3.31.x). Loosen once a Zephyr revision that supports CMake 4.x is
|
|
326
|
+
pinned in `versions.env`. Guarded by a test asserting the upper bound is present.
|
|
327
|
+
|
|
328
|
+
- 69c0f79: ## Install per-module Python requirements (esptool for ESP32, etc.)
|
|
329
|
+
|
|
330
|
+
After `requirements-base.txt`, the installer now also installs the
|
|
331
|
+
**build-relevant** module `requirements.txt` files — HAL `scripts/`/`zephyr/`
|
|
332
|
+
dirs (esptool for espressif, vendor flash/script tools for atmel/stm32/silabs/
|
|
333
|
+
etc.) and top-level lib codegen (nanopb, zcbor). It deliberately does NOT do a
|
|
334
|
+
recursive find of every `requirements.txt`, which would also pull
|
|
335
|
+
docs/test/harness/example requirements (mbedtls docs, openthread test harness,
|
|
336
|
+
cmsis tests, lvgl docs, tf-m tools) — heavy and conflict-prone.
|
|
337
|
+
|
|
338
|
+
Without this, board-specific tooling was missing from the env. For ESP32 the
|
|
339
|
+
post-link image step ran a stale **system** `esptool` (the env had none) which
|
|
340
|
+
rejected Zephyr's invocation:
|
|
341
|
+
|
|
342
|
+
```
|
|
343
|
+
esptool: error: unrecognized arguments: --flash-mode --flash-freq 80m --flash-size 8MB
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
The espressif HAL pins `esptool>=5.0.2` in its own `requirements.txt`; installing
|
|
347
|
+
the per-module requirements puts a matching `esptool` (5.x) in the env, where the
|
|
348
|
+
activated `Scripts/` shadows the system one. Each module requirements file is
|
|
349
|
+
installed warn-and-continue so one bad pin can't abort the whole install.
|
|
350
|
+
|
|
351
|
+
Board support itself is universal — `west update` fetches every module and the
|
|
352
|
+
SDK full bundle ships every cross-toolchain (arm, riscv, xtensa, …) — so rp2040,
|
|
353
|
+
samd, nrf, stm32, etc. build with just the base env; only a few modules add
|
|
354
|
+
Python tools (esptool), which this step covers.
|
|
355
|
+
|
|
356
|
+
Mirrored in `install.sh` and `install.ps1`; guarded by a regression test
|
|
357
|
+
asserting both target `modules/hal/` (not a recursive find).
|
|
358
|
+
|
|
359
|
+
- 3aaec5f: ## Pin SHA256 for the linux-x86_64 + windows-x86_64 SDK bundles
|
|
360
|
+
|
|
361
|
+
`versions.env` shipped with every `SHA256_*` set to `TODO`, so `fetch-sdk`
|
|
362
|
+
skipped verification with a warning. Pinned the two bundles exercised by real
|
|
363
|
+
installs (each computed by the installer against the official Zephyr SDK 0.17.4
|
|
364
|
+
release bundle):
|
|
365
|
+
|
|
366
|
+
- `linux-x86_64`: `83f2f327…3d1116b6`
|
|
367
|
+
- `windows-x86_64`: `51d550eb…d9384ecd`
|
|
368
|
+
|
|
369
|
+
Verification is now enforced on those platforms — a mismatch aborts the install
|
|
370
|
+
instead of continuing. The other three (`linux-aarch64`, `macos-x86_64`,
|
|
371
|
+
`macos-aarch64`) remain `TODO` until a real install on each platform computes
|
|
372
|
+
and pins them (the installer prints the computed hash on first download).
|
|
373
|
+
|
|
374
|
+
Also adds a regression test that locks the two pinned values so a typo or
|
|
375
|
+
accidental `TODO`-reset in `versions.env` is caught.
|
|
376
|
+
|
|
377
|
+
- e540f4e: ## Install Zephyr's Python build requirements into the env
|
|
378
|
+
|
|
379
|
+
After `west update`, the installer now runs
|
|
380
|
+
`pip install -r $ZEPHYR_BASE/scripts/requirements-base.txt` into the `zephyr`
|
|
381
|
+
conda env. Without this, `west build` failed at CMake configure:
|
|
382
|
+
|
|
383
|
+
```
|
|
384
|
+
CMake Error at .../zephyr_module.cmake:73 (message):
|
|
385
|
+
Missing jsonschema dependency
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
`environment.yml` only carried `pyelftools` + `packaging`; Zephyr additionally
|
|
389
|
+
requires `jsonschema`, `pykwalify`, `PyYAML`, `intelhex`, `canopen`, `patool`,
|
|
390
|
+
`psutil`, `pyserial`, `requests`, `semver`, `tqdm`, `reuse`, `anytree`, and
|
|
391
|
+
`windows-curses` (Windows). Letting Zephyr's own pinned requirements file drive
|
|
392
|
+
the install tracks the Zephyr revision and avoids maintaining a separate list
|
|
393
|
+
that goes stale or misses deps.
|
|
394
|
+
|
|
395
|
+
Mirrored in `install.sh` (POSIX) and `install.ps1` (Windows), fail-fast on a
|
|
396
|
+
pip failure. Guarded by a regression test asserting both scripts wire
|
|
397
|
+
`requirements-base.txt`.
|
|
398
|
+
|
|
399
|
+
## 1.0.0-alpha.9
|
|
400
|
+
|
|
401
|
+
### Patch Changes
|
|
402
|
+
|
|
403
|
+
- 88414b0: ## Fix: SDK download aborted on POSIX (write-activation heredoc bug)
|
|
404
|
+
|
|
405
|
+
On Linux/macOS the installer aborted right after conda-env creation, before the
|
|
406
|
+
Zephyr SDK downloaded:
|
|
407
|
+
|
|
408
|
+
```
|
|
409
|
+
lib/write-activation.sh: line 58: env: unbound variable
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
`write-activation.sh` built `env-vars.ps1` with an **unquoted** bash heredoc and
|
|
413
|
+
used backticks to "escape" `$env:` — but in an unquoted heredoc a backtick is
|
|
414
|
+
**command substitution**, not an escape. The resulting `` `$env:…` `` ran as a
|
|
415
|
+
command, expanded the unbound `env` under `set -u`, and (with `set -e`) aborted
|
|
416
|
+
the whole install. Both `` `$env `` lines fired, both attributed to the
|
|
417
|
+
heredoc's start line (58).
|
|
418
|
+
|
|
419
|
+
This only triggered on POSIX, where `install.sh` runs: Windows uses
|
|
420
|
+
`install.ps1`, which writes `env-vars.ps1` via a PowerShell here-string (where
|
|
421
|
+
backtick _is_ the escape), so it never appeared there — which is why alpha.8
|
|
422
|
+
shipped with it.
|
|
423
|
+
|
|
424
|
+
Fix: backslash-escape (`\$env:`) for a literal `$` in the unquoted heredoc.
|
|
425
|
+
Added a regression test (`tests/packages/zephyr-installer/write-activation.test.ts`)
|
|
426
|
+
that sources `write-activation.sh` under `set -eu` and asserts the env-vars
|
|
427
|
+
files are written cleanly with literal `$env:` — the existing tests only ran
|
|
428
|
+
`--dry-run`, which skips `write_activation()`, so the path was uncovered.
|
|
429
|
+
|
|
430
|
+
## 1.0.0-alpha.8
|
|
431
|
+
|
|
432
|
+
### Minor Changes
|
|
433
|
+
|
|
434
|
+
- ## Cross-platform Zephyr toolchain installer
|
|
435
|
+
|
|
436
|
+
New **`@typecad/zephyr-installer`** package: a one-command, cross-platform
|
|
437
|
+
(Linux / macOS / Windows-native) installer for a working Zephyr build
|
|
438
|
+
environment on micromamba + the official Zephyr SDK. No preinstalled
|
|
439
|
+
conda/Python/toolchain required.
|
|
440
|
+
|
|
441
|
+
`node packages/zephyr-installer/install.mjs` dispatches to `install.sh` (POSIX)
|
|
442
|
+
or `install.ps1` (Windows) and: downloads micromamba, creates a `zephyr` conda
|
|
443
|
+
env (host tools from conda-forge; `dtc`/`openocd` on POSIX and `7zip` on Windows
|
|
444
|
+
installed as platform-specific extras, since micromamba ignores `environment.yml`
|
|
445
|
+
line selectors), fetches + SHA256-verifies the Zephyr SDK full bundle (located
|
|
446
|
+
outside the env prefix, idempotent, no `setup.sh`/`sudo` — relies on
|
|
447
|
+
`ZEPHYR_SDK_INSTALL_DIR`), and runs `west init --mr <rev>` + `west update` for a
|
|
448
|
+
vanilla Zephyr workspace.
|
|
449
|
+
|
|
450
|
+
Run via `npx @typecad/zephyr-installer` (or the `zephyr-installer` /
|
|
451
|
+
`typecad-zephyr-install` bin): the entry point prints a summary of what it
|
|
452
|
+
will do — versions, bundle name, ~sizes, install locations — and waits for
|
|
453
|
+
Enter before proceeding. `--yes` skips the prompt (CI); `--dry-run` prints the
|
|
454
|
+
resolved plan and exits.
|
|
455
|
+
|
|
456
|
+
Activation hooks export `ZEPHYR_BASE` + `ZEPHYR_SDK_INSTALL_DIR`, so once
|
|
457
|
+
activated, `framework-zephyr`'s west discovery (Strategy 1 — `west` on PATH)
|
|
458
|
+
finds the new install with zero code changes. A `templates/project/` ships
|
|
459
|
+
machine-agnostic activators (`.typecad/activate-zephyr.{ps1,sh}`) plus a VS Code
|
|
460
|
+
terminal profile that auto-activates on terminal open.
|
|
461
|
+
|
|
462
|
+
Windows hardening (verified on PowerShell 5.1): downloads via `curl.exe` (not
|
|
463
|
+
`Invoke-WebRequest`, which fails to resolve `api.anaconda.org` through the
|
|
464
|
+
system proxy stack), explicit Windows `tar.exe` (MSYS `tar` mis-parses `C:\`
|
|
465
|
+
paths), fail-fast `$LASTEXITCODE` checks on every native-exe call (no false
|
|
466
|
+
"done" cascades), partial-env-prefix detection with an actionable error, and
|
|
467
|
+
`micromamba shell init` so activation works in new shells without manual
|
|
468
|
+
hook-loading.
|
|
469
|
+
|
|
470
|
+
`@typecad/framework-zephyr` (patch): the actionable "west not found" error in
|
|
471
|
+
`west-spawn.ts` now points users at the installer (`node packages/zephyr-installer/install.mjs`).
|
|
472
|
+
|
|
473
|
+
Tests: 24 across dispatcher (incl. confirmation gate), dry-run, versions, and templates.
|