mirror of
https://github.com/nodejs/node.git
synced 2025-04-29 22:40:57 +00:00
build: fix build with Python 3.12
Replace `distutils.version.StrictVersion` with `packaging.version.Version`. Refs: https://github.com/nodejs/node/pull/50209#issuecomment-1795852539 PR-URL: https://github.com/nodejs/node/pull/50582 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This commit is contained in:
parent
3e3467e77a
commit
95534ad82f
11
configure.py
11
configure.py
@ -14,8 +14,6 @@ import bz2
|
|||||||
import io
|
import io
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from distutils.version import StrictVersion
|
|
||||||
|
|
||||||
# If not run from node/, cd to node/.
|
# If not run from node/, cd to node/.
|
||||||
os.chdir(Path(__file__).parent)
|
os.chdir(Path(__file__).parent)
|
||||||
|
|
||||||
@ -30,6 +28,7 @@ tools_path = Path('tools')
|
|||||||
|
|
||||||
sys.path.insert(0, str(tools_path / 'gyp' / 'pylib'))
|
sys.path.insert(0, str(tools_path / 'gyp' / 'pylib'))
|
||||||
from gyp.common import GetFlavor
|
from gyp.common import GetFlavor
|
||||||
|
from packaging.version import Version
|
||||||
|
|
||||||
# imports in tools/configure.d
|
# imports in tools/configure.d
|
||||||
sys.path.insert(0, str(tools_path / 'configure.d'))
|
sys.path.insert(0, str(tools_path / 'configure.d'))
|
||||||
@ -1566,10 +1565,10 @@ def configure_openssl(o):
|
|||||||
# supported asm compiler for AVX2. See https://github.com/openssl/openssl/
|
# supported asm compiler for AVX2. See https://github.com/openssl/openssl/
|
||||||
# blob/OpenSSL_1_1_0-stable/crypto/modes/asm/aesni-gcm-x86_64.pl#L52-L69
|
# blob/OpenSSL_1_1_0-stable/crypto/modes/asm/aesni-gcm-x86_64.pl#L52-L69
|
||||||
openssl110_asm_supported = \
|
openssl110_asm_supported = \
|
||||||
('gas_version' in variables and StrictVersion(variables['gas_version']) >= StrictVersion('2.23')) or \
|
('gas_version' in variables and Version(variables['gas_version']) >= Version('2.23')) or \
|
||||||
('xcode_version' in variables and StrictVersion(variables['xcode_version']) >= StrictVersion('5.0')) or \
|
('xcode_version' in variables and Version(variables['xcode_version']) >= Version('5.0')) or \
|
||||||
('llvm_version' in variables and StrictVersion(variables['llvm_version']) >= StrictVersion('3.3')) or \
|
('llvm_version' in variables and Version(variables['llvm_version']) >= Version('3.3')) or \
|
||||||
('nasm_version' in variables and StrictVersion(variables['nasm_version']) >= StrictVersion('2.10'))
|
('nasm_version' in variables and Version(variables['nasm_version']) >= Version('2.10'))
|
||||||
|
|
||||||
if is_x86 and not openssl110_asm_supported:
|
if is_x86 and not openssl110_asm_supported:
|
||||||
error('''Did not find a new enough assembler, install one or build with
|
error('''Did not find a new enough assembler, install one or build with
|
||||||
|
Loading…
Reference in New Issue
Block a user