| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6d04cc6 commit 4268fae
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,7 +19,7 @@ file a new issue. | |||
| 19 | 19 | * [OpenSSL asm support](#openssl-asm-support) | |
| 20 | 20 | * [Previous versions of this document](#previous-versions-of-this-document) | |
| 21 | 21 | * [Building Node.js on supported platforms](#building-nodejs-on-supported-platforms) | |
| 22 | - * [Note about Python 2 and Python 3](#note-about-python-2-and-python-3) | ||
| 22 | + * [Note about Python](#note-about-python) | ||
| 23 | 23 | * [Unix and macOS](#unix-and-macos) | |
| 24 | 24 | * [Unix prerequisites](#unix-prerequisites) | |
| 25 | 25 | * [macOS prerequisites](#macos-prerequisites) | |
@@ -225,29 +225,23 @@ Consult previous versions of this document for older versions of Node.js: | |||
| 225 | 225 | ||
| 226 | 226 | ## Building Node.js on supported platforms | |
| 227 | 227 | ||
| 228 | - ### Note about Python 2 and Python 3 | ||
| 229 | - | ||
| 230 | - The Node.js project supports both Python 3 and Python 2 for building. | ||
| 231 | - If both are installed Python 3 will be used. If only Python 2 is available | ||
| 232 | - it will be used instead. When possible we recommend that you build and | ||
| 233 | - test with Python 3. | ||
| 228 | + ### Note about Python | ||
| 234 | 229 | ||
| 230 | + The Node.js project supports Python >= 3 for building and testing. | ||
| 235 | 231 | ### Unix and macOS | |
| 236 | 232 | ||
| 237 | 233 | #### Unix prerequisites | |
| 238 | 234 | ||
| 239 | 235 | * `gcc` and `g++` >= 8.3 or newer, or | |
| 240 | 236 | * GNU Make 3.81 or newer | |
| 241 | - * Python (see note above) | ||
| 242 | - * Python 2.7 | ||
| 243 | - * Python 3.5, 3.6, 3.7, and 3.8 | ||
| 237 | + * Python 3.6, 3.7, 3.8, and 3.9 (see note above) | ||
| 244 | 238 | ||
| 245 | 239 | Installation via Linux package manager can be achieved with: | |
| 246 | 240 | ||
| 247 | - * Ubuntu, Debian: `sudo apt-get install python g++ make` | ||
| 248 | - * Fedora: `sudo dnf install python gcc-c++ make` | ||
| 249 | - * CentOS and RHEL: `sudo yum install python gcc-c++ make` | ||
| 250 | - * OpenSUSE: `sudo zypper install python gcc-c++ make` | ||
| 241 | + * Ubuntu, Debian: `sudo apt-get install python3 g++ make` | ||
| 242 | + * Fedora: `sudo dnf install python3 gcc-c++ make` | ||
| 243 | + * CentOS and RHEL: `sudo yum install python3 gcc-c++ make` | ||
| 244 | + * OpenSUSE: `sudo zypper install python3 gcc-c++ make` | ||
| 251 | 245 | * Arch Linux, Manjaro: `sudo pacman -S python gcc make` | |
| 252 | 246 | ||
| 253 | 247 | FreeBSD and OpenBSD users may also need to install `libexecinfo`. | |
@@ -256,10 +250,8 @@ Python 3 users may also need to install `python3-distutils`. | |||
| 256 | 250 | ||
| 257 | 251 | #### macOS prerequisites | |
| 258 | 252 | ||
| 259 | - * Xcode Command Line Tools >= 11 for macOS | ||
| 260 | - * Python (see note above) | ||
| 261 | - * Python 2.7 | ||
| 262 | - * Python 3.5, 3.6, 3.7, and 3.8 | ||
| 253 | + * Xcode Command Line Tools >= 10 for macOS | ||
| 254 | + * Python 3.6, 3.7, 3.8, and 3.9 (see note above) | ||
| 263 | 255 | ||
| 264 | 256 | macOS users can install the `Xcode Command Line Tools` by running | |
| 265 | 257 | `xcode-select --install`. Alternatively, if you already have the full Xcode | |
@@ -568,7 +560,7 @@ to run it again before invoking `make -j4`. | |||
| 568 | 560 | ||
| 569 | 561 | ##### Option 1: Manual install | |
| 570 | 562 | ||
| 571 | - * [Python 3.8](https://www.python.org/downloads/) | ||
| 563 | + * [Python 3.9](https://www.microsoft.com/en-us/p/python-39/9p7qfqmjrfp7) | ||
| 572 | 564 | * The "Desktop development with C++" workload from | |
| 573 | 565 | [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/) or | |
| 574 | 566 | the "Visual C++ build tools" workload from the | |
@@ -606,8 +598,7 @@ packages: | |||
| 606 | 598 | ||
| 607 | 599 | * [Git for Windows](https://chocolatey.org/packages/git) with the `git` and | |
| 608 | 600 | Unix tools added to the `PATH` | |
| 609 | - * [Python 3.x](https://chocolatey.org/packages/python) and | ||
| 610 | - [legacy Python](https://chocolatey.org/packages/python2) | ||
| 601 | + * [Python 3.x](https://chocolatey.org/packages/python) | ||
| 611 | 602 | * [Visual Studio 2019 Build Tools](https://chocolatey.org/packages/visualstudio2019buildtools) | |
| 612 | 603 | with [Visual C++ workload](https://chocolatey.org/packages/visualstudio2019-workload-vctools) | |
| 613 | 604 | * [NetWide Assembler](https://chocolatey.org/packages/nasm) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,17 +1,14 @@ | |||
| 1 | 1 | #!/bin/sh | |
| 2 | 2 | ||
| 3 | - # Locate an acceptable python interpreter and then re-execute the script. | ||
| 3 | + # Locate an acceptable Python interpreter and then re-execute the script. | ||
| 4 | 4 | # Note that the mix of single and double quotes is intentional, | |
| 5 | 5 | # as is the fact that the ] goes on a new line. | |
| 6 | 6 | _=[ 'exec' '/bin/sh' '-c' ''' | |
| 7 | - test ${FORCE_PYTHON2} && exec python2 "$0" "$@" # workaround for gclient | ||
| 8 | 7 | command -v python3.9 >/dev/null && exec python3.9 "$0" "$@" | |
| 9 | 8 | command -v python3.8 >/dev/null && exec python3.8 "$0" "$@" | |
| 10 | 9 | command -v python3.7 >/dev/null && exec python3.7 "$0" "$@" | |
| 11 | 10 | command -v python3.6 >/dev/null && exec python3.6 "$0" "$@" | |
| 12 | - command -v python3.5 >/dev/null && exec python3.5 "$0" "$@" | ||
| 13 | 11 | command -v python3 >/dev/null && exec python3 "$0" "$@" | |
| 14 | - command -v python2.7 >/dev/null && exec python2.7 "$0" "$@" | ||
| 15 | 12 | exec python "$0" "$@" | |
| 16 | 13 | ''' "$0" "$@" | |
| 17 | 14 | ] | |
@@ -20,16 +17,15 @@ del _ | |||
| 20 | 17 | import sys | |
| 21 | 18 | from distutils.spawn import find_executable | |
| 22 | 19 | ||
| 23 | - print('Node.js configure: Found Python {0}.{1}.{2}...'.format(*sys.version_info)) | ||
| 24 | - acceptable_pythons = ((3, 9), (3, 8), (3, 7), (3, 6), (3, 5), (2, 7)) | ||
| 20 | + print('Node.js configure: Found Python {}.{}.{}...'.format(*sys.version_info)) | ||
| 21 | + acceptable_pythons = ((3, 9), (3, 8), (3, 7), (3, 6)) | ||
| 25 | 22 | if sys.version_info[:2] in acceptable_pythons: | |
| 26 | 23 | import configure | |
| 27 | 24 | else: | |
| 28 | - python_cmds = ['python{0}.{1}'.format(*vers) for vers in acceptable_pythons] | ||
| 29 | - sys.stderr.write('Please use {0}.\n'.format(' or '.join(python_cmds))) | ||
| 25 | + python_cmds = ['python{}.{}'.format(*vers) for vers in acceptable_pythons] | ||
| 26 | + sys.stderr.write('Please use {}.\n'.format(' or '.join(python_cmds))) | ||
| 30 | 27 | for python_cmd in python_cmds: | |
| 31 | 28 | python_cmd_path = find_executable(python_cmd) | |
| 32 | 29 | if python_cmd_path and 'pyenv/shims' not in python_cmd_path: | |
| 33 | - sys.stderr.write('\t{0} {1}\n'.format(python_cmd_path, | ||
| 34 | - ' '.join(sys.argv[:1]))) | ||
| 30 | + sys.stderr.write('\t{} {}\n'.format(python_cmd_path, ' '.join(sys.argv[:1]))) | ||
| 35 | 31 | sys.exit(1) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1827,7 +1827,7 @@ def make_bin_override(): | |||
| 1827 | 1827 | if sys.platform == 'win32': | |
| 1828 | 1828 | raise Exception('make_bin_override should not be called on win32.') | |
| 1829 | 1829 | # If the system python is not the python we are running (which should be | |
| 1830 | - # python 2), then create a directory with a symlink called `python` to our | ||
| 1830 | + # python 3), then create a directory with a symlink called `python` to our | ||
| 1831 | 1831 | # sys.executable. This directory will be prefixed to the PATH, so that | |
| 1832 | 1832 | # other tools that shell out to `python` will use the appropriate python | |
| 1833 | 1833 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,7 @@ On how to build the Node.js core, see [Building Node.js](../../BUILDING.md). | |||
| 8 | 8 | ||
| 9 | 9 | There are three main build files that may be directly run when building Node.js: | |
| 10 | 10 | ||
| 11 | - * `configure`: A Python 2 script that detects system capabilities and runs | ||
| 11 | + * `configure`: A Python script that detects system capabilities and runs | ||
| 12 | 12 | [GYP][]. It generates `config.gypi` which includes parameters used by GYP to | |
| 13 | 13 | create platform-dependent build files. Its output is usually in one of these | |
| 14 | 14 | formats: Makefile, MSbuild, ninja, or XCode project files (the main | |
| Back | FazBrowse Home | New Git URL |
0 commit comments