fix: pin Yarn version from packageManager field in build scripts (#10156)

* fix: pin Yarn version from packageManager field in build scripts

Replace hardcoded 'yarn set version 4' in build-functions.sh with a
dynamic lookup from each workspace's package.json packageManager field.
Also syncs runtime yarn version to 4.15.0 to match web/package.json.

Fixes CI build failures caused by Yarn 4.x fetching a newer patch that
produces different builtin compat hashes, breaking --immutable lockfile
validation.
This commit is contained in:
Ashesh Vashi
2026-07-16 11:48:36 +05:30
committed by GitHub
parent dfc4ef37d0
commit b15c745dc1
6 changed files with 17 additions and 9 deletions
+12 -4
View File
@@ -209,8 +209,12 @@ _build_runtime() {
# Install the runtime node_modules
pushd "${BUNDLEDIR}/resources/app" > /dev/null || exit
yarn set version berry
yarn set version 4
YARN_VERSION=$(node -p "require('./package.json').packageManager.split('@')[1]")
if [ -z "${YARN_VERSION}" ]; then
echo "ERROR: Could not determine Yarn version from package.json packageManager field."
exit 1
fi
yarn set version "${YARN_VERSION}"
yarn workspaces focus --production
# remove the yarn cache
@@ -257,8 +261,12 @@ _copy_code() {
find "${SERVERROOT}/usr/${APP_NAME}/venv/" -name "_tkinter*" -print0 | xargs -0 rm -rf
pushd "${SOURCEDIR}/web" > /dev/null || exit
yarn set version berry
yarn set version 4
YARN_VERSION=$(node -p "require('./package.json').packageManager.split('@')[1]")
if [ -z "${YARN_VERSION}" ]; then
echo "ERROR: Could not determine Yarn version from package.json packageManager field."
exit 1
fi
yarn set version "${YARN_VERSION}"
yarn install
yarn run bundle
popd > /dev/null || exit