Dependencies

The Window.js dependencies are listed in .gclient and get fetched by the gclient tool, which also fetches the skia and v8 dependencies.

The main dependencies are listed at the top, in the vars object:

The commit hash for each one is the version that gets checked out.

The ANGLE, Skia and v8 dependencies are copied manually to .gclient, for a couple of reasons: it’s easier to skip unnecessary (and large) dependencies, and gclient --no-history makes smaller checkouts this way.

Reused dependencies from v8 and Skia

Some of the v8 and Skia dependencies are also used by Window.js and its build directly:

  • libraries/v8/third_party/llvm-build is an LLVM and clang installation that is used on the Windows build.

  • libraries/v8/third_party/zlib is used for compression support.

Hooks

The hooks listed at the bottom of .gclient run after each sync.

They apply custom patches to the libraries, mainly to make them build for Window.js.

  • libraries/v8.patch: fixes the build with clang.
  • libraries/v8_build.patch: fixes the build with clang.
  • libraries/v8_build.py: removes a stale file.
  • libraries/glfw.patch:
    • draw during resizes on Windows #1426
    • fix threading issue on Linux #2033
    • link EGL statically
  • libraries/angle.patch: build ANGLE statically.
  • libraries/skia.patch: link EGL statically.

Updating v8

  • Revert the v8 patches:
    $ cd libraries/v8
    $ git checkout HEAD .
    $ cd build
    $ git checkout HEAD .
    
  • Comment out the hooks that patch v8.
  • Update the v8_commit version.
  • Sync gclient:
    $ gclient sync --shallow --no-history -D -R
    
  • Apply the v8 patches manually, and update them if needed.
  • Verify that v8 builds, and fix as needed:
    $ libraries/build_v8.sh
    
  • Update the v8 patches with any changes:
    $ git diff --patch --color=never HEAD --output ../v8.patch
    $ cd build
    $ git diff --patch --color=never HEAD --output ../../v8_build.patch
    
  • Restore the hooks and verify that gclient sync applies the patches correctly:
    $ gclient sync --shallow --no-history -D -R
    
  • Verify that v8 builds:
    $ libraries/build_v8.sh
    
  • Verify that Window.js builds and run the tests.

Updating Skia

  • Update the skia commit in .gclient
  • Sync gclient:
    $ gclient sync --shallow --no-history -D -R
    
  • Update the skia deps from libraries/skia/DEPS to skia_deps in .gclient
  • Sync gclient again
  • Build skia:
    $ libraries/build_skia.sh
    
  • Verify that Window.js builds and run the tests.