aboutsummaryrefslogtreecommitdiff
path: root/run_project_tests.py
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2023-09-05 07:49:18 -0400
committerXavier Claessens <xclaesse@gmail.com>2023-09-07 10:56:37 -0400
commitb2654b2d43089c933e66ab1d3dfb547caecfea71 (patch)
tree3ee812de1bccd87bfeab711634d6a37f2d72509e /run_project_tests.py
parent025aea1dab4bcf9aafdd72acf48476d999a729b9 (diff)
downloadmeson-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 'run_project_tests.py')
-rwxr-xr-xrun_project_tests.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/run_project_tests.py b/run_project_tests.py
index 446dc12..8e0af26 100755
--- a/run_project_tests.py
+++ b/run_project_tests.py
@@ -40,6 +40,7 @@ import time
import typing as T
import xml.etree.ElementTree as ET
import collections
+import importlib.util
from mesonbuild import build
from mesonbuild import environment
@@ -169,7 +170,7 @@ class InstalledFile:
return None
# Handle the different types
- if self.typ in {'py_implib', 'py_limited_implib', 'python_lib', 'python_limited_lib', 'python_file'}:
+ if self.typ in {'py_implib', 'py_limited_implib', 'python_lib', 'python_limited_lib', 'python_file', 'python_bytecode'}:
val = p.as_posix()
val = val.replace('@PYTHON_PLATLIB@', python.platlib)
val = val.replace('@PYTHON_PURELIB@', python.purelib)
@@ -196,6 +197,8 @@ class InstalledFile:
return p.with_suffix('.dll.a')
else:
return None
+ if self.typ == 'python_bytecode':
+ return p.parent / importlib.util.cache_from_source(p.name)
elif self.typ in {'file', 'dir'}:
return p
elif self.typ == 'shared_lib':