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

#10156 fixed CI build failures caused by Yarn 4.x fetching a newer patch
with different builtin compat hashes, breaking --immutable lockfile
validation, but only patched pkg/linux/build-functions.sh and the GHA
workflows. Make.bat, pkg/mac/build-functions.sh, pkg/pip/build.sh, and
Dockerfile still hardcoded 'yarn set version 4', which is what broke the
Windows Jenkins snapshot build (job 1669).
This commit is contained in:
Ashesh Vashi
2026-07-23 13:06:29 +05:30
committed by GitHub
parent b15c745dc1
commit 1993109475
4 changed files with 33 additions and 6 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ RUN --mount=type=bind,source=.git,target=/pgadmin4/.git \
npm install -g corepack && \
corepack enable && \
yarn set version berry && \
yarn set version 4 && \
yarn set version "$(node -p "require('./package.json').packageManager.split('@')[1]")" && \
yarn install && \
yarn run bundle && \
rm -rf yarn.lock \
+14 -2
View File
@@ -221,8 +221,14 @@ REM Main build sequence Ends
ECHO Installing javascript dependencies...
CD "%BUILDROOT%\web"
SET "YARN_VERSION="
FOR /f "delims=" %%v IN ('node -p "require('./package.json').packageManager.split('@')[1]"') DO SET "YARN_VERSION=%%v"
IF "%YARN_VERSION%"=="" (
ECHO ERROR: Could not determine Yarn version from package.json packageManager field.
EXIT /B 1
)
CALL yarn set version berry || EXIT /B 1
CALL yarn set version 4 || EXIT /B 1
CALL yarn set version %YARN_VERSION% || EXIT /B 1
CALL yarn install || EXIT /B 1
CALL npm rebuild || EXIT /B 1
@@ -276,8 +282,14 @@ REM Main build sequence Ends
CD "%BUILDROOT%\runtime\resources\app\"
SET "YARN_VERSION="
FOR /f "delims=" %%v IN ('node -p "require('./package.json').packageManager.split('@')[1]"') DO SET "YARN_VERSION=%%v"
IF "%YARN_VERSION%"=="" (
ECHO ERROR: Could not determine Yarn version from package.json packageManager field.
EXIT /B 1
)
CALL yarn set version berry || EXIT /B 1
CALL yarn set version 4 || EXIT /B 1
CALL yarn set version %YARN_VERSION% || EXIT /B 1
CALL yarn workspaces focus --production || EXIT /B 1
ECHO Removing yarn cache...
+12 -2
View File
@@ -66,8 +66,13 @@ _build_runtime() {
# Install the runtime node_modules, then replace the package.json
pushd "${BUNDLE_DIR}/Contents/Resources/app/" > /dev/null || exit
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 berry
yarn set version 4
yarn set version "${YARN_VERSION}"
yarn workspaces focus --production
# remove the yarn cache
@@ -298,8 +303,13 @@ _complete_bundle() {
# Build node modules
pushd "${SOURCE_DIR}/web" > /dev/null || exit
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 berry
yarn set version 4
yarn set version "${YARN_VERSION}"
yarn install 2>&1
# Record the source commit hash before the heavy lint/webpack
+6 -1
View File
@@ -56,8 +56,13 @@ do
tar cf - "${FILE}" | (cd ../pip-build/pgadmin4; tar xf -)
done
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 berry
yarn set version 4
yarn set version "${YARN_VERSION}"
yarn install
yarn run bundle