Skip to content

build: don't pass python override to V8 build

If the configure.py script is executed by a Python binary that is not the one on the PATH it will create a python symlink in out/tools/bin and prefix that to the PATH so it is used instead of the one that otherwise would have been found on the PATH. This is done so that gyp scripts shelling out to python execute with the same version of Python as used to run the configure script.

V8's build uses V8's build toolchain (i.e. not gyp) and currently that is incompatible with Python 3. Prevent prefixing the PATH for the V8 build so that it picks up python from the unprefixed PATH. This will allow us to build Node.js with Python 3 but still use Python 2 to build V8 in the CI.

Refs: https://github.com/nodejs/node/issues/38791#issuecomment-846943016

If we land this I need to undo the change in https://github.com/nodejs/node/pull/36691#issuecomment-821075838 to force configure to run with Python 2 to allow Node.js' to autodetect Python 3 again (and this PR should allow V8 to then build with python pointing to Python 2).

cc @targos @nodejs/v8-update

Merge request reports

Loading