Repository navigation
Description
Description
1.4.0-rc2 consumer validation (org-config PR vig-os/org-config#54, sync-issues-action PR vig-os/sync-issues-action#143) fails on every direnv-mode host CI job at "Set up devkit toolchain":
Forwarded 31 dev-shell shellHook env var(s) to GITHUB_ENV.
##[error]Unable to process file command 'env' successfully.
##[error]Invalid format 'devcontainer dev environment loaded (nix)'
Root cause
The #1180 shellHook env forwarding captures the dev-shell environment via
nix develop --profile ... --command env -0 > "$RUNNER_TEMP/devkit-devshell-env"i.e. it redirects the whole stdout of nix develop into the dump file. But the devkit-scaffolded flake shellHook echoes a banner to stdout (echo "devcontainer dev environment loaded (nix)"), which lands before the env -0 output in the same stream. The first NUL-delimited record becomes <banner>\n<FIRST_VAR>=<value>; since the host dump has no banner, the record is classified "changed" and forwarded, writing a heredoc whose name line contains the bare banner text — which GitHub's env file-command processor rejects, failing the job.
Both the banner and the action are devkit-managed, so every direnv-mode consumer on 1.4.0 breaks and cannot fix it locally. rc2's own smoke test missed it because the smoke-test consumer is container-mode (the direnv preamble never runs).
Fix
- Dump the environment to a file inside the dev-shell command instead of capturing stdout:
nix develop ... --command bash -c 'env -0 > "$1"' _ "$RUNNER_TEMP/devkit-devshell-env"— banner stdout stays on the job log, the dump stays clean. - Defense in depth: skip records whose name is not a valid env identifier (
^[A-Za-z_][A-Za-z0-9_]*$) so a corrupted record can never reach GITHUB_ENV again.
TDD: extend tests/test_setup_toolchain_env.py — make the stub nix emit the banner on stdout like the real flake does; assert the banner never reaches GITHUB_ENV and the first env record survives intact.
Fix targets release/1.4.0 per the RC-validation runbook (like #1187); rc3 follows.
Impact
Blocks 1.4.0 — all three Wave-1 consumer validation PRs are red on this.
Activity
test: reproduce shellHook banner corrupting the CI env forward
fix(workspace): isolate dev-shell env dump from shellHook stdout
fix(workspace): isolate dev-shell env dump from shellHook stdout (#1190)
chore: bump devkit pin to 1.4.0-rc3
chore: bump devkit pin to 1.4.0-rc3
chore: bump devkit pin to 1.4.0-rc3
fix(workspace): support self-hosted runners with preinstalled Nix (#1193
fix(workspace): capture host nix --version from stderr in detect step (…
fix(workspace): scope scaffold chmod +x to delivered scripts (#1199)
fix(workspace): apply rsync excludes to --preview ADDED report (#1200)
fix(workspace): make preserved-template diff robust to foreign-git wo…
c-vigo commentedon Jul 20, 2026
Fixed via PR #1190 (merged into release/1.4.0 @b533ef98): env dump written to a file inside the shell command + non-identifier record names skipped, so shellHook stdout banners can no longer corrupt GITHUB_ENV. Live-proven on rc3 (all three Wave-1 direnv lanes: rc2 "Forwarded 31" incl. corrupted record → rc3 "Forwarded 30", zero errors) and every rc since; shipped in 1.4.0. The systemic gap this exposed is tracked in #1194.
ci(smoke-test): persist direnv smoke lane in overlay (#1234)