Skip to content

build,tools: make addons tests work with GN

Rodrigo Muino Tomonari requested to merge github/fork/zcbenz/build-addons-gn into main

This PR refactors the install and build_addons scripts so they can be reused by node-ci and electron projects to build the addons tests.

In detail, this PR does following things:

  1. Minor modifications of the GN configurations to fix loading native modules.
  2. Add some flags to tools/install.py script to allow customize locations of config.gypi, v8, etc. With some refactoring to remove global variables.
  3. Rewrite the tools/build_addons.py script:
    1. Rewrite it from js to python, because implementing cmd args handling with vanilla Node.js would take much longer time than a simple rewrite.
    2. Add a few more flags to make it easier to use for embedders.
  4. Modify the Makefile to generate headers in out dir first, and then calls build_addons.py --headers-dir=out_dir/headers (which calls node-gyp --nodedir=out_dir/headers) to build addons. Previously the build system was just calling node-gyp --nodedir=., which relied on quirky behavior of node-gyp and did not really test whether the generated headers work.

Users that rely on make or vcbuild.bat to work on Node are not affected.

Merge request reports

Loading