Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: remove dependency on distutils.spawn #38600

Merged
merged 1 commit into from
May 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,6 @@ Installation via Linux package manager can be achieved with:

FreeBSD and OpenBSD users may also need to install `libexecinfo`.

Python 3 users may also need to install `python3-distutils`.

#### macOS prerequisites

* Xcode Command Line Tools >= 11 for macOS
Expand All @@ -271,11 +269,6 @@ $ ./configure
$ make -j4
```

If you run into a `No module named 'distutils.spawn'` error when executing
`./configure`, please try `python3 -m pip install --upgrade setuptools` or
`sudo apt install python3-distutils -y`.
For more information, see <https://github.com/nodejs/node/issues/30189>.

The `-j4` option will cause `make` to run 4 simultaneous compilation jobs which
may reduce build time. For more information, see the
[GNU Make Documentation](https://www.gnu.org/software/make/manual/html_node/Parallel.html).
Expand Down
7 changes: 5 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ exec python "$0" "$@"
del _

import sys
from distutils.spawn import find_executable
try:
from shutil import which
except ImportError:
from distutils.spawn import find_executable as which

print('Node.js configure: Found Python {}.{}.{}...'.format(*sys.version_info))
acceptable_pythons = ((3, 9), (3, 8), (3, 7), (3, 6))
Expand All @@ -25,7 +28,7 @@ else:
python_cmds = ['python{}.{}'.format(*vers) for vers in acceptable_pythons]
sys.stderr.write('Please use {}.\n'.format(' or '.join(python_cmds)))
for python_cmd in python_cmds:
python_cmd_path = find_executable(python_cmd)
python_cmd_path = which(python_cmd)
if python_cmd_path and 'pyenv/shims' not in python_cmd_path:
sys.stderr.write('\t{} {}\n'.format(python_cmd_path, ' '.join(sys.argv[:1])))
sys.exit(1)
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import bz2
import io

from distutils.spawn import find_executable as which
from shutil import which
from distutils.version import StrictVersion

# If not run from node/, cd to node/.
Expand Down