Skip to content

Building ANGLE for UWP

Philip Lamb edited this page Jul 23, 2021 · 13 revisions

Servo for Unity on Windows UWP reuses Servo's custom-compiled NuGet ANGLE package. Thus, moving Servo for Unity to a new ANGLE version requires us to update the ANGLE package used by Servo itself. The package is a recent core ANGLE version with some patches (to enable mutexes on D3D11 surfaces).

  1. To update, first determine which version of ANGLE you want to update to. (Instructions at https://chromium.googlesource.com/angle/angle/+/HEAD/doc/ChoosingANGLEBranch.md recommend using OmahaProxy tool http://omahaproxy.appspot.com/ to find the Chromium version for a beta or stable release, and then find that branch in the ANGLE repo).
  2. Check out this branch from the core repo https://github.com/google/angle.git (e.g. chromium/nnnn where nnnn is the version number).
  3. Add https://github.com/servo/ms-angle/ as a remote, and check out the most recent branch servo-master-yyyy-mm-dd.
  4. Add a new branch servo-master-yyyy-mm-dd with the current date and the previous one as root.
  5. Rebase this branch onto the chosen Chromium base branch (checked out in step 2), resolving any conflicts as the rebase proceeds.
  6. Follow the instructions at https://chromium.googlesource.com/angle/angle/+/refs/heads/main/doc/DevSetup.md to set up Google's toolchain (gclient, ninja, etc).
  7. python scripts\bootstap.py -> creates .gclient.
  8. gclient sync
  9. gn args out\Release-x64 (can be prefixed with gn clean out\Release-x64 if rebuilding after a previous build).
target_os = "winuwp"
target_cpu = "x64"
is_component_build = false
is_clang = false
is_debug = false

10 gn args out\Release-x86

target_os = "winuwp"
target_cpu = "x86"
is_component_build = false
is_clang = false
is_debug = false
  1. gn args out\Release-arm64
target_os = "winuwp"
target_cpu = "arm64"
is_component_build = false
is_clang = false
is_debug = false
  1. gn args out\Debug-x64
target_os = "winuwp"
target_cpu = "x64"
is_component_build = false
is_clang = false
is_debug = true
  1. gn args out\Debug-x86
target_os = "winuwp"
target_cpu = "x86"
is_component_build = false
is_clang = false
is_debug = true
  1. gn args out\Debug-arm64
target_os = "winuwp"
target_cpu = "arm64"
is_component_build = false
is_clang = false
is_debug = true
  1. Run the builds:
autoninja -C out\Release-x64
autoninja -C out\Release-x86
autoninja -C out\Release-arm64
autoninja -C out\Debug-x64
autoninja -C out\Debug-x86
autoninja -C out\Debug-arm64
  1. Update the version number in nuget\angle.nuspec to match the version number of ANGLE itself. The version number major and minor can be found in src\common\angle_version.h and the patch number is taken from the macro ANGLE_COMMIT_POSITION defined in angle_commit.h which is generated during compilation, and which can be found under the build directory at path gen\angle\angle_commit.h.
  2. Create packages. There is a copy of nuget.exe in the Servo repo, at path .servo\msvc-dependencies\nuget.exe.
nuget pack nuget\angle.nuspec -Properties Configuration=Release
nuget pack nuget\angle.nuspec -Properties Configuration=Debug -Suffix debug
  1. Test the package locally with a Servo build. To do this:
    1. Modify the file support\hololens\ServoApp\packages.config, editing the version field in the package ANGLE.WindowsStore.Servo to match the value selected in step 16.
    2. Place the package built above at some path, e.g. C:\temp_packages
    3. Create a file named NuGet.config with the contents below, and place this file into the root of Servo's directory, editing the path as necessary:
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
      <packageSources>
        <add key="local" value="C:\temp_packages\" />
      </packageSources>
    </configuration>
    
    1. Build servo for UWP.
  2. Upload the resulting packages to https://www.nuget.org/packages/manage/upload
  3. Push to a new servo-master-YYYY-MM-DD branch
Clone this wiki locally