diff options
author | Richard Lau <rlau@redhat.com> | 2021-06-08 16:20:31 +0300 |
---|---|---|
committer | gengjiawen <technicalcute@gmail.com> | 2021-06-09 15:43:23 +0300 |
commit | ff09d6de166bf5ea85e3decb723ab3915662e719 (patch) | |
tree | 330680a1f59dc202c891faad8493ae9fbaee0c96 /Makefile | |
parent | 9d15c1468cd086ef003aaed74115c879959fa15a (diff) |
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.
PR-URL: https://github.com/nodejs/node/pull/38969
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -36,6 +36,11 @@ V8_TEST_OPTIONS = $(V8_EXTRA_TEST_OPTIONS) ifdef DISABLE_V8_I18N V8_BUILD_OPTIONS += i18nsupport=off endif +# V8 build and test toolchains are not currently compatible with Python 3. +# config.mk may have prepended a symlink for `python` to PATH which we need +# to undo before calling V8's tools. +OVERRIDE_BIN_DIR=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))out/tools/bin +NO_BIN_OVERRIDE_PATH=$(subst $() $(),:,$(filter-out $(OVERRIDE_BIN_DIR),$(subst :, ,$(PATH)))) ifeq ($(OSTYPE), darwin) GCOV = xcrun llvm-cov gcov @@ -274,7 +279,8 @@ endif # Rebuilds deps/v8 as a git tree, pulls its third-party dependencies, and # builds it. v8: - tools/make-v8.sh $(V8_ARCH).$(BUILDTYPE_LOWER) $(V8_BUILD_OPTIONS) + export PATH="$(NO_BIN_OVERRIDE_PATH)" && \ + tools/make-v8.sh $(V8_ARCH).$(BUILDTYPE_LOWER) $(V8_BUILD_OPTIONS) .PHONY: jstest jstest: build-addons build-js-native-api-tests build-node-api-tests ## Runs addon tests and JS tests @@ -651,19 +657,22 @@ test-with-async-hooks: ifneq ("","$(wildcard deps/v8/tools/run-tests.py)") # Related CI job: node-test-commit-v8-linux test-v8: v8 ## Runs the V8 test suite on deps/v8. - deps/v8/tools/run-tests.py --gn --arch=$(V8_ARCH) $(V8_TEST_OPTIONS) \ + export PATH="$(NO_BIN_OVERRIDE_PATH)" && \ + deps/v8/tools/run-tests.py --gn --arch=$(V8_ARCH) $(V8_TEST_OPTIONS) \ mjsunit cctest debugger inspector message preparser \ $(TAP_V8) $(info Testing hash seed) $(MAKE) test-hash-seed test-v8-intl: v8 - deps/v8/tools/run-tests.py --gn --arch=$(V8_ARCH) \ + export PATH="$(NO_BIN_OVERRIDE_PATH)" && \ + deps/v8/tools/run-tests.py --gn --arch=$(V8_ARCH) \ --mode=$(BUILDTYPE_LOWER) intl \ $(TAP_V8_INTL) test-v8-benchmarks: v8 - deps/v8/tools/run-tests.py --gn --arch=$(V8_ARCH) --mode=$(BUILDTYPE_LOWER) \ + export PATH="$(NO_BIN_OVERRIDE_PATH)" && \ + deps/v8/tools/run-tests.py --gn --arch=$(V8_ARCH) --mode=$(BUILDTYPE_LOWER) \ benchmarks \ $(TAP_V8_BENCHMARKS) |