Commit yarn 4 in the tree and install with --immutable (closes #149)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
Follows sneak's ruling at #149 (comment). This repository now carries yarn 4.18.1 under .yarn/releases. The distribution's yarn only starts that file, and that file does the work. yarn.lock is converted once, and script/bootstrap installs with --immutable instead of stopping on yarn's major version. Node is the distribution's newest Node package: nodejs-current on Alpine and nodejs_latest on nix. Every Dockerfile stage that needs yarn also copies .yarnrc.yml and .yarn/releases/. The policies and both checklists say so, with the steps for converting and for a new repository. Model: opus-5-5
This commit is contained in:
+6
-13
@@ -4,8 +4,10 @@
|
||||
# installed tools are skipped. Base tools, node and yarn come from nix,
|
||||
# apt, brew, or apk (detected in that order), with no version and no
|
||||
# hash, because the distribution is trusted. It installs node, yarn and
|
||||
# the node packages only when yarn.lock is in the tree. Assumes nothing
|
||||
# is present.
|
||||
# the node packages only when yarn.lock is in the tree. The
|
||||
# distribution's yarn only starts the release file that yarnPath in
|
||||
# .yarnrc.yml names, and that file does the work. So git pins the yarn
|
||||
# that runs. Assumes nothing is present.
|
||||
set -eu
|
||||
|
||||
ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"
|
||||
@@ -78,21 +80,12 @@ main() {
|
||||
|
||||
# A Dockerfile stage that needs no yarn copies no yarn.lock.
|
||||
if [ -f yarn.lock ]; then
|
||||
if missing node; then pkg_install nodejs nodejs node nodejs; fi
|
||||
if missing node; then pkg_install nodejs_latest nodejs node nodejs-current; fi
|
||||
if missing yarn && missing yarnpkg; then
|
||||
pkg_install yarn yarnpkg yarn yarn
|
||||
fi
|
||||
|
||||
# Debian 13 and Ubuntu 26.04 package yarn 4, which refuses a yarn 1
|
||||
# yarn.lock, or rewrites it in its own format.
|
||||
yarn_version="$(run_yarn --version)"
|
||||
if [ "${yarn_version%%.*}" != "1" ]; then
|
||||
echo "bootstrap: yarn $yarn_version refuses this yarn 1 yarn.lock;" \
|
||||
"use a distribution that packages yarn 1" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
run_yarn install --frozen-lockfile
|
||||
run_yarn install --immutable
|
||||
fi
|
||||
|
||||
echo "bootstrap complete"
|
||||
|
||||
Reference in New Issue
Block a user