summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRolf Eike Beer <eb@emlix.com>2024-12-17 14:41:17 +0100
committerDylan Baker <dylan@pnwbakers.com>2024-12-20 09:24:24 -0800
commite9e582020898e52d17b4c48afe65589bc1dee065 (patch)
tree62d31b717c4c7827abc79e476a2016978efa005a
parent79fc8941c5d3855ebd76aad90550081e455cc50f (diff)
downloadmeson-e9e582020898e52d17b4c48afe65589bc1dee065.tar.gz
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.
-rw-r--r--mesonbuild/backend/backends.py2
-rw-r--r--test cases/failing/126 generator host binary/test.json5
-rw-r--r--unittests/linuxcrosstests.py2
3 files changed, 6 insertions, 3 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 970fb82f2..d5bda3b42 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -574,7 +574,7 @@ class Backend:
is_cross_built = not self.environment.machines.matches_build_machine(exe_for_machine)
if is_cross_built and self.environment.need_exe_wrapper():
if not self.environment.has_exe_wrapper():
- msg = 'An exe_wrapper is needed but was not found. Please define one ' \
+ msg = 'An exe_wrapper is needed for ' + exe_cmd[0] + ' but was not found. Please define one ' \
'in cross file and check the command and/or add it to PATH.'
raise MesonException(msg)
exe_wrapper = self.environment.get_exe_wrapper()
diff --git a/test cases/failing/126 generator host binary/test.json b/test cases/failing/126 generator host binary/test.json
index 7e354d60d..c633622cf 100644
--- a/test cases/failing/126 generator host binary/test.json
+++ b/test cases/failing/126 generator host binary/test.json
@@ -1,5 +1,8 @@
{
"stdout": [
- { "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." }
+ {
+ "match": "re",
+ "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."
+ }
]
}
diff --git a/unittests/linuxcrosstests.py b/unittests/linuxcrosstests.py
index a35633cdd..910429b0e 100644
--- a/unittests/linuxcrosstests.py
+++ b/unittests/linuxcrosstests.py
@@ -146,7 +146,7 @@ class LinuxCrossMingwTests(BaseLinuxCrossTests):
self.meson_cross_files = [os.path.join(testdir, 'broken-cross.txt')]
# Force tracebacks so we can detect them properly
env = {'MESON_FORCE_BACKTRACE': '1'}
- 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."
+ 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."
with self.assertRaises(MesonException) as cm:
# Must run in-process or we'll get a generic CalledProcessError