browser(webkit): copy MS VC++ redistributable libs from VS installation (#4360)

This commit is contained in:
Yury Semikhatsky 2020-11-05 16:51:42 -08:00 committed by GitHub
parent 5faf6f9e69
commit 040f9b04ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 19 deletions

View file

@ -120,19 +120,6 @@ The `core.longpaths` is needed for webkit since it has some very long layout pat
Run `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 Loop
1. Launch `c:\mozilla-build/start-shell.bat`

View file

@ -26,19 +26,19 @@ elif [[ "$(uname)" == "Linux" ]]; then
echo "-- building on Linux"
echo "ac_add_options --disable-av1" > .mozconfig
elif [[ "$(uname)" == MINGW* ]]; then
TMPFILE=$(mktemp)
DLL_FILE=""
if [[ $1 == "--win64" ]]; then
echo "-- building win64 build on MINGW"
echo "ac_add_options --target=x86_64-pc-mingw32" > .mozconfig
echo "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')
else
echo "-- 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;
fi
echo "export WIN32_REDIST_DIR=\"$WIN32_REDIST_DIR\"" >> .mozconfig

View file

@ -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 files
local 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.dll
cp -t $tmpdir Playwright.exe WebKitNetworkProcess.exe WebKitWebProcess.exe
cd -
cd /c/WEBKIT_WIN64_LIBS
cd "$(printMSVCRedistDir)"
cp -t $tmpdir msvcp140.dll vcruntime140.dll vcruntime140_1.dll msvcp140_2.dll
cd -