Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
browser(webkit): copy MS VC++ redistributable libs from VS installation (#4360)
Yury Semikhatsky040f9b04ca1d
diff --git a/browser_patches/buildbots/README.md b/browser_patches/buildbots/README.mdindex efaef5c9e2..24bdf77117 100644--- a/browser_patches/buildbots/README.md+++ b/browser_patches/buildbots/README.md@@ -120,19 +120,6 @@ The `core.longpaths` is needed for webkit since it has some very long layout patRun `c:\mozilla-build\start-shell.bat` and checkout Playwright repo to `/c/playwright`.-### 7. Create a c:\WEBKIT_WIN64_LIBS\ directory with win64 dlls---Create a new `c:\WEBKIT_WIN64_LIBS` folder and copy the following libraries from `C:\Windows\System32` into it:-- `msvcp140.dll`-- `msvcp140_2.dll`-- `vcruntime140.dll`-- `vcruntime140_1.dll`--> **NOTE**: these libraries are expected by `//browser_patches/webkit/archive.sh`.--This is necessary since mingw is a 32-bit application and cannot access the `C:\Windows\System32` folder due to [Windows FileSystem Redirector](https://docs.microsoft.com/en-us/windows/win32/winprog64/file-system-redirector?redirectedfrom=MSDN). ([StackOverflow question](https://stackoverflow.com/questions/18982551/is-mingw-caching-windows-directory-contents))-## Running Build Loop1. Launch `c:\mozilla-build/start-shell.bat`diff --git a/browser_patches/firefox/build.sh b/browser_patches/firefox/build.shindex e06e112014..936372b8a2 100755--- a/browser_patches/firefox/build.sh+++ b/browser_patches/firefox/build.sh@@ -26,19 +26,19 @@ elif [[ "$(uname)" == "Linux" ]]; thenecho "-- building on Linux"echo "ac_add_options --disable-av1" > .mozconfigelif [[ "$(uname)" == MINGW* ]]; then- TMPFILE=$(mktemp)+ DLL_FILE=""if [[ $1 == "--win64" ]]; thenecho "-- building win64 build on MINGW"echo "ac_add_options --target=x86_64-pc-mingw32" > .mozconfigecho "ac_add_options --host=x86_64-pc-mingw32" >> .mozconfig- "$PROGRAMFILES\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find '**\Redist\MSVC\*\x64\**\vcruntime140.dll' > $TMPFILE+ DLL_FILE=$("$PROGRAMFILES\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find '**\Redist\MSVC\*\x64\**\vcruntime140.dll')elseecho "-- building win32 build on MINGW"- "$PROGRAMFILES\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find '**\Redist\MSVC\*\x86\**\vcruntime140.dll' > $TMPFILE+ DLL_FILE=$("$PROGRAMFILES\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find '**\Redist\MSVC\*\x86\**\vcruntime140.dll')fi- WIN32_REDIST_DIR=$(dirname "$(cat $TMPFILE)")+ WIN32_REDIST_DIR=$(dirname "$DLL_FILE")if ! [[ -d $WIN32_REDIST_DIR ]]; then- echo "Error: cannot find MS VS C++ redistributable $WIN32_REDIST_DIR"+ echo "ERROR: cannot find MS VS C++ redistributable $WIN32_REDIST_DIR"exit 1;fiecho "export WIN32_REDIST_DIR=\"$WIN32_REDIST_DIR\"" >> .mozconfigdiff --git a/browser_patches/webkit/archive.sh b/browser_patches/webkit/archive.shindex 96f3fbc933..cd63905789 100755--- a/browser_patches/webkit/archive.sh+++ b/browser_patches/webkit/archive.sh@@ -71,6 +71,17 @@ 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=$("$PROGRAMFILES\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 fileslocal tmpdir="/tmp/webkit-deploy-$(date +%s)"@@ -82,7 +93,7 @@ createZipForWindows() {cp -t $tmpdir JavaScriptCore.dll PlaywrightLib.dll WTF.dll WebKit2.dll libEGL.dll libGLESv2.dllcp -t $tmpdir Playwright.exe WebKitNetworkProcess.exe WebKitWebProcess.execd -- cd /c/WEBKIT_WIN64_LIBS+ cd "$(printMSVCRedistDir)"cp -t $tmpdir msvcp140.dll vcruntime140.dll vcruntime140_1.dll msvcp140_2.dllcd -