diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2023-09-05 07:49:18 -0400 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2023-09-07 10:56:37 -0400 |
commit | b2654b2d43089c933e66ab1d3dfb547caecfea71 (patch) | |
tree | 3ee812de1bccd87bfeab711634d6a37f2d72509e /test cases | |
parent | 025aea1dab4bcf9aafdd72acf48476d999a729b9 (diff) | |
download | meson-b2654b2d43089c933e66ab1d3dfb547caecfea71.zip meson-b2654b2d43089c933e66ab1d3dfb547caecfea71.tar.gz meson-b2654b2d43089c933e66ab1d3dfb547caecfea71.tar.bz2 |
Fix crash when installing a vala library and python sources
Installing python sources causes the python module to call
create_install_data() before Ninja backends adds extra outputs to Vala
targets.
Target objects are supposed to be immutable, adding outputs that late is
totally wrong. Add extra vala outputs immediately, but be careful
because the main output is only added later in post_init(). Luckily
the base class already puts a placeholder item in self.outputs for the
main filename so we can just replace self.outputs[0] instead of
replacing the whole list which would contain vala outputs at that stage.
This is surprisingly what SharedLibrary was already doing.
Diffstat (limited to 'test cases')
-rw-r--r-- | test cases/vala/7 shared library/lib/meson.build | 5 | ||||
-rw-r--r-- | test cases/vala/7 shared library/lib/source.py | 0 | ||||
-rw-r--r-- | test cases/vala/7 shared library/test.json | 4 |
3 files changed, 8 insertions, 1 deletions
diff --git a/test cases/vala/7 shared library/lib/meson.build b/test cases/vala/7 shared library/lib/meson.build index edeeb96..bbd3862 100644 --- a/test cases/vala/7 shared library/lib/meson.build +++ b/test cases/vala/7 shared library/lib/meson.build @@ -33,3 +33,8 @@ shared_library('installed_vala_onlyvapi', 'mylib.vala', dependencies : valadeps, install : true, install_dir : [false, false, join_paths(get_option('datadir'), 'vala', 'vapi')]) + +# Regression test: Vala libraries were broken when also installing python modules. +# https://gitlab.gnome.org/GNOME/gitg/-/issues/412 +python = import('python').find_installation() +python.install_sources('source.py') diff --git a/test cases/vala/7 shared library/lib/source.py b/test cases/vala/7 shared library/lib/source.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test cases/vala/7 shared library/lib/source.py diff --git a/test cases/vala/7 shared library/test.json b/test cases/vala/7 shared library/test.json index eee3c3d..08bd707 100644 --- a/test cases/vala/7 shared library/test.json +++ b/test cases/vala/7 shared library/test.json @@ -9,6 +9,8 @@ {"type": "file", "file": "usr/include/installed_vala_onlyh.h"}, {"type": "file", "file": "usr/share/vala/vapi/installed_vala_all.vapi"}, {"type": "file", "file": "usr/share/vala-1.0/vapi/installed_vala_all_nolib.vapi"}, - {"type": "file", "file": "usr/share/vala/vapi/installed_vala_onlyvapi.vapi"} + {"type": "file", "file": "usr/share/vala/vapi/installed_vala_onlyvapi.vapi"}, + {"type": "python_file", "file": "usr/@PYTHON_PURELIB@/source.py"}, + {"type": "python_bytecode", "file": "usr/@PYTHON_PURELIB@/source.py"} ] } |