mirror of
https://github.com/overte-org/overte.git
synced 2025-04-06 00:33:13 +02:00
Merge pull request #1329 from daleglass-overte/fix-node-build
Fix failure of Node build due to deprecated distutils
This commit is contained in:
commit
0b182b3116
5 changed files with 75 additions and 2 deletions
2
.github/workflows/master_build.yml
vendored
2
.github/workflows/master_build.yml
vendored
|
@ -47,7 +47,7 @@ jobs:
|
||||||
build_type: full
|
build_type: full
|
||||||
#- os: macOS-10.15
|
#- os: macOS-10.15
|
||||||
# build_type: full
|
# build_type: full
|
||||||
#- os: ubuntu-20.04
|
# - os: ubuntu-20.04
|
||||||
# build_type: full
|
# build_type: full
|
||||||
# apt-dependencies: mesa-common-dev libegl1 libglvnd-dev libdouble-conversion3 libpulse0 libsnappy1v5 libwebpdemux2 libwebpmux3 python3-github python3-distro
|
# apt-dependencies: mesa-common-dev libegl1 libglvnd-dev libdouble-conversion3 libpulse0 libsnappy1v5 libwebpdemux2 libwebpmux3 python3-github python3-distro
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|
3
.github/workflows/pr_build.yml
vendored
3
.github/workflows/pr_build.yml
vendored
|
@ -64,7 +64,7 @@ jobs:
|
||||||
runner: [self_hosted, type-cx52, image-x86-app-docker-ce]
|
runner: [self_hosted, type-cx52, image-x86-app-docker-ce]
|
||||||
arch: amd64
|
arch: amd64
|
||||||
build_type: full
|
build_type: full
|
||||||
# apt-dependencies: # add missing dependencies to docker image when convenient
|
apt-dependencies: python3-packaging # add missing dependencies to docker image when convenient
|
||||||
image: docker.io/overte/overte-full-build:0.1.2-ubuntu-20.04-amd64
|
image: docker.io/overte/overte-full-build:0.1.2-ubuntu-20.04-amd64
|
||||||
# Android builds are currently failing
|
# Android builds are currently failing
|
||||||
#- os: ubuntu-18.04
|
#- os: ubuntu-18.04
|
||||||
|
@ -76,6 +76,7 @@ jobs:
|
||||||
arch: aarch64
|
arch: aarch64
|
||||||
build_type: full
|
build_type: full
|
||||||
image: docker.io/overte/overte-full-build:0.1.2-ubuntu-22.04-aarch64
|
image: docker.io/overte/overte-full-build:0.1.2-ubuntu-22.04-aarch64
|
||||||
|
apt-dependencies: python3-packaging
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
runs-on: ${{matrix.runner}}
|
runs-on: ${{matrix.runner}}
|
||||||
container: ${{matrix.image}}
|
container: ${{matrix.image}}
|
||||||
|
|
|
@ -31,6 +31,7 @@ else ()
|
||||||
REF v18.20.2
|
REF v18.20.2
|
||||||
SHA512 10d3637c26274677d137f76bbb648d0e7851c994634a16c89858c3a13094a0692ea2cb9a787c6463c3001abd71dab0d83123127bc305171d097c48d21d691678
|
SHA512 10d3637c26274677d137f76bbb648d0e7851c994634a16c89858c3a13094a0692ea2cb9a787c6463c3001abd71dab0d83123127bc305171d097c48d21d691678
|
||||||
HEAD_REF v18.20.2
|
HEAD_REF v18.20.2
|
||||||
|
PATCHES replace-distutils.patch replace-distutils2.patch
|
||||||
)
|
)
|
||||||
# node cannot configure out of source, which VCPKG expects. So we copy the source to the configure directory.
|
# node cannot configure out of source, which VCPKG expects. So we copy the source to the configure directory.
|
||||||
file(COPY ${SOURCE_PATH}/ DESTINATION "${CURRENT_BUILDTREES_DIR}")
|
file(COPY ${SOURCE_PATH}/ DESTINATION "${CURRENT_BUILDTREES_DIR}")
|
||||||
|
|
50
cmake/ports/node/replace-distutils.patch
Normal file
50
cmake/ports/node/replace-distutils.patch
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
commit 95534ad82f4e33f53fd50efe633d43f8da70cba6
|
||||||
|
Author: Luigi Pinca <luigipinca@gmail.com>
|
||||||
|
Date: Wed Nov 8 21:20:53 2023 +0100
|
||||||
|
|
||||||
|
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>
|
||||||
|
|
||||||
|
diff --git a/configure.py b/configure.py
|
||||||
|
index 33671a0342..be95decd56 100755
|
||||||
|
--- a/configure.py
|
||||||
|
+++ b/configure.py
|
||||||
|
@@ -14,8 +14,6 @@ import bz2
|
||||||
|
import io
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
-from distutils.version import StrictVersion
|
||||||
|
-
|
||||||
|
# If not run from node/, cd to node/.
|
||||||
|
os.chdir(Path(__file__).parent)
|
||||||
|
|
||||||
|
@@ -30,6 +28,7 @@ tools_path = Path('tools')
|
||||||
|
|
||||||
|
sys.path.insert(0, str(tools_path / 'gyp' / 'pylib'))
|
||||||
|
from gyp.common import GetFlavor
|
||||||
|
+from packaging.version import Version
|
||||||
|
|
||||||
|
# imports in tools/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/
|
||||||
|
# blob/OpenSSL_1_1_0-stable/crypto/modes/asm/aesni-gcm-x86_64.pl#L52-L69
|
||||||
|
openssl110_asm_supported = \
|
||||||
|
- ('gas_version' in variables and StrictVersion(variables['gas_version']) >= StrictVersion('2.23')) or \
|
||||||
|
- ('xcode_version' in variables and StrictVersion(variables['xcode_version']) >= StrictVersion('5.0')) or \
|
||||||
|
- ('llvm_version' in variables and StrictVersion(variables['llvm_version']) >= StrictVersion('3.3')) or \
|
||||||
|
- ('nasm_version' in variables and StrictVersion(variables['nasm_version']) >= StrictVersion('2.10'))
|
||||||
|
+ ('gas_version' in variables and Version(variables['gas_version']) >= Version('2.23')) or \
|
||||||
|
+ ('xcode_version' in variables and Version(variables['xcode_version']) >= Version('5.0')) or \
|
||||||
|
+ ('llvm_version' in variables and Version(variables['llvm_version']) >= Version('3.3')) or \
|
||||||
|
+ ('nasm_version' in variables and Version(variables['nasm_version']) >= Version('2.10'))
|
||||||
|
|
||||||
|
if is_x86 and not openssl110_asm_supported:
|
||||||
|
error('''Did not find a new enough assembler, install one or build with
|
21
cmake/ports/node/replace-distutils2.patch
Normal file
21
cmake/ports/node/replace-distutils2.patch
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
diff -ru node/tools/gyp/pylib/gyp/input.py node.patched/tools/gyp/pylib/gyp/input.py
|
||||||
|
--- node/tools/gyp/pylib/gyp/input.py 2024-04-10 14:12:07.000000000 +0200
|
||||||
|
+++ node.patched/tools/gyp/pylib/gyp/input.py 2025-02-27 21:58:01.579193906 +0100
|
||||||
|
@@ -16,7 +16,7 @@
|
||||||
|
import sys
|
||||||
|
import threading
|
||||||
|
import traceback
|
||||||
|
-from distutils.version import StrictVersion
|
||||||
|
+from packaging.version import Version
|
||||||
|
from gyp.common import GypError
|
||||||
|
from gyp.common import OrderedSet
|
||||||
|
|
||||||
|
@@ -1190,7 +1190,7 @@
|
||||||
|
else:
|
||||||
|
ast_code = compile(cond_expr_expanded, "<string>", "eval")
|
||||||
|
cached_conditions_asts[cond_expr_expanded] = ast_code
|
||||||
|
- env = {"__builtins__": {}, "v": StrictVersion}
|
||||||
|
+ env = {"__builtins__": {}, "v": Version}
|
||||||
|
if eval(ast_code, env, variables):
|
||||||
|
return true_dict
|
||||||
|
return false_dict
|
Loading…
Reference in a new issue