How to setup LLVM buildbots for Windows 11 on Arm

Install Visual Studio 2022

Install visual studio 2022 community edition from here. Following visual studio C/C++ package configuration is required by LLVM CI. Save the configuration given below in a file on your windows machine and import using Visual Studio 2022 installer. We will only install minimum of required packages so make sure not to install any extra packages eg: CMake, Sanitizers, Ninja etc from visual studio installer.

{ "version": "1.0", "components": [ "Microsoft.VisualStudio.Component.CoreEditor", "Microsoft.VisualStudio.Workload.CoreEditor", "Microsoft.VisualStudio.Component.Roslyn.Compiler", "Microsoft.Component.MSBuild", "Microsoft.VisualStudio.Component.TextTemplating", "Microsoft.VisualStudio.Component.VC.CoreIde", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", "Microsoft.VisualStudio.Component.VC.ATL", "Microsoft.VisualStudio.Component.VC.Redist.14.Latest", "Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core", "Microsoft.VisualStudio.Component.Windows10SDK.19041", "Microsoft.VisualStudio.Component.VC.Tools.ARM64", "Microsoft.VisualStudio.Component.VC.Tools.ARM", "Microsoft.VisualStudio.Workload.NativeDesktop", "Microsoft.VisualStudio.Component.VC.ATL.ARM", "Microsoft.VisualStudio.Component.VC.ATL.ARM64" ] }

Install Scoop package manager

Scoop is command-line installer for Windows that provides latest x64/windows packages required by LLVM CI. Install Scoop by following instructions below:

Open a PowerShell terminal (version 5.1 or later) and run following commands to install Scoop:

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser # Optional: Needed to run a remote script the first time irm get.scoop.sh | iex

Install following x64/Windows packages via scoop:

scoop install 7zip make git swig ccache llvm@18.1.8 cmake ninja python@3.11.9 perl

LLVM's upstream CI depends on Git and also needs a few unix-style utilities like rm, grep, diff etc from MSYSs installation shipped with Git installer.

After scoop finishes git installation, MSYS2 directory found at โ€œC:\Users\%USERNAME%\scoop\apps\git\current\usr\bin" should be manually added to PATH

Close and re-open command prompt for adding Git configuration to C:\Users\โ€USERNAME%\.gitconfig file.

Increase ccache cache size to 20GB

Following installation steps have been deprecated in favour of Scoop install updated above.

Install Python 11 (Arm64) latest release

Python 3.11 for Windows on Arm is now listed as a supported platform and an Arm64 installer is now available at Python Releases for Windows. We recommend installing latest python 3.11.1 on Windows on Arm64 LLVM CI machine. Make sure to select Add python.exe to the PATH installer setting.

Install LLVM WoA latest release

We should use latest LLVM release on all Windows on Arm64 machines running LLVM CI. Go to Releases ยท llvm/llvm-project and download the latest Windows on Arm (โ€œwoa64โ€) installer. Run the installer and install LLVM with default settings. Make sure to check Add LLVM to the PATH installer setting.

Install CMake for Windows Arm64 native

CMake for Windows on Arm64 native now is officially released by Kitware and as of this writing version 3.25.1 installer can be downloaded from Download CMake. Run the CMake Arm64 installer and make sure to check Add CMake to the PATH installer setting.

Download and build Ninja from source

LLVM CI requires Ninja build system tool. We should build Ninja from source (GitHub - ninja-build/ninja: a small build system with a focus on speed ) using the cmake build method.

Add Ninja build directory โ€œC:\Users\tcwg\tools\ninja-1.11.1\build\Release" to PATH

Install buildbot-worker and its dependencies

Open cmd terminal and install buildbot-worker and its dependencies. buildbot worker version: 3.4.1 and Twisted version: 22.4.0 are known to work with Arm64 native python release. Additionally install pywin32 and psutils packages.

Remove path length limit

In most cases Windows has set a maximum length for a file/directory path to a maximum value of 260 characters (Reference). This limitation can be removed by setting following registry key to 1:

Create buildbot worker

Open the command prompt and runย 

Create/Update C:\Users\%USERNAME%\llvm-worker\info\admin file with contents given below:

Create/Update C:\Users\%USERNAME%\llvm-worker\info\host file with contents given below:

Buildbot startup script

Createย C:\Users\%USERNAME%\llvm-worker\start-llvm-worker.cmd with contents given below:

Create a Windows service for buildbot

Apparently, normal Windows applications and scripts are stopped when a user logs out or the laptop gets to lock screen.ย  To avoid buildbot stopping we need to create a Windows service for it, which will run in the background.ย 

Fire up the buildbot!

Using Services app.

Stop/restart buildbot

To stop buildbot open "Services" app, scroll down to "RunasRob" and stop it.ย  Then open "Task Manager" and in "Details" tab find and kill "python.exe" process.ย  You can also kill "ninja.exe" and other related processes to avoid waiting for them to finish/fail.

To restart the buildbot restart "RunasRob" service.