mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
build: fix version checks in gyp files
Make `distutils.version.StrictVersion` available as a helper to gyp expressions so they can do proper version checks and update the gyp files accordingly. Caveat emptor: `StrictVersion` does *not* like empty strings so this commit adds truthiness guards. The helper could deal with those but I felt it better to make it explicit. Fixes: https://github.com/nodejs/node/issues/29927 PR-URL: https://github.com/nodejs/node/pull/29931 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
1 parent
8d030131a4
commit
735ec1bf96
3 files changed
+8
-3
No files matched your search
Vendored
+2
-1
@@ -21,7 +21,8 @@
|
||||
}, 'target_arch=="arm64" and OS=="win"', {
|
||||
# VC-WIN64-ARM inherits from VC-noCE-common that has no asms.
|
||||
'includes': ['./openssl_no_asm.gypi'],
|
||||
}, 'gas_version >= "2.26" or nasm_version >= "2.11.8"', {
|
||||
}, 'gas_version and v(gas_version) >= v("2.26") or '
|
||||
'nasm_version and v(nasm_version) >= v("2.11.8")', {
|
||||
# Require AVX512IFMA supported. See
|
||||
# https://www.openssl.org/docs/man1.1.1/man3/OPENSSL_ia32cap.html
|
||||
# Currently crypto/poly1305/asm/poly1305-x86_64.pl requires AVX512IFMA.
|
||||
|
||||
Vendored
+3
-1
@@ -1036,7 +1036,9 @@
|
||||
#
|
||||
'conditions': [
|
||||
['(OS=="win" and MSVS_VERSION>="2012") or '
|
||||
'llvm_version>="3.3" or xcode_version>="5.0" or gas_version>="2.23"', {
|
||||
'llvm_version and v(llvm_version) >= v("3.3") or '
|
||||
'gas_version and v(gas_version) >= v("2.23") or '
|
||||
'xcode_version and v(xcode_version) >= v("5.0")', {
|
||||
'openssl_sources_x64_win_masm': [
|
||||
'<@(openssl_sources_asm_latest_x64_win_masm)',
|
||||
'<@(openssl_sources_common_x64_win_masm)',
|
||||
|
||||
@@ -19,6 +19,7 @@ import sys
|
||||
import threading
|
||||
import time
|
||||
import traceback
|
||||
from distutils.version import StrictVersion
|
||||
from gyp.common import GypError
|
||||
from gyp.common import OrderedSet
|
||||
|
||||
@@ -1088,7 +1089,8 @@ def EvalSingleCondition(
|
||||
else:
|
||||
ast_code = compile(cond_expr_expanded, '<string>', 'eval')
|
||||
cached_conditions_asts[cond_expr_expanded] = ast_code
|
||||
if eval(ast_code, {'__builtins__': None}, variables):
|
||||
env = {'__builtins__': None, 'v': StrictVersion}
|
||||
if eval(ast_code, env, variables):
|
||||
return true_dict
|
||||
return false_dict
|
||||
except SyntaxError as e:
|
||||
|
||||
Reference in new issue
Block a user