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 building when there is only python3 #48462

Merged
merged 5 commits into from Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions configure.py
Expand Up @@ -2121,6 +2121,10 @@ def make_bin_override():
gyp_args = ['--no-parallel', '-Dconfiguring_node=1']
gyp_args += ['-Dbuild_type=' + config['BUILDTYPE']]

# always set 'python' variable, otherwise environments that only have python3
# will fail to run python scripts
gyp_args += ['-Dpython=' + sys.executable]

if options.use_ninja:
gyp_args += ['-f', 'ninja-' + flavor]
elif flavor == 'win' and sys.platform != 'msys':
Expand All @@ -2133,10 +2137,6 @@ def make_bin_override():
os.path.islink('./compile_commands.json') and os.unlink('./compile_commands.json')
os.symlink('./out/' + config['BUILDTYPE'] + '/compile_commands.json', './compile_commands.json')

# override the variable `python` defined in common.gypi
if bin_override is not None:
gyp_args += ['-Dpython=' + sys.executable]

# pass the leftover non-whitespace positional arguments to GYP
gyp_args += [arg for arg in args if not str.isspace(arg)]

Expand Down
2 changes: 1 addition & 1 deletion tools/v8_gypfiles/toolchain.gypi
Expand Up @@ -41,7 +41,7 @@
'has_valgrind%': 0,
'coverage%': 0,
'v8_target_arch%': '<(target_arch)',
'v8_host_byteorder%': '<!(python -c "import sys; print(sys.byteorder)")',
'v8_host_byteorder%': '<!(<(python) -c "import sys; print(sys.byteorder)")',
'force_dynamic_crt%': 0,

# Setting 'v8_can_use_vfp32dregs' to 'true' will cause V8 to use the VFP
Expand Down