smoke-test: query /usr prefix for npm ls -g
Validate / docs-check (push) Successful in 13s
Validate / validate-base (push) Successful in 11m54s
Validate / validate-omos (push) Successful in 14m31s
Validate / validate-with-pi (push) Successful in 12m48s
Validate / validate-omos-with-pi (push) Successful in 19m1s
Validate / docs-check (push) Successful in 13s
Validate / validate-base (push) Successful in 11m54s
Validate / validate-omos (push) Successful in 14m31s
Validate / validate-with-pi (push) Successful in 12m48s
Validate / validate-omos-with-pi (push) Successful in 19m1s
The npm-prefix-on-volume fix (commit 9df126c) sets
NPM_CONFIG_PREFIX=/home/developer/.pi/npm-global in the image ENV so
user-installed pi packages survive container recreation. Side effect:
default 'npm ls -g' now queries the user prefix, missing the baked
opencode/pi/omos binaries that live in /usr.
The smoke test's oh-my-opencode-slim check ran 'npm ls -g | grep ...'
and started failing on validate-omos / validate-omos-with-pi after the
prefix fix landed on main, even though the package itself is correctly
installed and runnable.
Fix: explicitly invert the prefix per-call:
NPM_CONFIG_PREFIX=/usr npm ls -g --depth=0 | grep ...
Other smoke checks (opencode --version, pi --version, bun --version)
go through PATH which already includes /usr/bin, so they were
unaffected. Only oh-my-opencode-slim was checked via npm rather than
a binary-on-PATH because it's a library, not a CLI.
This commit is contained in:
@@ -185,8 +185,13 @@ if [ "$VARIANT" = "omos" ] || [ "$VARIANT" = "omos-with-pi" ]; then
|
|||||||
run "bun (omos)" "bun --version"
|
run "bun (omos)" "bun --version"
|
||||||
run "bunx symlink (omos)" "test -L /usr/local/bin/bunx && readlink /usr/local/bin/bunx"
|
run "bunx symlink (omos)" "test -L /usr/local/bin/bunx && readlink /usr/local/bin/bunx"
|
||||||
# oh-my-opencode-slim is npm-installed globally (not a bun install);
|
# oh-my-opencode-slim is npm-installed globally (not a bun install);
|
||||||
# verify it shows up in the global module list.
|
# verify it shows up in the global module list. We must explicitly point
|
||||||
run "oh-my-opencode-slim" "npm ls -g --depth=0 2>/dev/null | grep oh-my-opencode-slim"
|
# npm at the system prefix (/usr) here: the image's NPM_CONFIG_PREFIX env
|
||||||
|
# is set to /home/developer/.pi/npm-global so user-installed packages
|
||||||
|
# land on the persistent volume — which means a default `npm ls -g`
|
||||||
|
# queries the user prefix and would miss the baked binaries even though
|
||||||
|
# they're correctly on PATH at /usr/bin.
|
||||||
|
run "oh-my-opencode-slim" "NPM_CONFIG_PREFIX=/usr npm ls -g --depth=0 2>/dev/null | grep oh-my-opencode-slim"
|
||||||
else
|
else
|
||||||
if docker run --rm --entrypoint="" "$IMAGE" sh -c "command -v bun" >/dev/null 2>&1; then
|
if docker run --rm --entrypoint="" "$IMAGE" sh -c "command -v bun" >/dev/null 2>&1; then
|
||||||
fail "bun should NOT be in base image but was found"
|
fail "bun should NOT be in base image but was found"
|
||||||
|
|||||||
Reference in New Issue
Block a user