mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-08-17 16:34:44 -05:00
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:
+1
-1
@@ -43,7 +43,7 @@ RUN --mount=type=bind,source=.git,target=/pgadmin4/.git \
|
|||||||
npm install -g corepack && \
|
npm install -g corepack && \
|
||||||
corepack enable && \
|
corepack enable && \
|
||||||
yarn set version berry && \
|
yarn set version berry && \
|
||||||
yarn set version 4 && \
|
yarn set version "$(node -p "require('./package.json').packageManager.split('@')[1]")" && \
|
||||||
yarn install && \
|
yarn install && \
|
||||||
yarn run bundle && \
|
yarn run bundle && \
|
||||||
rm -rf yarn.lock \
|
rm -rf yarn.lock \
|
||||||
|
|||||||
@@ -221,8 +221,14 @@ REM Main build sequence Ends
|
|||||||
|
|
||||||
ECHO Installing javascript dependencies...
|
ECHO Installing javascript dependencies...
|
||||||
CD "%BUILDROOT%\web"
|
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 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 yarn install || EXIT /B 1
|
||||||
CALL npm rebuild || EXIT /B 1
|
CALL npm rebuild || EXIT /B 1
|
||||||
|
|
||||||
@@ -276,8 +282,14 @@ REM Main build sequence Ends
|
|||||||
|
|
||||||
CD "%BUILDROOT%\runtime\resources\app\"
|
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 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
|
CALL yarn workspaces focus --production || EXIT /B 1
|
||||||
|
|
||||||
ECHO Removing yarn cache...
|
ECHO Removing yarn cache...
|
||||||
|
|||||||
@@ -66,8 +66,13 @@ _build_runtime() {
|
|||||||
|
|
||||||
# Install the runtime node_modules, then replace the package.json
|
# Install the runtime node_modules, then replace the package.json
|
||||||
pushd "${BUNDLE_DIR}/Contents/Resources/app/" > /dev/null || exit
|
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 berry
|
||||||
yarn set version 4
|
yarn set version "${YARN_VERSION}"
|
||||||
yarn workspaces focus --production
|
yarn workspaces focus --production
|
||||||
|
|
||||||
# remove the yarn cache
|
# remove the yarn cache
|
||||||
@@ -298,8 +303,13 @@ _complete_bundle() {
|
|||||||
|
|
||||||
# Build node modules
|
# Build node modules
|
||||||
pushd "${SOURCE_DIR}/web" > /dev/null || exit
|
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 berry
|
||||||
yarn set version 4
|
yarn set version "${YARN_VERSION}"
|
||||||
yarn install 2>&1
|
yarn install 2>&1
|
||||||
|
|
||||||
# Record the source commit hash before the heavy lint/webpack
|
# Record the source commit hash before the heavy lint/webpack
|
||||||
|
|||||||
+6
-1
@@ -56,8 +56,13 @@ do
|
|||||||
tar cf - "${FILE}" | (cd ../pip-build/pgadmin4; tar xf -)
|
tar cf - "${FILE}" | (cd ../pip-build/pgadmin4; tar xf -)
|
||||||
done
|
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 berry
|
||||||
yarn set version 4
|
yarn set version "${YARN_VERSION}"
|
||||||
yarn install
|
yarn install
|
||||||
yarn run bundle
|
yarn run bundle
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user