Repository navigation
fix(scripts): Nix image scaffolds real writable files, not store symlinks (#664) - #665
Merged
c-vigo merged 1 commit intoJun 23, 2026
Conversation
The Nix image bakes the workspace template as read-only /nix/store symlinks, so init-workspace.sh's rsync -a scaffolded dangling symlinks onto the host (and the placeholder sed -i failed on read-only files). rsync now uses --copy-links and the scaffold is chmod -R u+w'd, yielding real, writable files; no-op on the Debian image. Guard it with a static bats assertion and a behavioural nix-image.yml step that scaffolds via the real Nix image and asserts no dangling symlinks (the install suite otherwise only covers Debian). Refs: #664
This was referenced Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #664 — a cutover-blocker found by locally testing the Nix-image install flow.
dockerTools.buildLayeredImagestores the baked workspace template as read-only/nix/storesymlinks.init-workspace.shscaffolded withrsync -a(symlinks-as-symlinks), so a real install produced dangling, read-only symlinks on the host (and the placeholdersed -iwould fail on read-only files). Latent because CI runs the install/integration tests against the Debian image only — the Nix image just gets the testinfra suite.Fix (
assets/init-workspace.sh)--copy-links(-avL) to dereference the store symlinks into real files.chmod -R u+w "$WORKSPACE_DIR"right after the scaffold restores writability (the store mode is0444) — before the placeholdersed -i. No-op on the Debian image.Regression guards
init-workspace.bats, blocking in the integration suite): scaffold rsync uses--copy-links, no plainrsync -av, workspace made writable. Also updated two existing smoke-mode tests that pinned the oldrsync -av --deletestring.nix-image.yml, amd64): scaffolds via the real Nix image and assertsfind -xtype lis empty andflake.nixis a real file.Verified locally (rebuilt image + scaffold)
flake.nix -> /nix/store/…-devcontainer-bootstrap/…(dangling on host).flake.nix/.envrc/pyproject.tomlare real files with owner-write mode (-rw-r--r--); placeholder substitution applied (name = "dummy"); the T4.2 — Downstream pattern: minimal flake stub (non-overwriting) +nix2containerproduction builder #640 stub + T4.3 — Install/init UX: choose devcontainer / direnv / both #641--modeprune intact.shellcheckclean.Dependencies
buildLayeredImage), non-publishing #634 (Nix image) / T4.1 — Publish-cutover to the Nix image (GATED) #639 (unblocks the cutover).Refs: #664