GeezerVison is showing github.com — build: fix building when there is only python3 · nodejs/node@cfd50f2
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: configure.py +11-4Lines changed: 11 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2120,6 +2120,17 @@ def make_bin_override(): | 2120 | 2120 | gyp_args = ['--no-parallel', '-Dconfiguring_node=1'] | 2121 | 2121 | gyp_args += ['-Dbuild_type=' + config['BUILDTYPE']] | 2122 | 2122 |
| | 2123 | +# Remove the trailing .exe from the executable name, otherwise the python.exe | | 2124 | +# would be rewrote as python_host.exe due to hack in GYP for supporting cross | | 2125 | +# compilation on Windows. | | 2126 | +# See https://github.com/nodejs/node/pull/32867 for related change. | | 2127 | +python = sys.executable | | 2128 | +if flavor == 'win' and python.lower().endswith('.exe'): | | 2129 | + python = python[:-4] | | 2130 | +# Always set 'python' variable, otherwise environments that only have python3 | | 2131 | +# will fail to run python scripts. | | 2132 | +gyp_args += ['-Dpython=' + python] | | 2133 | + | 2123 | 2134 | if options.use_ninja: | 2124 | 2135 | gyp_args += ['-f', 'ninja-' + flavor] | 2125 | 2136 | elif flavor == 'win' and sys.platform != 'msys': | @@ -2132,10 +2143,6 @@ def make_bin_override(): | 2132 | 2143 | os.path.islink('./compile_commands.json') and os.unlink('./compile_commands.json') | 2133 | 2144 | os.symlink('./out/' + config['BUILDTYPE'] + '/compile_commands.json', './compile_commands.json') | 2134 | 2145 |
| 2135 | | -# override the variable `python` defined in common.gypi | 2136 | | -if bin_override is not None: | 2137 | | - gyp_args += ['-Dpython=' + sys.executable] | 2138 | | - | 2139 | 2146 | # pass the leftover non-whitespace positional arguments to GYP | 2140 | 2147 | gyp_args += [arg for arg in args if not str.isspace(arg)] | 2141 | 2148 |
| |
Collapse file Copy file name to clipboardExpand all lines: node.gyp +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 754 | 754 | '<(fipsmodule)', | 755 | 755 | ], | 756 | 756 | 'action': [ | 757 | | - 'python', 'tools/copyfile.py', | | 757 | + '<(python)', 'tools/copyfile.py', | 758 | 758 | '<(fipsmodule_internal)', | 759 | 759 | '<(fipsmodule)', | 760 | 760 | ], | | 764 | 764 | 'inputs': [ '<(opensslconfig)', ], | 765 | 765 | 'outputs': [ '<(opensslconfig_internal)', ], | 766 | 766 | 'action': [ | 767 | | - 'python', 'tools/enable_fips_include.py', | | 767 | + '<(python)', 'tools/enable_fips_include.py', | 768 | 768 | '<(opensslconfig)', | 769 | 769 | '<(opensslconfig_internal)', | 770 | 770 | '<(fipsconfig)', | |
Collapse file Copy file name to clipboardExpand all lines: tools/gyp/pylib/gyp/generator/msvs.py +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -438,6 +438,7 @@ def _BuildCommandLineForRuleRaw( | 438 | 438 | # Support a mode for using cmd directly. | 439 | 439 | # Convert any paths to native form (first element is used directly). | 440 | 440 | # TODO(quote): regularize quoting path names throughout the module | | 441 | + command[1] = '"%s"' % command[1] | 441 | 442 | arguments = ['"%s"' % i for i in arguments] | 442 | 443 | # Collapse into a single command. | 443 | 444 | return input_dir_preamble + " ".join(command + arguments) | |
Collapse file Copy file name to clipboardExpand all lines: tools/v8_gypfiles/toolchain.gypi +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 41 | 41 | 'has_valgrind%': 0, | 42 | 42 | 'coverage%': 0, | 43 | 43 | 'v8_target_arch%': '<(target_arch)', | 44 | | - 'v8_host_byteorder%': '<!(python -c "import sys; print(sys.byteorder)")', | | 44 | + 'v8_host_byteorder%': '<!("<(python)" -c "import sys; print(sys.byteorder)")', | 45 | 45 | 'force_dynamic_crt%': 0, | 46 | 46 |
| 47 | 47 | # Setting 'v8_can_use_vfp32dregs' to 'true' will cause V8 to use the VFP | |
|