build: add workaround for V8 builds

V8's build toolchain is not compatible with Python 3 and the CI job
that tests V8 needs to be run with Python 2. Add a fallback to
`find_executable` from `distutils.spawn` to allow the configure
script to run in the V8 test job.

PR-URL: https://github.com/nodejs/node/pull/38632
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Richard Lau 2021-05-11 06:03:37 -04:00
parent 16e00a15de
commit d206aa36e2
No known key found for this signature in database
GPG Key ID: C43CEC45C17AB93C

View File

@ -14,7 +14,12 @@ import shutil
import bz2
import io
from shutil import which
# Fallback to find_executable from distutils.spawn is a stopgap for
# supporting V8 builds, which do not yet support Python 3.
try:
from shutil import which
except ImportError:
from distutils.spawn import find_executable as which
from distutils.version import StrictVersion
# If not run from node/, cd to node/.