Skip to content

fix(scripts): Nix image scaffolds real writable files, not store symlinks (#664) - #665

Merged
c-vigo merged 1 commit into
feature/625-nix-claude-migrationfrom
bugfix/664-nix-scaffold-symlinks
Jun 23, 2026
Merged

c-vigo merged 1 commit into
feature/625-nix-claude-migrationfrom
bugfix/664-nix-scaffold-symlinks

Conversation

@c-vigo

@c-vigo c-vigo commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #664 — a cutover-blocker found by locally testing the Nix-image install flow.

dockerTools.buildLayeredImage stores the baked workspace template as read-only /nix/store symlinks. init-workspace.sh scaffolded with rsync -a (symlinks-as-symlinks), so a real install produced dangling, read-only symlinks on the host (and the placeholder sed -i would 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)

  • All three scaffold rsyncs now use --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 is 0444) — before the placeholder sed -i. No-op on the Debian image.

Regression guards

  • Static bats (init-workspace.bats, blocking in the integration suite): scaffold rsync uses --copy-links, no plain rsync -av, workspace made writable. Also updated two existing smoke-mode tests that pinned the old rsync -av --delete string.
  • Behavioural (nix-image.yml, amd64): scaffolds via the real Nix image and asserts find -xtype l is empty and flake.nix is a real file.

Verified locally (rebuilt image + scaffold)

Dependencies

Refs: #664

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
@c-vigo
c-vigo merged commit 10dc426 into feature/625-nix-claude-migration Jun 23, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/664-nix-scaffold-symlinks branch June 23, 2026 20:03
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