diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-07-09 08:23:35 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-09 08:19:32 -0700 |
| commit | 10f048fcd18822d38348b2406e3e4bc898fb4a3a (patch) | |
| tree | 2c5ce6face73ff7db34e930bf649336f4d992ce4 | |
| parent | Git 2.50 (diff) | |
| download | git-10f048fcd18822d38348b2406e3e4bc898fb4a3a.tar.gz git-10f048fcd18822d38348b2406e3e4bc898fb4a3a.zip | |
meson: stop discovering native version of Python
When Python features are enabled we search both for a native and
non-native version of Python. This is wrong though: we don't use Python
in our build process, so there is no need to search for it in the first
place.
There is one location where we use the native version of Python, namely
when deciding whether or not we want to wire up git-p4(1). This check is
invalid though, as we shouldn't check for the build host to have Python,
but for the target host.
Fix this invalid check to use the non-native version of Python and stop
searching for a native version of Python altogether.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
| -rw-r--r-- | meson.build | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/meson.build b/meson.build index 596f5ac711..8026a064c9 100644 --- a/meson.build +++ b/meson.build @@ -866,9 +866,11 @@ if host_machine.system() == 'cygwin' or host_machine.system() == 'windows' endif build_options_config.set_quoted('X', executable_suffix) -python = import('python').find_installation('python3', required: get_option('python')) -target_python = find_program('python3', native: false, required: python.found()) -if python.found() +# Python is not used for our build system, but exclusively for git-p4. +# Consequently we only need to determine whether Python is available for the +# build target. +target_python = find_program('python3', native: false, required: get_option('python')) +if target_python.found() build_options_config.set('NO_PYTHON', '') else libgit_c_args += '-DNO_PYTHON' @@ -1979,7 +1981,7 @@ if perl_features_enabled subdir('perl') endif -if python.found() +if target_python.found() scripts_python = [ 'git-p4.py' ] @@ -2190,7 +2192,7 @@ summary({ 'iconv': iconv.found(), 'pcre2': pcre2.found(), 'perl': perl_features_enabled, - 'python': python.found(), + 'python': target_python.found(), }, section: 'Auto-detected features') summary({ |
