1 Commits
Author SHA1 Message Date
clawbot f9e23ccae3 Install the pinned node when the installed one is another major version (closes #118)
check / check (push) Canceled after 0s
script/bootstrap used whatever node was installed, so on the CI runner
image, which ships node 24, the pinned yarn 1.22.22 printed the
deprecation warning DEP0169 on every bootstrap. It now uses the
installed node only when its major version is the pinned one, and
otherwise installs the pinned node with nvm, as it already did when node
was missing, with yarn and the packages under it. It prints the node
version it uses. Only the major is compared because the Dockerfile
stages use a node 22 alpine image that nvm cannot replace. script/fmt
and script/fmt-check carry the same test to pick their yarn: the yarn on
PATH, or yarn under the pinned node loaded through nvm.

Model: opus-5-5
2026-10-08 04:14:21 +02:00
4 changed files with 22 additions and 17 deletions
+12 -12
View File
@@ -24,18 +24,18 @@ fmt-check, and commit.
- 2026-10-08: The canonical `script/bootstrap` now uses the installed node only - 2026-10-08: The canonical `script/bootstrap` now uses the installed node only
when its major version is the pinned one (issue 118). Otherwise, as when node when its major version is the pinned one (issue 118). Otherwise, as when node
is missing, it installs the pinned node under nvm and installs yarn and the is missing, it installs the pinned node under nvm and installs yarn and the
packages under it. The CI runner image ships node 24, under which the pinned packages under it. It prints the version of the node it uses either way. The
yarn 1.22.22 printed the deprecation warning DEP0169 on every bootstrap. Only CI runner image ships node 24, under which the pinned yarn 1.22.22 printed the
the major is compared because the `Dockerfile` stages start from a node 22 deprecation warning DEP0169 on every bootstrap. Only the major is compared
alpine image whose exact version is not the pin, and nvm cannot install a because the `Dockerfile` stages start from a node 22 alpine image whose exact
prebuilt node on alpine; the version-comparison rule in `REPO_POLICIES.md` version is not the pin, and nvm cannot install a prebuilt node on alpine; the
names node as its exception. `script/fmt` and `script/fmt-check` pick their version-comparison rule in `REPO_POLICIES.md` names node as its exception.
yarn with the same test: the `yarn` on `PATH` when the installed node is the `script/fmt` and `script/fmt-check` pick their yarn with the same test: the
pinned major, and otherwise yarn under the pinned node through nvm. `yarn` on `PATH` when the installed node is the pinned major, and otherwise
`REPO_POLICIES.md` and both checklists say so, and the checklists' final yarn under the pinned node through nvm. `REPO_POLICIES.md` and both checklists
`script/cibuild` check names what the CI runner image has: node 24 and no say so, and the checklists' final `script/cibuild` check names what the CI
yarn. Not yet tried on the shared runner. Repositories pick this up on their runner image has: node 24 and no yarn. Not yet tried on the shared runner.
next re-vendor. Repositories pick this up on their next re-vendor.
- 2026-10-07: The `script/cibuild` item in `NEW_REPO_CHECKLIST.md` now matches - 2026-10-07: The `script/cibuild` item in `NEW_REPO_CHECKLIST.md` now matches
the canonical `script/cibuild` (issue 125). Its image build carries the tag, the canonical `script/cibuild` (issue 125). Its image build carries the tag,
`-t "$tag"`, and the item says that `$version` comes from `-t "$tag"`, and the item says that `$version` comes from
+6 -1
View File
@@ -117,9 +117,14 @@ node_is_pinned_major() {
} }
ensure_node() { ensure_node() {
if node_is_pinned_major; then return 0; fi if node_is_pinned_major; then
echo "bootstrap: using node $(node --version)"
return 0
fi
ensure_nvm ensure_nvm
nvm_sh "nvm install $NODE_VERSION" nvm_sh "nvm install $NODE_VERSION"
nvm_sh "nvm use $NODE_VERSION >/dev/null && \
echo \"bootstrap: using node \$(node --version)\""
} }
ensure_yarn() { ensure_yarn() {
+2 -2
View File
@@ -22,10 +22,10 @@ node_is_pinned_major() {
# the pinned node in nvm, which bootstrap leaves off the PATH of the # the pinned node in nvm, which bootstrap leaves off the PATH of the
# shell that called it. nvm is a bash script, hence the subshell. # shell that called it. nvm is a bash script, hence the subshell.
run_yarn() { run_yarn() {
if node_is_pinned_major; then if node_is_pinned_major && command -v yarn >/dev/null 2>&1; then
exec yarn "$@" exec yarn "$@"
fi fi
if [ ! -s "$HOME/.nvm/nvm.sh" ]; then if node_is_pinned_major || [ ! -s "$HOME/.nvm/nvm.sh" ]; then
echo "fmt: no yarn; run script/bootstrap first" >&2 echo "fmt: no yarn; run script/bootstrap first" >&2
exit 1 exit 1
fi fi
+2 -2
View File
@@ -22,10 +22,10 @@ node_is_pinned_major() {
# the pinned node in nvm, which bootstrap leaves off the PATH of the # the pinned node in nvm, which bootstrap leaves off the PATH of the
# shell that called it. nvm is a bash script, hence the subshell. # shell that called it. nvm is a bash script, hence the subshell.
run_yarn() { run_yarn() {
if node_is_pinned_major; then if node_is_pinned_major && command -v yarn >/dev/null 2>&1; then
exec yarn "$@" exec yarn "$@"
fi fi
if [ ! -s "$HOME/.nvm/nvm.sh" ]; then if node_is_pinned_major || [ ! -s "$HOME/.nvm/nvm.sh" ]; then
echo "fmt-check: no yarn; run script/bootstrap first" >&2 echo "fmt-check: no yarn; run script/bootstrap first" >&2
exit 1 exit 1
fi fi