diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2019-07-12 17:42:56 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-07-19 00:17:29 +0200 |
commit | b4d313b05876a1af40014a4c3b129fe2db7cafb9 (patch) | |
tree | 71de96cb090361e657d062ac513e2422969ceb51 /mesonbuild/scripts | |
parent | ed348b7da81dd05aaa7ac398ae9acc4b15bc2733 (diff) | |
download | meson-b4d313b05876a1af40014a4c3b129fe2db7cafb9.zip meson-b4d313b05876a1af40014a4c3b129fe2db7cafb9.tar.gz meson-b4d313b05876a1af40014a4c3b129fe2db7cafb9.tar.bz2 |
backends: remove unnecessary fields from ExecutableSerialisation
"exe.is_cross and exe.needs_exe_wrapper" is the same condition under which
meson chooses whether to include the exe_wrapper. meson_exe has an assertion
for that, but now that meson_exe does not need anymore exe.is_cross,
we can simplify the code if we just "trust" meson to do the right thing.
Remove both fields from ExecutableSerialisation and just test the presence
of the wrapper, and also remove the executable basename which is only
used to "beautify" an assertion failure.
Diffstat (limited to 'mesonbuild/scripts')
-rw-r--r-- | mesonbuild/scripts/meson_exe.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/mesonbuild/scripts/meson_exe.py b/mesonbuild/scripts/meson_exe.py index c7efa7f..8f7d0fd 100644 --- a/mesonbuild/scripts/meson_exe.py +++ b/mesonbuild/scripts/meson_exe.py @@ -39,15 +39,11 @@ def is_cygwin(): return 'cygwin' in platname def run_exe(exe): - if exe.is_cross and exe.needs_exe_wrapper: - if exe.exe_runner is None: - raise AssertionError('BUG: Can\'t run cross-compiled exe {!r} ' - 'with no wrapper'.format(exe.name)) - elif not exe.exe_runner.found(): + if exe.exe_runner: + if not exe.exe_runner.found(): raise AssertionError('BUG: Can\'t run cross-compiled exe {!r} with not-found ' - 'wrapper {!r}'.format(exe.name, exe.exe_runner.get_path())) - else: - cmd = exe.exe_runner.get_command() + exe.fname + 'wrapper {!r}'.format(exe.fname[0], exe.exe_runner.get_path())) + cmd = exe.exe_runner.get_command() + exe.fname else: cmd = exe.fname child_env = os.environ.copy() @@ -109,8 +105,7 @@ def run(args): else: exe_cmd = cmd_args[0] cmd_args = cmd_args[1:] - basename = os.path.basename(exe_cmd) - exe = ExecutableSerialisation(basename, [exe_cmd], cmd_args, + exe = ExecutableSerialisation([exe_cmd], cmd_args, capture=options.capture) return run_exe(exe) |