From 975a00ab3165e8dc22bc0e1b7b6a2221d1bf956f Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Fri, 5 Nov 2021 15:28:44 -0700 Subject: [PATCH] devops: bundle vcruntime140_1.dll with Firefox builds (#10099) We'll need to bake new Firefox build and roll onto it. References #9974 --- browser_patches/firefox-beta/archive.sh | 5 +++++ browser_patches/firefox/BUILD_NUMBER | 4 ++-- browser_patches/firefox/archive.sh | 5 +++++ browser_patches/utils.sh | 11 +++++++++++ browser_patches/webkit/archive.sh | 12 +----------- 5 files changed, 24 insertions(+), 13 deletions(-) diff --git a/browser_patches/firefox-beta/archive.sh b/browser_patches/firefox-beta/archive.sh index 91efbc4269..9f4f16784c 100755 --- a/browser_patches/firefox-beta/archive.sh +++ b/browser_patches/firefox-beta/archive.sh @@ -31,6 +31,7 @@ fi trap "cd $(pwd -P)" EXIT cd "$(dirname "$0")" SCRIPT_FOLDER="$(pwd -P)" +source "${SCRIPT_FOLDER}/../utils.sh" if [[ ! -z "${FF_CHECKOUT_PATH}" ]]; then cd "${FF_CHECKOUT_PATH}" @@ -53,6 +54,10 @@ 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 + # Bundle vcruntime14_1.dll - see https://github.com/microsoft/playwright/issues/9974 + cd "$(printMSVCRedistDir)" + cp -t "${OBJ_FOLDER}/dist/firefox" vcruntime140_1.dll fi # tar resulting directory and cleanup TMP. diff --git a/browser_patches/firefox/BUILD_NUMBER b/browser_patches/firefox/BUILD_NUMBER index 0dba107e33..55030b3878 100644 --- a/browser_patches/firefox/BUILD_NUMBER +++ b/browser_patches/firefox/BUILD_NUMBER @@ -1,2 +1,2 @@ -1303 -Changed: lushnikov@chromium.org Fri Nov 5 07:27:32 HST 2021 +1304 +Changed: lushnikov@chromium.org Fri Nov 5 12:27:32 HST 2021 diff --git a/browser_patches/firefox/archive.sh b/browser_patches/firefox/archive.sh index 30055b1e7f..cab2d9dabb 100755 --- a/browser_patches/firefox/archive.sh +++ b/browser_patches/firefox/archive.sh @@ -31,6 +31,7 @@ fi trap "cd $(pwd -P)" EXIT cd "$(dirname "$0")" SCRIPT_FOLDER="$(pwd -P)" +source "${SCRIPT_FOLDER}/../utils.sh" if [[ ! -z "${FF_CHECKOUT_PATH}" ]]; then cd "${FF_CHECKOUT_PATH}" @@ -57,6 +58,10 @@ 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 + # Bundle vcruntime14_1.dll - see https://github.com/microsoft/playwright/issues/9974 + cd "$(printMSVCRedistDir)" + cp -t "${OBJ_FOLDER}/dist/firefox" vcruntime140_1.dll fi # tar resulting directory and cleanup TMP. diff --git a/browser_patches/utils.sh b/browser_patches/utils.sh index a84176d47d..a5eba2705b 100644 --- a/browser_patches/utils.sh +++ b/browser_patches/utils.sh @@ -31,3 +31,14 @@ function selectXcodeVersionOrDie() { export DEVELOPER_DIR="${XCODE_DIRECTORY}/Contents/Developer" echo "-- using ${XCODE_DIRECTORY}" } + +# see https://docs.microsoft.com/en-us/visualstudio/install/tools-for-managing-visual-studio-instances?view=vs-2019 +function printMSVCRedistDir() { + local dll_file=$("C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find '**\Redist\MSVC\*\x64\**\vcruntime140.dll') + local redist_dir=$(dirname "$dll_file") + if ! [[ -d $redist_dir ]]; then + echo "ERROR: cannot find MS VS C++ redistributable $redist_dir" + exit 1; + fi + echo "$redist_dir" +} diff --git a/browser_patches/webkit/archive.sh b/browser_patches/webkit/archive.sh index 0750f7ed11..4f84bb4336 100755 --- a/browser_patches/webkit/archive.sh +++ b/browser_patches/webkit/archive.sh @@ -76,17 +76,6 @@ createZipForLinux() { rm -rf "$tmpdir" } -# see https://docs.microsoft.com/en-us/visualstudio/install/tools-for-managing-visual-studio-instances?view=vs-2019 -printMSVCRedistDir() { - local dll_file=$("C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find '**\Redist\MSVC\*\x64\**\vcruntime140.dll') - local redist_dir=$(dirname "$dll_file") - if ! [[ -d $redist_dir ]]; then - echo "ERROR: cannot find MS VS C++ redistributable $redist_dir" - exit 1; - fi - echo "$redist_dir" -} - createZipForWindows() { # create a TMP directory to copy all necessary files local tmpdir="/tmp/webkit-deploy-$(date +%s)" @@ -142,5 +131,6 @@ createZipForMac() { trap "cd $(pwd -P)" EXIT cd "$(dirname "$0")" SCRIPTS_DIR="$(pwd -P)" +source "${SCRIPTS_DIR}/../utils.sh" main "$@"