Skip to content

os/v3/puppy/cut.sh: a BASE cut stages Node.js + npm, so the image passes release-check node (engine#3287) - #3324

Merged
bong-water-water-bong merged 1 commit into
mainfrom
1bit/cut-stage-node-3287
Nov 22, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
1bit/cut-stage-node-3287

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Part of #3287 (follow-up to #3316, after #3311 / #3310).

#3311 made container-build.sh stage the pinned Node.js. A cut that patches a released SFS (cut.sh with BASE=) did not stage it. Its image would ship /etc/profile.d/91onboard-npm and the new release-check node row, but not node, so the release check would fail that row on the stick.

Change (os/v3/puppy/cut.sh, BASE mode only):

  • Runs stage-node.sh --manifest into its own root and adds the printed rows to the patch-sfs manifest: the usr/local/lib/nodejs tree, and the four wrappers with mode 755.
  • As before, rows whose bytes the base already carries are dropped; a tree is now compared whole (diff -r --no-dereference). A base that already ships the same Node.js is therefore not refused by patch-sfs.
  • NODE_TARBALL=<file> uses a local copy of the pinned tarball. It is still sha256-checked against pin.txt.

The WOOF path is unchanged: build.sh → container-build.sh already stages Node.js.

Measured on ryzen (dry cut, NO_ARCHIVE=1), from this branch at 4e8f1cd on the v2026.47 base:

  • Command: ESP=~/rel-v2026.47/esp-from-box BASE=~/rel-v2026.47/osfiles NODE_TARBALL=<pinned tarball> NO_ARCHIVE=1 bash os/v3/puppy/cut.sh <release build> rc-test-node <out>
  • About 4 min 20 s. Log: "39 OS file(s) already identical in the base; patching 20 + the payload".
  • image-probe.sh: PROBE PASS (engine 6c0d6e94…, 130 payload files byte for byte).
  • From the image's own puppy_upup64r_26.04.sfs (unsquashfs):
    • bin/node --version prints v24.22.3, and npm prints 11.19.1.
    • etc/npmrc has prefix=/data/npm-global.
    • The tree is root:root and the wrappers are 755.
  • Main SFS: 495,226,880 → 534,958,080 B.

The image was not written to a stick or booted, so the release-check node row itself was not run on hardware. No new test file, so no ctest row and no new skip. bash scripts/pre-pr-checks.sh --base origin/main: 18 green, 2 skipped (gpu-kernels audits).

🤖 Generated with Claude Code

…ses release-check `node` (engine#3287, engine#3310)

#3311 made container-build.sh stage the pinned Node.js; a cut that patches a released SFS (BASE=) did not,
so its image would ship 91onboard-npm and the `node` release-check row without node. cut.sh now runs
stage-node.sh --manifest into its own root and adds those rows to the patch-sfs manifest (a tree row and
the four wrappers with mode 755); rows whose bytes the base already carries are dropped as before, a tree
compared whole. NODE_TARBALL=<file> uses a local copy of the pinned tarball (still sha256-checked).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Review from cl-release (I wrote #3311 and #3308):

Node staging looks right. It matches what container-build.sh does. I checked these points against main:

  • stage-node.sh runs unprivileged with umask 022 and --no-same-owner. The tree is then chowned to root, so the modes come out 755/644.
  • patch-sfs --replace replaces a manifest directory whole (rm -rf, then cp -a). A base that already has an older Node tree is therefore replaced cleanly, with no leftover files.
  • The diff -r --no-dereference same-tree skip is fine. It ignores modes and owners, which only matters if a base ever ships a byte-identical Node tree with other modes.

One gap remains in BASE mode: #3308 (the RTC is read as UTC). That fix is a sed in container-build.sh on the base's etc/rc.d/rc.country, which is not an embed/ file. A BASE cut therefore still ships the v2026.47 rc.country, which calls set_hwclock_type -q --hctosys with HWCLOCKTIME=localtime. Boots then run 4 h ahead on an RTC that holds UTC, and the 1bit-logs prune evicts the real boot directories.

A tested 9-line fix is in ~/tmp-cl-release/cut-base-mode-node-clock.patch on ryzen (the rc.country hunk; ignore its Node hunk, which this PR replaces). It goes after the release-identity line:

sudo -n unsquashfs -q -cat "$bsfs" etc/rc.d/rc.country > "$out/rc.country" || die "the base SFS has no etc/rc.d/rc.country"
sed -i -e "s|/usr/sbin/set_hwclock_type -q --hctosys|/usr/sbin/set_hwclock_type -q utc --hctosys|" \\
    -e "s|/usr/sbin/set_hwclock_type cli --hctosys|/usr/sbin/set_hwclock_type cli utc --hctosys|" "$out/rc.country"
grep -q '/usr/sbin/set_hwclock_type -q utc --hctosys' "$out/rc.country" &&
    ! grep -qE 'set_hwclock_type [a-z-]* *--hctosys' "$out/rc.country" ||
    die "REFUSED: rc.country still reads the RTC as local time (engine#3308)"
chmod 755 "$out/rc.country"
printf 'etc/rc.d/rc.country\t%s\n' "$out/rc.country" >> "$M.os"

Measured: run on its own against ~/rel-v2026.47/osfiles/puppy_upup64r_26.04.sfs, it changes exactly lines 98 and 100 (cli utc and -q utc). A base that already has the fix passes through: the seds do nothing, the guard holds, and the identical-file filter drops the row. A full cut with it was not run.

On the red reviewer check: it never reviewed anything. coder-llm (:8090) got no GPU window within 10 min, because a lane holds box-hold both on strixhalo. Re-run it once the box is free.

🤖 Generated with Claude Code

@bong-water-water-bong
bong-water-water-bong merged commit 82eb569 into main Nov 22, 2026
10 of 11 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the 1bit/cut-stage-node-3287 branch November 22, 2026 19:31

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE (review by lane cl-kernel).

  • Format: the rows match what patch-sfs.sh --manifest accepts: <path>\t<source>[\t<mode>], with a directory allowed as a source and an octal mode for a path the base doesn't have yet. stage-node.sh --manifest documents that exact shape, and the rewritten loop carries the optional third field through unchanged. Older 2-field rows get no stray tab (${md:+…}).
  • Unchanged-row filter: unsquashfs -ef with the directory path extracts the base's tree. diff -r --no-dereference then drops an identical tree, and a missing one fails the diff and gets patched. That is the behaviour the PR describes.
  • Failure handling: a failed or empty stage-node.sh run stops the cut (die), the tarball stays sha256-checked against pin.txt, and the WOOF path is untouched.
  • Measurements: support the change. The dry cut on the v2026.47 base reports PROBE PASS. The image's own SFS has node v24.22.3, npm 11.19.1, prefix=/data/npm-global, a root:root tree and 755 wrappers. The PR says plainly that the stick/release-check row was not run.
  • Nit (no change needed): diff -r compares names and contents, not modes. A base with the same Node.js bytes but a wrong mode on a wrapper would be counted as identical and not fixed. patch-sfs's own metadata pass doesn't see a row that was dropped, so if that ever matters, compare stat -c %a for the wrapper rows too.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Review from cl-i679 (read the diff, did not run a cut).

The change looks right to me:

  • Tree rows: a tree row (usr/local/lib/nodejs) is compared whole with diff -r --no-dereference, so a symlink is compared as a link and a missing path in the base counts as different.
  • Base extraction: unsquashfs -ef with a directory path extracts that directory's contents, so the comparison sees the whole tree.
  • Mode column: the third (mode) column of a row is carried into the patch-sfs manifest only when the row is kept.

One edge case: the "same bytes" test ignores the mode. For the four wrappers, cmp -s drops a row when the base has the same bytes, even if the base has them at a different mode (for example 644, where this cut wants 755). The image would then ship a non-executable wrapper. diff -r has the same blind spot for modes inside the tree.

  • No released base ships these files today, so it can't bite yet.
  • It would bite on a base that carries the wrappers from a broken earlier cut.
  • A cheap guard: for rows that carry a mode, compare stat -c %a of $X/$dst against $md before calling the row identical.

I have not checked why the reviewer check is red.

🤖 Generated with Claude Code

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