Skip to content

fix(pixi): repair multi-line cmake task commands broken by pixi 0.70#1539

Merged
thewtex merged 1 commit into
InsightSoftwareConsortium:mainfrom
thewtex:pixi-native-builds
Jun 26, 2026
Merged

fix(pixi): repair multi-line cmake task commands broken by pixi 0.70#1539
thewtex merged 1 commit into
InsightSoftwareConsortium:mainfrom
thewtex:pixi-native-builds

Conversation

@thewtex

@thewtex thewtex commented Jun 19, 2026

Copy link
Copy Markdown
Member

Summary

Repairs the multi-line cmake task commands in the pixi manifests, which recently began failing the Native C++ CI workflow with exit code 127. The same broken pattern was also fixed in the create-itk-wasm project generator (so newly scaffolded projects are not born broken) and guarded with a regression test.

Fixes the failure seen in Native C++ run #27805452478.

Root cause

Recent pixi (≥ 0.70, which switched its task runner to deno_task_shell) treats a bare newline inside a multi-line cmd string as a command terminator. The configure-itk* cmake tasks laid out their flags one-per-line with no continuation token:

cmd = '''cmake -B$ITK_WASM_ITK_BUILD_DIR -S$ITK_WASM_ITK_SOURCE_DIR -GNinja
  -DCMAKE_CXX_STANDARD:STRING=20
  -DCMAKE_BUILD_TYPE:STRING=Debug
  ...'''

Under the new parser, only cmake … -GNinja ran (configuring ITK with default flags), and every subsequent -D… line was executed as its own command, producing -DCMAKE_CXX_STANDARD:STRING=20: command not found for each flag and ultimately exit code 127. This was reproduced locally with pixi 0.70.1.

Changes

  • pixi.toml — Added a trailing \ line continuation to every wrapped line of the configure-itk, configure-itk-wasm, and ten configure-native-* cmake tasks, so all -D flags are passed to a single cmake invocation. Layout and behavior are otherwise unchanged.
  • packages/core/typescript/create-itk-wasm/src/generate/pixi-toml.ts — The scaffolding generator emitted the same broken pattern in its configure-itk, configure-itk-wasm, and configure-native tasks, so every generated project would break identically under pixi ≥ 0.70. Applied the same \ continuation fix in the template literal.
  • packages/core/typescript/create-itk-wasm/src/test-pixi-toml.ts (new) — Regression test that runs the real generatePixiToml into a temp directory and asserts that every line of each multi-line cmd (except the last) ends with a shell continuation token (\, &&, ||, |, &). Wired into the package's test script as test:pixiToml.
  • pixi.lock — Upgraded from lockfile format v6 → v7 via pixi lock to clear the pixi install format warning. Re-solved from locked content only; the resolved package set is identical (534 packages, none added or removed).

Implementation notes

  • In the TypeScript generator the continuation is written as \\ within the JS template literal, which emits a literal backslash + newline into the generated pixi.toml — verified the output matches the hand-fixed root manifest.
  • Package-level packages/*/pixi.toml manifests were checked and left unchanged: their multi-line commands already terminate each line with &&, which the new parser continues correctly.

Testing

  • pnpm --filter create-itk-wasm build then test:pixiToml passes (15 multi-line commands checked).
  • Confirmed the test is a genuine guard: reverting the generator fix makes it fail with an actionable list of offending lines; restoring it passes.
  • CodeRabbit review of the changes: 0 findings.
  • pixi install --locked and pixi list --locked run clean with no format warning.

🤖 Generated with Claude Code

Recent pixi (>= 0.70, deno_task_shell) treats a bare newline in a
multi-line `cmd` string as a command terminator. The `configure-itk*`
cmake tasks split their flags across lines without a continuation
token, so only `cmake ... -GNinja` ran and each subsequent `-D...`
line was executed as its own command, failing the Native C++ CI with
"command not found" (exit code 127).

Append a trailing `\` to each continued line so all flags are passed to
a single cmake invocation, in both the root workspace manifest and the
create-itk-wasm project generator template (which emitted the same
broken pattern for every scaffolded project).

Also:
- Add a create-itk-wasm regression test (test:pixiToml) that generates
  a pixi.toml with the real generator and asserts every multi-line
  `cmd` line ends with a shell continuation token.
- Upgrade pixi.lock from format v6 to v7 (re-solved from locked
  content; identical package set) to clear the pixi install warning.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@thewtex thewtex changed the title fix(pixi): use line continuations in multi-line task commands fix(pixi): repair multi-line cmake task commands broken by pixi 0.70 Jun 19, 2026
@thewtex thewtex merged commit 7f4e4f6 into InsightSoftwareConsortium:main Jun 26, 2026
175 of 278 checks passed
@thewtex thewtex deleted the pixi-native-builds branch June 26, 2026 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant