mirror of
https://github.com/bitbaum/openclaw.git
synced 2026-12-04 05:07:18 +01:00
* build: migrate tooling and source installs to pnpm 12 Pin the verified native toolchain without changing application dependency versions. Preserve the existing release-age policy explicitly and separate package-manager lock metadata from the application dependency graph. Use exact checkout pins for bootstrap and rollback, approve only the native pnpm installer where npm requires it, and retain global install ownership without equating the CLI major to the storage layout. Verify the Docker runtime toolchain offline as its non-root user. Remove duplicate bootstrap paths and obsolete prune input, update native CLI flags and regression fixtures, and preserve UTF-8 in macOS Bash installer NDJSON output. * fix(build): isolate production dependency installs for pnpm 12 Build production dependencies from the same frozen manifest inputs instead of pruning the inherited development tree. pnpm 12's native hoisted importer cannot rename lower-layer OverlayFS directories during pruning. Preserve native addon outputs, workspace builds, and offline non-root Corepack use while deleting the obsolete production-store seeder. Exercise runtime assembly and explicitly consent to the local agent-plugin E2E fixture under the current plugin capability contract. Validated full Matrix image and offline non-root runtime, focused Docker regressions, full checks with test types and architecture, docs, real agent-plugin gateway E2E, and isolated Codex autoreview. * test: align package smoke with pnpm 12 global installs * test: follow native pnpm artifact approval in distribution guard * test: modernize pnpm fixtures for v12 * test: align rebased update fixtures with pnpm 12 * test: retain sanitized upgrade restart diagnostics * test: expose CI navigation failures and register diagnostics * test: retain post-core outcomes and plugin artifact identity * chore(tooling): group upgrade diagnostic entrypoints * fix(update): support native pnpm global installs and source links Qualify local source and archive specs, carry verified global ownership through pnpm configuration, and verify intentional checkout links with shared runtime-readiness checks. Preserve strict packaged-install verification and manager ownership safeguards. Verified the production updater with pnpm 11.22 and 12 using default and custom roots, source links, and tarball updates. * test: preserve survivor diagnostics after service sealing Promote incomplete exit-zero runs before failure capture and exercise the sealed-service manager fixture without inventing successful child exits. * fix(update): preserve legacy pnpm global ownership Carry the verified root and bin through both pnpm and npm configuration dialects after original-environment probes. Real pnpm 10 custom-root updates and pnpm 11/12 source and tarball matrices pass without redirecting the caller or weakening ownership checks. * test(update): verify wizard consent through checkout handoff Use the prepared checkout and fresh-process finalization boundary introduced by the updater repair. Preserve explicit consent forwarding before and after the wizard subcommand without assuming plugin callbacks run in the old process. * refactor(update): validate checkout build metadata records Use the canonical record coercer instead of carrying an unchecked assertion into the shared runtime verifier. Remove the now-unused grandfathered assertion entry; no allowance is added. * docs(sandbox): document standalone common-image inputs * test(packaging): account for required native prebuilds Align installer and release size budgets at 235 MiB for the required native payload added on main. Keep both loader layouts, upstream binaries, explicit overrides, and missing-data rejection intact. Exercise actual defaults and the one-byte boundary. Retain bounded stderr diagnostics for the intermittent Bun signal test without claiming a production signal fix. * test: align refreshed installer fixtures with pnpm 12 * fix(test): share Bun smoke force-kill ownership Record the successful force-kill once across the timer and post-close drain. Native Darwin traces reproduced both duplicate-signal orders; genuine permission failures and uncleared groups still fail without extending deadlines.
202 lines
9.0 KiB
Bash
Executable File
202 lines
9.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
source "$ROOT_DIR/scripts/lib/docker-e2e-image.sh"
|
|
|
|
IMAGE_NAME="$(docker_e2e_resolve_image "openclaw-docker-e2e-bare:local")"
|
|
PACKAGE_TGZ="$(docker_e2e_prepare_package_tgz docker-package-install "${OPENCLAW_CURRENT_PACKAGE_TGZ:-}")"
|
|
IDENTITY_PATH="${OPENCLAW_DOCKER_ARTIFACT_IDENTITY_PATH:-$ROOT_DIR/.artifacts/docker-tests/docker-package-install-identities.json}"
|
|
NPM_PROOF_CONTAINER="openclaw-package-npm-proof-$$"
|
|
PNPM_PROOF_CONTAINER="openclaw-package-pnpm-proof-$$"
|
|
BUN_PROOF_CONTAINER="openclaw-package-bun-proof-$$"
|
|
DOCKER_RUN_TIMEOUT="${OPENCLAW_DOCKER_PACKAGE_INSTALL_RUN_TIMEOUT:-120s}"
|
|
BUN_HARNESS_DIR="$(mktemp -d "${TMPDIR:-/tmp}/openclaw-bun-harness.XXXXXX")"
|
|
|
|
cleanup() {
|
|
docker_e2e_docker_cmd rm -f \
|
|
"$NPM_PROOF_CONTAINER" \
|
|
"$PNPM_PROOF_CONTAINER" \
|
|
"$BUN_PROOF_CONTAINER" >/dev/null 2>&1 || true
|
|
docker_e2e_cleanup_package_tgz "$PACKAGE_TGZ"
|
|
rm -rf "$BUN_HARNESS_DIR"
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
docker_e2e_build_or_reuse "$IMAGE_NAME" docker-package-install "$ROOT_DIR/scripts/e2e/Dockerfile" "$ROOT_DIR" bare
|
|
|
|
# The bun smoke runs the shared openclaw-e2e-instance library (mock provider
|
|
# servers included), so copy its whole script roots instead of a per-file list
|
|
# that silently drifts when the library grows a dependency. The repo checkout
|
|
# itself stays unmounted: the lane proves the packaged artifact, not sources.
|
|
for harness_path in \
|
|
packages/normalization-core/src \
|
|
scripts; do
|
|
mkdir -p "$BUN_HARNESS_DIR/$(dirname "$harness_path")"
|
|
cp -R "$ROOT_DIR/$harness_path" "$BUN_HARNESS_DIR/$harness_path"
|
|
done
|
|
chmod -R a+rX "$BUN_HARNESS_DIR"
|
|
|
|
echo "Installing the real OpenClaw package artifact with npm as root..."
|
|
DOCKER_COMMAND_TIMEOUT="$DOCKER_RUN_TIMEOUT" docker_e2e_docker_run_cmd run -d \
|
|
--name "$NPM_PROOF_CONTAINER" \
|
|
--user root \
|
|
-v "$PACKAGE_TGZ:/tmp/openclaw-current.tgz:ro" \
|
|
"$IMAGE_NAME" \
|
|
bash -lc '
|
|
set -euo pipefail
|
|
npm install -g /tmp/openclaw-current.tgz --no-fund --no-audit
|
|
test "$(command -v openclaw)" = "/usr/local/bin/openclaw"
|
|
# Root installed the global package; a non-root user must still be able to
|
|
# run it. A same-user install can never catch an installed tree that ends
|
|
# up owner-only readable, which is how sudo-install breakage ships.
|
|
runuser -u appuser -- openclaw --version > /tmp/openclaw-version
|
|
runuser -u appuser -- openclaw --help > /tmp/openclaw-help
|
|
test -s /tmp/openclaw-help
|
|
chmod 644 /tmp/openclaw-version /tmp/openclaw-help
|
|
touch /tmp/openclaw-proof-ready
|
|
exec sleep infinity
|
|
' >/dev/null
|
|
|
|
echo "Installing the real OpenClaw package artifact with pnpm..."
|
|
DOCKER_COMMAND_TIMEOUT="$DOCKER_RUN_TIMEOUT" docker_e2e_docker_run_cmd run -d \
|
|
--name "$PNPM_PROOF_CONTAINER" \
|
|
-v "$PACKAGE_TGZ:/tmp/openclaw-current.tgz:ro" \
|
|
"$IMAGE_NAME" \
|
|
bash -lc '
|
|
set -euo pipefail
|
|
export PNPM_HOME=/tmp/pnpm-home
|
|
# pnpm stores global executables in the bin subdirectory of PNPM_HOME.
|
|
export PATH="$PNPM_HOME/bin:$PATH"
|
|
corepack prepare "$1" --activate
|
|
pnpm add --global openclaw@file:/tmp/openclaw-current.tgz
|
|
test "$(command -v openclaw)" = "$PNPM_HOME/bin/openclaw"
|
|
pnpm list --global --json > /tmp/pnpm-packages.json
|
|
package_root="$(node -p "require(\"/tmp/pnpm-packages.json\")[0].dependencies.openclaw.path")"
|
|
test -f "$package_root/package.json"
|
|
# Tarball builds require their dependency path, relative to the install group.
|
|
artifact_build="$(node -p "const path = require(\"node:path\"); \"openclaw@file:\" + path.relative(path.resolve(process.argv[1], \"../..\"), \"/tmp/openclaw-current.tgz\")" "$package_root")"
|
|
pnpm approve-builds --global "$artifact_build"
|
|
printf "%s\n" "$package_root" > /tmp/openclaw-package-root
|
|
openclaw --version > /tmp/openclaw-version
|
|
openclaw --help > /tmp/openclaw-help
|
|
test -s /tmp/openclaw-help
|
|
# A source install must follow checkout rebuilds without rewriting its package files.
|
|
(
|
|
export PNPM_HOME=/tmp/pnpm-source-link-home
|
|
export PATH="$PNPM_HOME/bin:$PATH"
|
|
mkdir -p /tmp/pnpm-source-link
|
|
cd /tmp/pnpm-source-link
|
|
node - "$1" <<"SOURCE_LINK"
|
|
const fs = require("node:fs");
|
|
fs.writeFileSync("package.json", JSON.stringify({
|
|
name: "openclaw-source-link-fixture", version: "1.0.0", packageManager: process.argv[2],
|
|
bin: { "openclaw-source-link-fixture": "cli.cjs" },
|
|
}));
|
|
fs.writeFileSync("pnpm-workspace.yaml", "packages: []\n");
|
|
fs.writeFileSync("pnpm-lock.yaml", "lockfileVersion: 9.0\n");
|
|
fs.writeFileSync("cli.cjs", "#!/usr/bin/env node\nconsole.log(1);\n", { mode: 0o755 });
|
|
SOURCE_LINK
|
|
pnpm install
|
|
for file in package.json pnpm-workspace.yaml pnpm-lock.yaml; do cp "$file" "$file.before"; done
|
|
pnpm add --global "openclaw-source-link-fixture@link:$PWD"
|
|
test "$(openclaw-source-link-fixture)" = 1
|
|
node <<"SOURCE_LINK"
|
|
const fs = require("node:fs");
|
|
fs.writeFileSync("cli-next.cjs", "#!/usr/bin/env node\nconsole.log(2);\n", { mode: 0o755 });
|
|
fs.renameSync("cli-next.cjs", "cli.cjs");
|
|
SOURCE_LINK
|
|
test "$(openclaw-source-link-fixture)" = 2
|
|
for file in package.json pnpm-workspace.yaml pnpm-lock.yaml; do cmp "$file" "$file.before"; done
|
|
)
|
|
touch /tmp/openclaw-proof-ready
|
|
exec sleep infinity
|
|
' -- "$(node -p "require('$ROOT_DIR/package.json').packageManager")" >/dev/null
|
|
|
|
echo "Installing the real OpenClaw package artifact with Bun..."
|
|
DOCKER_COMMAND_TIMEOUT="$DOCKER_RUN_TIMEOUT" docker_e2e_docker_run_cmd run -d \
|
|
--name "$BUN_PROOF_CONTAINER" \
|
|
-v "$PACKAGE_TGZ:/tmp/openclaw-current.tgz:ro" \
|
|
-v "$BUN_HARNESS_DIR:/repo:ro" \
|
|
"$IMAGE_NAME" \
|
|
bash -lc '
|
|
set -euo pipefail
|
|
npm install -g --prefix /tmp/bun-runtime bun@1.4.0 --no-fund --no-audit
|
|
cd /repo
|
|
BUN_BIN=/tmp/bun-runtime/bin/bun \
|
|
OPENCLAW_BUN_GLOBAL_SMOKE_HOST_BUILD=0 \
|
|
OPENCLAW_BUN_GLOBAL_SMOKE_PACKAGE_TGZ=/tmp/openclaw-current.tgz \
|
|
OPENCLAW_BUN_GLOBAL_SMOKE_PROOF_PATH=/tmp/openclaw-bun-proof.json \
|
|
bash scripts/e2e/bun-global-install-smoke.sh
|
|
touch /tmp/openclaw-proof-ready
|
|
exec sleep infinity
|
|
' >/dev/null
|
|
|
|
wait_for_proof() {
|
|
local container_name="$1"
|
|
for _ in $(seq 1 240); do
|
|
if docker exec "$container_name" test -f /tmp/openclaw-proof-ready; then
|
|
return 0
|
|
fi
|
|
if [ "$(docker inspect --format '{{.State.Running}}' "$container_name")" != "true" ]; then
|
|
docker logs "$container_name" >&2
|
|
return 1
|
|
fi
|
|
sleep 1
|
|
done
|
|
docker logs "$container_name" >&2
|
|
return 1
|
|
}
|
|
|
|
for container_name in "$NPM_PROOF_CONTAINER" "$PNPM_PROOF_CONTAINER" "$BUN_PROOF_CONTAINER"; do
|
|
wait_for_proof "$container_name"
|
|
done
|
|
|
|
NPM_PACKAGE_ROOT="/usr/local/lib/node_modules/openclaw"
|
|
NPM_INSTALLED_VERSION="$(docker exec "$NPM_PROOF_CONTAINER" cat /tmp/openclaw-version | tr -d '\r\n')"
|
|
PNPM_PACKAGE_ROOT="$(docker exec "$PNPM_PROOF_CONTAINER" cat /tmp/openclaw-package-root | tr -d '\r\n')"
|
|
PNPM_PACKAGE_VERSION="$(docker exec "$PNPM_PROOF_CONTAINER" node -p "require('$PNPM_PACKAGE_ROOT/package.json').version")"
|
|
PNPM_INSTALLED_VERSION="$(docker exec "$PNPM_PROOF_CONTAINER" cat /tmp/openclaw-version | tr -d '\r\n')"
|
|
BUN_OPENCLAW_PATH="$(
|
|
docker exec "$BUN_PROOF_CONTAINER" \
|
|
node -p 'JSON.parse(require("node:fs").readFileSync("/tmp/openclaw-bun-proof.json", "utf8")).openclawPath'
|
|
)"
|
|
BUN_INSTALLED_VERSION="$(
|
|
docker exec "$BUN_PROOF_CONTAINER" \
|
|
node -p 'JSON.parse(require("node:fs").readFileSync("/tmp/openclaw-bun-proof.json", "utf8")).openclawVersion'
|
|
)"
|
|
PACKAGE_VERSION="$(docker exec "$NPM_PROOF_CONTAINER" node -p "require('$NPM_PACKAGE_ROOT/package.json').version")"
|
|
test "$PNPM_PACKAGE_VERSION" = "$PACKAGE_VERSION"
|
|
for installed_version in "$NPM_INSTALLED_VERSION" "$PNPM_INSTALLED_VERSION" "$BUN_INSTALLED_VERSION"; do
|
|
if [[ "$installed_version" != *"$PACKAGE_VERSION"* ]]; then
|
|
echo "installed CLI output $installed_version does not contain package version $PACKAGE_VERSION" >&2
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
node --import tsx "$ROOT_DIR/scripts/e2e/lib/docker-artifact-proof/write-identities.ts" \
|
|
--scenario docker-package-install \
|
|
--output "$IDENTITY_PATH" \
|
|
--image "$IMAGE_NAME" \
|
|
--package "$PACKAGE_TGZ" \
|
|
--container "npm=$NPM_PROOF_CONTAINER" \
|
|
--container "pnpm=$PNPM_PROOF_CONTAINER" \
|
|
--container "bun=$BUN_PROOF_CONTAINER" \
|
|
--detail "npm:installedPackageRoot=$NPM_PACKAGE_ROOT" \
|
|
--detail "npm:installedPackageVersion=$PACKAGE_VERSION" \
|
|
--detail "npm:openclawVersion=$NPM_INSTALLED_VERSION" \
|
|
--detail "npm:openclawPath=/usr/local/bin/openclaw" \
|
|
--detail "npm:helpCommand=passed" \
|
|
--detail "npm:nonRootExecution=passed" \
|
|
--detail "pnpm:installedPackageRoot=$PNPM_PACKAGE_ROOT" \
|
|
--detail "pnpm:installedPackageVersion=$PNPM_PACKAGE_VERSION" \
|
|
--detail "pnpm:openclawVersion=$PNPM_INSTALLED_VERSION" \
|
|
--detail "pnpm:openclawPath=/tmp/pnpm-home/bin/openclaw" \
|
|
--detail "pnpm:helpCommand=passed" \
|
|
--detail "bun:installedPackageVersion=$PACKAGE_VERSION" \
|
|
--detail "bun:openclawVersion=$BUN_INSTALLED_VERSION" \
|
|
--detail "bun:openclawPath=$BUN_OPENCLAW_PATH" \
|
|
--detail "bun:helpCommand=passed"
|
|
|
|
echo "npm, pnpm, and Bun package artifact proofs passed."
|