Skip to content

Commit e9e5820

Browse files
DerDakondcbaker
authored andcommitted
print out which command needs an exe_wrapper
It's not the first time I run into an issue with an intentionally missing exe_wrapper during cross compilation. In pretty much all the cases the project I tried to build already had code available to not need one in the first place. Print out what command was actually the culprit to make debugging this easier.
1 parent 79fc894 commit e9e5820

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

mesonbuild/backend/backends.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ def get_executable_serialisation(
574574
is_cross_built = not self.environment.machines.matches_build_machine(exe_for_machine)
575575
if is_cross_built and self.environment.need_exe_wrapper():
576576
if not self.environment.has_exe_wrapper():
577-
msg = 'An exe_wrapper is needed but was not found. Please define one ' \
577+
msg = 'An exe_wrapper is needed for ' + exe_cmd[0] + ' but was not found. Please define one ' \
578578
'in cross file and check the command and/or add it to PATH.'
579579
raise MesonException(msg)
580580
exe_wrapper = self.environment.get_exe_wrapper()
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"stdout": [
3-
{ "line": "ERROR: An exe_wrapper is needed but was not found. Please define one in cross file and check the command and/or add it to PATH." }
3+
{
4+
"match": "re",
5+
"line": "ERROR: An exe_wrapper is needed for .* but was not found. Please define one in cross file and check the command and/or add it to PATH."
6+
}
47
]
58
}

unittests/linuxcrosstests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def test_exe_wrapper_behaviour(self):
146146
self.meson_cross_files = [os.path.join(testdir, 'broken-cross.txt')]
147147
# Force tracebacks so we can detect them properly
148148
env = {'MESON_FORCE_BACKTRACE': '1'}
149-
error_message = "An exe_wrapper is needed but was not found. Please define one in cross file and check the command and/or add it to PATH."
149+
error_message = "An exe_wrapper is needed for " + self.builddir + "/prog.exe but was not found. Please define one in cross file and check the command and/or add it to PATH."
150150

151151
with self.assertRaises(MesonException) as cm:
152152
# Must run in-process or we'll get a generic CalledProcessError

0 commit comments

Comments
 (0)