diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2019-04-02 15:32:23 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-04-03 14:48:29 -0700 |
commit | 82346a2bd241fcf34e66f34ac653b580e8f395ef (patch) | |
tree | 947b907a5e63bed8f723e557695035ef9aafeef1 | |
parent | 3d04e5a150ea2a40cc9d531241fb6dbed21e8c7f (diff) | |
download | meson-82346a2bd241fcf34e66f34ac653b580e8f395ef.zip meson-82346a2bd241fcf34e66f34ac653b580e8f395ef.tar.gz meson-82346a2bd241fcf34e66f34ac653b580e8f395ef.tar.bz2 |
modules/python: Report program found in find_installation()
Currently find_installation is silent, which is pretty annoying. Let's
log it.
-rw-r--r-- | mesonbuild/modules/python.py | 8 | ||||
-rw-r--r-- | test cases/python/1 basic/meson.build | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py index 2dba007..693621b 100644 --- a/mesonbuild/modules/python.py +++ b/mesonbuild/modules/python.py @@ -131,7 +131,7 @@ class PythonDependency(ExternalDependency): if self.is_found: mlog.log('Dependency', mlog.bold(self.name), 'found:', mlog.green('YES ({})'.format(py_lookup_method))) else: - mlog.log('Dependency', mlog.bold(self.name), 'found:', mlog.red('NO')) + mlog.log('Dependency', mlog.bold(self.name), 'found:', [mlog.red('NO')]) def _find_libpy(self, python_holder, environment): if python_holder.is_pypy: @@ -512,8 +512,7 @@ class PythonModule(ExtensionModule): raise InvalidArguments('find_installation argument must be a string.') if not name_or_path: - mlog.log("Using meson's python {}".format(mesonlib.python_command)) - python = ExternalProgram('python3', mesonlib.python_command, silent=True) + python = ExternalProgram('python3', mesonlib.python_command) else: python = ExternalProgram.from_entry('python3', name_or_path) @@ -530,6 +529,9 @@ class PythonModule(ExtensionModule): if not python.found() and name_or_path in ['python2', 'python3']: python = ExternalProgram('python', silent=True) + mlog.log('Program', python.name, 'found:', + *[mlog.green('YES'), '({})'.format(' '.join(python.command))] if python.found() else [mlog.red('NO')]) + if not python.found(): if required: raise mesonlib.MesonException('{} not found'.format(name_or_path or 'python')) diff --git a/test cases/python/1 basic/meson.build b/test cases/python/1 basic/meson.build index f9a7433..9c3af10 100644 --- a/test cases/python/1 basic/meson.build +++ b/test cases/python/1 basic/meson.build @@ -1,7 +1,7 @@ project('python sample', 'c') py_mod = import('python') -py = py_mod.find_installation() +py = py_mod.find_installation('python3') py_version = py.language_version() if py_version.version_compare('< 3.2') |