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: fix version checks in gyp files #29931

Closed
wants to merge 1 commit into from
Closed
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
3 changes: 2 additions & 1 deletion deps/openssl/openssl.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion deps/openssl/openssl.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -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)',
Expand Down
4 changes: 3 additions & 1 deletion tools/gyp/pylib/gyp/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import threading
import time
import traceback
from distutils.version import StrictVersion
from gyp.common import GypError
from gyp.common import OrderedSet

Expand Down Expand Up @@ -1084,7 +1085,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:
Expand Down