Repository navigation
fix(release): normalize package tarball modes and prove non-root install - #130335
Merged
Merged
Conversation
npm/pnpm pack copy on-disk file modes into the tarball, and node-tar's portable mode-fix only strips group/other write bits — it never adds read bits. A restrictive-umask build host therefore ships owner-only (0600/0700) tarball entries, which breaks the CLI for non-root users after `sudo npm install -g` under mode-preserving consumers such as system tar. - Normalize every packed entry to 0644/0755 (a+rX, exec bits kept) as the last step of packOpenClawPackageForDocker. - Add a tar -tvf mode gate to check-openclaw-package-tarball that rejects any non-world-readable entry. - Run the docker-package-install npm lane as root and execute the installed CLI as a non-root user to prove the fix live. - Fix the docker-package-install bun proof, broken on main since #129552 wired the bun smoke into the shared openclaw-e2e-instance library: replace the drift-prone per-file harness copy list with directory copies, and add a closure-walking guard test that fails on missing harness dependencies.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
August 26, 2026 19:55
Contributor
Author
|
Merged via squash.
|
This was referenced Aug 26, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 27, 2026
…all (openclaw#130335) npm/pnpm pack copy on-disk file modes into the tarball, and node-tar's portable mode-fix only strips group/other write bits — it never adds read bits. A restrictive-umask build host therefore ships owner-only (0600/0700) tarball entries, which breaks the CLI for non-root users after `sudo npm install -g` under mode-preserving consumers such as system tar. - Normalize every packed entry to 0644/0755 (a+rX, exec bits kept) as the last step of packOpenClawPackageForDocker. - Add a tar -tvf mode gate to check-openclaw-package-tarball that rejects any non-world-readable entry. - Run the docker-package-install npm lane as root and execute the installed CLI as a non-root user to prove the fix live. - Fix the docker-package-install bun proof, broken on main since openclaw#129552 wired the bun smoke into the shared openclaw-e2e-instance library: replace the drift-prone per-file harness copy list with directory copies, and add a closure-walking guard test that fails on missing harness dependencies.
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.
What Problem This Solves
scripts/package-openclaw-for-docker.mjsproducesopenclaw-<version>.tgzwhose extracted files can keep owner-only permissions (0600/0700) when packed
on a restrictive-umask build host. After
sudo npm install -g <tarball>onsuch an artifact,
/usr/lib/node_modules/openclaw/openclaw.mjs(or otherpackaged files) can end up unreadable by non-root users — the
openclawPATH symlink exists but its target is mode-restricted — even though the
/usr/bin/openclawshim resolves fine for root. Reproduced live on acrabbox AWS Ubuntu box (npm 11.16.0, node 24) and confirmed the underlying
mechanism against the pinned Docker E2E image (npm 11.16.0/11.17.0).
Docker E2E didn't catch this because the functional lane runs as root
throughout, so a same-user install/execute never exercises the failure mode.
Why This Change Was Made
npm pack/pnpm packcopy on-disk file modes into the tarball, andnode-tar's "portable" mode-fix only strips group/other write bits — it
never adds read bits. So a build host with a restrictive umask ships
owner-only tarball entries, and any mode-preserving consumer (system
tar -x, which OpenClaw's own Docker functional stage uses, plus some otherinstallers) reproduces the owner-only tree on install.
User Impact
scripts/package-openclaw-for-docker.mts: normalizes every packed tarballentry to
0644/0755(world-readable, executable bits preserved) as thefinal step of packaging, regardless of the build host's umask.
scripts/check-openclaw-package-tarball.mts: adds atar -tvfmode gatethat fails the tarball check on any non-world-readable entry, so a
regression can't ship silently.
scripts/e2e/docker-package-install.sh: the npm install lane now runsnpm install -gas root into the default global prefix and thenexecutes
openclaw --version/--helpas a non-root user viarunuser—proving the actual
sudo npm install -g+ non-root-use flow live. Theidentity evidence now records
npm:nonRootExecution=passed.bun proof turned out to be broken on
mainsince improve: verify packaged runtime on Bun 1.4 #129552 wired thebun smoke into the shared
openclaw-e2e-instancelibrary — the lane'sfile-by-file harness copy list was missing
openclaw-e2e-instance.sh,then transitively
agent-turn-output.mjs/fixtures, then theruntime-spawned
mock-openai-server.mjs. Replaced the drift-proneper-file list with directory copies (
scripts/+packages/normalization-core/src) and added a closure-walking guardtest (
test/scripts/docker-build-helper.test.ts) that fails on anymissing harness dependency — verified it catches all three pre-fix gaps.
Evidence
test/e2e/qa-lab/runtime/package-openclaw-for-docker.e2e.test.ts)packs a 0600/0700 fixture through the real pipeline and asserts 0644/0755
output; fails pre-fix.
test/scripts/check-openclaw-package-tarball.test.ts)proves the mode gate rejects an owner-only tarball fixture.
(
pnpm build+scripts/package-openclaw-for-docker.mjs) — 57MB tarball,11,299 files at 0644, 11 executables at 0755, 296 dirs at 0755 — passed
the extended tarball check, then ran the full
scripts/e2e/docker-package-install.shlane against it: npm (rootinstall, non-root exec), pnpm, and Bun proofs all passed
(
npm, pnpm, and Bun package artifact proofs passed, exit 0).pnpm test test/e2e/qa-lab/runtime/package-openclaw-for-docker.e2e.test.ts test/scripts/check-openclaw-package-tarball.test.ts test/scripts/docker-build-helper.test.ts— all pass.node scripts/check-changed.mjs— green (format, tsgo, oxlint, importcycles, coercion/wrapper/dependency-pin guards).
gpt-5.6-sol, high): clean, no accepted findings("patch is correct 0.96").