1 Commits
Author SHA1 Message Date
sneak c2c58ea349 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 ran under node 24
and 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. 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 01:06:25 +00:00
4 changed files with 17 additions and 22 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
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
packages under it. It prints the version of the node it uses either way. The
CI runner image ships node 24, under which the pinned yarn 1.22.22 printed the
deprecation warning DEP0169 on every bootstrap. Only the major is compared
because the `Dockerfile` stages start from a node 22 alpine image whose exact
version is not the pin, and nvm cannot install a prebuilt node on alpine; the
version-comparison rule in `REPO_POLICIES.md` names node as its exception.
`script/fmt` and `script/fmt-check` pick their yarn with the same test: the
`yarn` on `PATH` when the installed node is the pinned major, and otherwise
yarn under the pinned node through nvm. `REPO_POLICIES.md` and both checklists
say so, and the checklists' final `script/cibuild` check names what the CI
runner image has: node 24 and no yarn. Not yet tried on the shared runner.
Repositories pick this up on their next re-vendor.
packages under it. The CI runner image ships node 24, under which the pinned
yarn 1.22.22 printed the deprecation warning DEP0169 on every bootstrap. Only
the major is compared because the `Dockerfile` stages start from a node 22
alpine image whose exact version is not the pin, and nvm cannot install a
prebuilt node on alpine; the version-comparison rule in `REPO_POLICIES.md`
names node as its exception. `script/fmt` and `script/fmt-check` pick their
yarn with the same test: the `yarn` on `PATH` when the installed node is the
pinned major, and otherwise yarn under the pinned node through nvm.
`REPO_POLICIES.md` and both checklists say so, and the checklists' final
`script/cibuild` check names what the CI runner image has: node 24 and no
yarn. Not yet tried on the shared runner. Repositories pick this up on their
next re-vendor.
- 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,
`-t "$tag"`, and the item says that `$version` comes from
+1 -6
View File
@@ -117,14 +117,9 @@ node_is_pinned_major() {
}
ensure_node() {
if node_is_pinned_major; then
echo "bootstrap: using node $(node --version)"
return 0
fi
if node_is_pinned_major; then return 0; fi
ensure_nvm
nvm_sh "nvm install $NODE_VERSION"
nvm_sh "nvm use $NODE_VERSION >/dev/null && \
echo \"bootstrap: using node \$(node --version)\""
}
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
# shell that called it. nvm is a bash script, hence the subshell.
run_yarn() {
if node_is_pinned_major && command -v yarn >/dev/null 2>&1; then
if node_is_pinned_major; then
exec yarn "$@"
fi
if node_is_pinned_major || [ ! -s "$HOME/.nvm/nvm.sh" ]; then
if [ ! -s "$HOME/.nvm/nvm.sh" ]; then
echo "fmt: no yarn; run script/bootstrap first" >&2
exit 1
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
# shell that called it. nvm is a bash script, hence the subshell.
run_yarn() {
if node_is_pinned_major && command -v yarn >/dev/null 2>&1; then
if node_is_pinned_major; then
exec yarn "$@"
fi
if node_is_pinned_major || [ ! -s "$HOME/.nvm/nvm.sh" ]; then
if [ ! -s "$HOME/.nvm/nvm.sh" ]; then
echo "fmt-check: no yarn; run script/bootstrap first" >&2
exit 1
fi