From 7321f01678d6dc286a4616a843f835cb6b949520 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Wed, 23 Aug 2023 14:52:41 -0400 Subject: Rust: Use Popen_safe_logged in sanity checks --- mesonbuild/compilers/rust.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index d722039..b5e6a6a 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -18,8 +18,8 @@ import textwrap import re import typing as T -from .. import coredata, mlog -from ..mesonlib import EnvironmentException, MesonException, Popen_safe, OptionKey, join_args +from .. import coredata +from ..mesonlib import EnvironmentException, MesonException, Popen_safe_logged, OptionKey from .compilers import Compiler, rust_buildtype_args, clike_debug_args if T.TYPE_CHECKING: @@ -82,13 +82,7 @@ class RustCompiler(Compiler): ''')) cmdlist = self.exelist + ['-o', output_name, source_name] - pc, stdo, stde = Popen_safe(cmdlist, cwd=work_dir) - mlog.debug('Sanity check compiler command line:', join_args(cmdlist)) - mlog.debug('Sanity check compile stdout:') - mlog.debug(stdo) - mlog.debug('-----\nSanity check compile stderr:') - mlog.debug(stde) - mlog.debug('-----') + pc, stdo, stde = Popen_safe_logged(cmdlist, cwd=work_dir) if pc.returncode != 0: raise EnvironmentException(f'Rust compiler {self.name_string()} cannot compile programs.') if self.is_cross: @@ -104,7 +98,7 @@ class RustCompiler(Compiler): raise EnvironmentException(f'Executables created by Rust compiler {self.name_string()} are not runnable.') # Get libraries needed to link with a Rust staticlib cmdlist = self.exelist + ['--crate-type', 'staticlib', '--print', 'native-static-libs', source_name] - p, stdo, stde = Popen_safe(cmdlist, cwd=work_dir) + p, stdo, stde = Popen_safe_logged(cmdlist, cwd=work_dir) if p.returncode == 0: match = re.search('native-static-libs: (.*)$', stde, re.MULTILINE) if match: @@ -123,7 +117,7 @@ class RustCompiler(Compiler): def get_sysroot(self) -> str: cmd = self.get_exelist(ccache=False) + ['--print', 'sysroot'] - p, stdo, stde = Popen_safe(cmd) + p, stdo, stde = Popen_safe_logged(cmd) return stdo.split('\n', maxsplit=1)[0] def get_debug_args(self, is_debug: bool) -> T.List[str]: -- cgit v1.1