Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

devops: support msys2 (#13194)

liuxingbaoyu297edb02f128
diff --git a/browser_patches/checkout_build_archive_upload.sh b/browser_patches/checkout_build_archive_upload.sh
index 3cf688b54d..cd85b75648 100755
--- a/browser_patches/checkout_build_archive_upload.sh
+++ b/browser_patches/checkout_build_archive_upload.sh
@@ -332,7 +332,7 @@ if [[ "$CURRENT_HOST_OS_VERSION" != "$EXPECTED_HOST_OS_VERSION" ]]; then
exit 1
fi
-if [[ $(uname) == MINGW* ]]; then
+if [[ $(uname) == MINGW* || "$(uname)" == MSYS* ]]; then
ZIP_PATH="$PWD/archive-$BROWSER_NAME.zip"
LOG_PATH="$PWD/log-$BROWSER_NAME.zip"
else
diff --git a/browser_patches/chromium/goma.sh b/browser_patches/chromium/goma.sh
index 8d3fc2105f..d621811477 100755
--- a/browser_patches/chromium/goma.sh
+++ b/browser_patches/chromium/goma.sh
@@ -34,7 +34,7 @@ export GOMA_START_COMPILER_PROXY=true
function print_gn_args() {
PLAYWRIGHT_GOMA_PATH="${SCRIPT_FOLDER}/electron-build-tools/third_party/goma"
- if [[ $(uname) == MINGW* ]]; then
+ if [[ $(uname) == MINGW* || "$(uname)" == MSYS* ]]; then
PLAYWRIGHT_GOMA_PATH=$(cygpath -w "${PLAYWRIGHT_GOMA_PATH}")
fi
echo 'use_goma = true'
diff --git a/browser_patches/chromium/mirror.sh b/browser_patches/chromium/mirror.sh
index 168a8ec1b7..3b66b93450 100755
--- a/browser_patches/chromium/mirror.sh
+++ b/browser_patches/chromium/mirror.sh
@@ -39,7 +39,7 @@ mirror_chromium() {
PLATFORM="--mac"
elif [[ "${CURRENT_HOST_OS}" == "Linux" ]]; then
PLATFORM="--linux"
- elif [[ "${CURRENT_HOST_OS}" == MINGW* ]]; then
+ elif [[ "${CURRENT_HOST_OS}" == MINGW* || "${CURRENT_HOST_OS}" == MSYS* ]]; then
PLATFORM="--win64"
else
echo "ERROR: unsupported host platform - ${CURRENT_HOST_OS}"
diff --git a/browser_patches/firefox-beta/archive.sh b/browser_patches/firefox-beta/archive.sh
index 5b2af282d3..cfd280aef3 100755
--- a/browser_patches/firefox-beta/archive.sh
+++ b/browser_patches/firefox-beta/archive.sh
@@ -56,7 +56,7 @@ fi
# TODO(aslushnikov): this won't be needed with official builds.
if [[ "$(uname)" == "Linux" ]]; then
cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 "${OBJ_FOLDER}/dist/firefox/libstdc++.so.6"
-elif [[ "$(uname)" == MINGW* ]]; then
+elif [[ "$(uname)" == MINGW* || "$(uname)" == MSYS* ]]; then
# Bundle vcruntime14_1.dll - see https://github.com/microsoft/playwright/issues/9974
cd "$(printMSVCRedistDir)"
cp -t "${OBJ_FOLDER}/dist/firefox" vcruntime140_1.dll
diff --git a/browser_patches/firefox-beta/build.sh b/browser_patches/firefox-beta/build.sh
index 3d746c9136..0e774479a5 100755
--- a/browser_patches/firefox-beta/build.sh
+++ b/browser_patches/firefox-beta/build.sh
@@ -32,7 +32,7 @@ if [[ "$(uname)" == "Darwin" ]]; then
echo "-- building on Mac"
elif [[ "$(uname)" == "Linux" ]]; then
echo "-- building on Linux"
-elif [[ "$(uname)" == MINGW* ]]; then
+elif [[ "$(uname)" == MINGW* || "$(uname)" == MSYS* ]]; then
echo "ac_add_options --disable-update-agent" >> .mozconfig
echo "ac_add_options --disable-default-browser-agent" >> .mozconfig
echo "ac_add_options --disable-maintenance-service" >> .mozconfig
@@ -67,7 +67,7 @@ else
echo "ac_add_options --enable-release" >> .mozconfig
fi
-if [[ "$(uname)" == MINGW* || "$(uname)" == "Darwin" ]]; then
+if [[ "$(uname)" == MINGW* || "$(uname)" == "Darwin" || "$(uname)" == MSYS* ]]; then
# This options is only available on win and mac.
echo "ac_add_options --disable-update-agent" >> .mozconfig
fi
diff --git a/browser_patches/firefox/archive.sh b/browser_patches/firefox/archive.sh
index cb64aeb0e5..78ad1d6526 100755
--- a/browser_patches/firefox/archive.sh
+++ b/browser_patches/firefox/archive.sh
@@ -58,7 +58,7 @@ fi
# TODO(aslushnikov): this won't be needed with official builds.
if [[ "$(uname)" == "Linux" ]]; then
cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 "${OBJ_FOLDER}/dist/firefox/libstdc++.so.6"
-elif [[ "$(uname)" == MINGW* ]]; then
+elif [[ "$(uname)" == MINGW* || "$(uname)" == MSYS* ]]; then
# Bundle vcruntime14_1.dll - see https://github.com/microsoft/playwright/issues/9974
cd "$(printMSVCRedistDir)"
cp -t "${OBJ_FOLDER}/dist/firefox" vcruntime140_1.dll
diff --git a/browser_patches/firefox/build.sh b/browser_patches/firefox/build.sh
index e0f85049c8..0b7df1f791 100755
--- a/browser_patches/firefox/build.sh
+++ b/browser_patches/firefox/build.sh
@@ -32,12 +32,12 @@ if [[ "$(uname)" == "Darwin" ]]; then
echo "-- building on Mac"
elif [[ "$(uname)" == "Linux" ]]; then
echo "-- building on Linux"
-elif [[ "$(uname)" == MINGW* ]]; then
+elif [[ "$(uname)" == MINGW* || "$(uname)" == MSYS* ]]; then
echo "ac_add_options --disable-update-agent" >> .mozconfig
echo "ac_add_options --disable-default-browser-agent" >> .mozconfig
echo "ac_add_options --disable-maintenance-service" >> .mozconfig
- echo "-- building win64 build on MINGW"
+ echo "-- building on Windows"
echo "ac_add_options --target=x86_64-pc-mingw32" >> .mozconfig
echo "ac_add_options --host=x86_64-pc-mingw32" >> .mozconfig
DLL_FILE=$("C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find '**\Redist\MSVC\*\x64\**\vcruntime140.dll')
@@ -67,7 +67,7 @@ else
echo "ac_add_options --enable-release" >> .mozconfig
fi
-if [[ "$(uname)" == MINGW* || "$(uname)" == "Darwin" ]]; then
+if [[ "$(uname)" == MINGW* || "$(uname)" == "Darwin" || "$(uname)" == MSYS* ]]; then
# This options is only available on win and mac.
echo "ac_add_options --disable-update-agent" >> .mozconfig
fi
diff --git a/browser_patches/upload.sh b/browser_patches/upload.sh
index cbaa20bc95..7eaaaa0ddb 100755
--- a/browser_patches/upload.sh
+++ b/browser_patches/upload.sh
@@ -62,7 +62,7 @@ if [[ "${ZIP_PATH}" != *.zip && "${ZIP_PATH}" != *.gz ]]; then
echo "ERROR: ${ZIP_PATH} is not an archive (must have a .zip or .gz extension)"
exit 1
fi
-if [[ $(uname) == MINGW* ]]; then
+if [[ $(uname) == MINGW* || "$(uname)" == MSYS* ]]; then
# Convert POSIX path to MSYS
WIN_PATH=$({ cd $(dirname "$ZIP_PATH") && pwd -W; } | sed 's|/|\\|g')
WIN_PATH="${WIN_PATH}\\$(basename "$ZIP_PATH")"
diff --git a/browser_patches/webkit/archive.sh b/browser_patches/webkit/archive.sh
index 4f84bb4336..6a1e00c6f7 100755
--- a/browser_patches/webkit/archive.sh
+++ b/browser_patches/webkit/archive.sh
@@ -41,7 +41,7 @@ main() {
createZipForMac
elif [[ "$(uname)" == "Linux" ]]; then
createZipForLinux
- elif [[ "$(uname)" == MINGW* ]]; then
+ elif [[ "$(uname)" == MINGW* || "$(uname)" == MSYS* ]]; then
createZipForWindows
else
echo "ERROR: cannot upload on this platform!" 1>&2
diff --git a/browser_patches/webkit/build.sh b/browser_patches/webkit/build.sh
index 4449614454..3036b3a27c 100755
--- a/browser_patches/webkit/build.sh
+++ b/browser_patches/webkit/build.sh
@@ -81,7 +81,7 @@ elif [[ "$(uname)" == "Linux" ]]; then
echo
build_wpe
fi
-elif [[ "$(uname)" == MINGW* ]]; then
+elif [[ "$(uname)" == MINGW* || "$(uname)" == MSYS* ]]; then
/c/Windows/System32/cmd.exe "/c $(cygpath -w "${SCRIPT_FOLDER}"/buildwin.bat)"
else
echo "ERROR: cannot upload on this platform!" 1>&2
diff --git a/browser_patches/winldd/archive.sh b/browser_patches/winldd/archive.sh
index ad086375a1..062dc9186c 100755
--- a/browser_patches/winldd/archive.sh
+++ b/browser_patches/winldd/archive.sh
@@ -10,7 +10,7 @@ if [[ ("$1" == "-h") || ("$1" == "--help") ]]; then
exit 0
fi
-if [[ "$(uname)" != MINGW* ]]; then
+if [[ "$(uname)" != MINGW* || "$(uname)" == MSYS* ]]; then
echo "ERROR: this script only supports MINGW (windows)"
exit 1
fi
diff --git a/browser_patches/winldd/build.sh b/browser_patches/winldd/build.sh
index 7eb65d261b..5f02e935a0 100755
--- a/browser_patches/winldd/build.sh
+++ b/browser_patches/winldd/build.sh
@@ -5,7 +5,7 @@ set +x
trap "cd $(pwd -P)" EXIT
cd "$(dirname $0)"
-if [[ "$(uname)" == MINGW* ]]; then
+if [[ "$(uname)" == MINGW* || "$(uname)" == MSYS* ]]; then
/c/Windows/System32/cmd.exe "/c buildwin.bat"
else
echo "ERROR: cannot upload on this platform!" 1>&2