diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-07-01 14:43:51 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-07-01 20:50:47 +0530 |
commit | 2e986ae30dbcc4505db36497adf943d119bc5a4e (patch) | |
tree | fe591ba57fa1337bc7e0ea7c4207dfc365e6a2f5 /mesonbuild/backend/backends.py | |
parent | 8ad4779a054a4d82c8d3d32978b3f7609b739cb4 (diff) | |
download | meson-2e986ae30dbcc4505db36497adf943d119bc5a4e.zip meson-2e986ae30dbcc4505db36497adf943d119bc5a4e.tar.gz meson-2e986ae30dbcc4505db36497adf943d119bc5a4e.tar.bz2 |
backend: Raise a RuntimeError if an unknown object is added to the command list
This allows us to catch these errors early and print a useful message
Diffstat (limited to 'mesonbuild/backend/backends.py')
-rw-r--r-- | mesonbuild/backend/backends.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 37503ba..a9d9213 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -495,11 +495,15 @@ class Backend(): if isinstance(i, build.Executable): cmd += self.exe_object_to_cmd_array(i) continue - if isinstance(i, build.CustomTarget): + elif isinstance(i, build.CustomTarget): # GIR scanner will attempt to execute this binary but # it assumes that it is in path, so always give it a full path. tmp = i.get_filename()[0] i = os.path.join(self.get_target_dir(i), tmp) + # FIXME: str types are blindly added and ignore the 'absolute_paths' argument + elif not isinstance(i, str): + err_msg = 'Argument {0} is of unknown type {1}' + raise RuntimeError(err_msg.format(str(i), str(type(i)))) for (j, src) in enumerate(srcs): i = i.replace('@INPUT%d@' % j, src) for (j, res) in enumerate(ofilenames): |