ungoogled-chromium-windows
ungoogled-chromium-windows copied to clipboard
Setup prerequisites for build
Hi,
I spent some time figuring out the build prerequisites, and wrote a quick batch script that does that for a fresh VM or sandbox for future reference; should I submit a PR to have this in the repo or is it not interesting for most?
FWIW, this is the batch file:
REM TODO: hardcoded "c:\tools" path for python installation
@ECHO Installing Chocolatey
powershell -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
choco feature enable -n=allowGlobalConfirmation
@ECHO Installing Visual Studio (add more components for ARM64)
choco install visualstudio2019community --package-parameters "--add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.ATLMFC --includeRecommended"
@ECHO Installing Git, 7-Zip and the Debugging component of Windows SDK
choco install git 7zip windows-sdk-10-version-2004-windbg
@ECHO Installing Python 3
choco install python3 --version=3.8.10 --package-parameters "/InstallDir:C:\tools\python3"
@ECHO Google scripts expect the binary to be called "python3", creating a shim
%ALLUSERSPROFILE%\chocolatey\tools\shimgen.exe -o=C:\tools\python3\python3.exe -p=C:\tools\python3\python.exe
@ECHO Installing Python 2 (after 3 to avoid conflicts in PATH)
choco install python2 --package-parameters "/InstallDir:C:\tools\python2"
@ECHO Installing pywin32 with pip in Python 2
C:\tools\python2\python.exe -m ensurepip
C:\tools\python2\python.exe -m pip install pywin32
@ECHO Refresh environment
refreshenv
REM TODO: validate python2 comes first in %PATH% (python -V returns 2 and python3 -V returns 3)
@ECHO Remove MAX_PATH limit
powershell "New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1 -PropertyType DWORD -Force"
@ECHO DONE: prerequisites installed, build with "python3 build.py"
As random data points (if you're thinking of setting up a VM to build it), on an Azure D48ds_v4 VM (48 vcpus, 192 GiB memory), it took just shy of 2 hours to build x64 release (11 minutes for the prerequisites, 13 minutes for the bootstrapping in build.py and the rest for ninja actually compiling code).
CPU was the bottleneck as all 48 cores averaged 90%+ usage, whereas memory remained mostly constant at around 20Gb RAM. There are 51000 ninja build commands (almost all clang-cl invocations), well structured / parallelized so I suspect the more CPU cores you have, the faster the build will be.