diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2020-12-07 11:40:20 -0500 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2021-01-06 14:53:07 +0530 |
commit | e2797a7726c1f0d6d648bb7a9e3ee825e1dd75ce (patch) | |
tree | 4fdb421f12732bf982db74f24978af0c36f7febe | |
parent | d89d71cd56e5d6a963b0887a74b168df275c6e63 (diff) | |
download | meson-e2797a7726c1f0d6d648bb7a9e3ee825e1dd75ce.zip meson-e2797a7726c1f0d6d648bb7a9e3ee825e1dd75ce.tar.gz meson-e2797a7726c1f0d6d648bb7a9e3ee825e1dd75ce.tar.bz2 |
pkgconfig: Respect variable ordering when passed as list
This fix a regression introduced in Meson 0.56.0 when using python 3.5.
Also mention in documentation that using a meson dict does not guarantee
ordering.
Fixes: #8074.
-rw-r--r-- | docs/markdown/Pkgconfig-module.md | 3 | ||||
-rw-r--r-- | mesonbuild/interpreter.py | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/docs/markdown/Pkgconfig-module.md b/docs/markdown/Pkgconfig-module.md index e9aa4a2..53c23fa 100644 --- a/docs/markdown/Pkgconfig-module.md +++ b/docs/markdown/Pkgconfig-module.md @@ -50,7 +50,8 @@ keyword arguments. reference other pkgconfig variables, e.g. `datadir=${prefix}/share`. The names `prefix`, `libdir` and `includedir` are reserved and may not be used. *Since 0.56.0* it can also be a - dictionary. + dictionary but ordering of Meson dictionaries are not guaranteed, which could + cause issues when some variables reference other variables. - `version` a string describing the version of this library, used to set the `Version:` field. (*since 0.46.0*) Defaults to the project version if unspecified. - `d_module_versions` a list of module version flags used when compiling diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 28ac74f..03b39e7 100644 --- a/mesonbuild/interpreter.py +++ b/mesonbuild/interpreter.py @@ -2699,7 +2699,7 @@ class Interpreter(InterpreterBase): varlist = mesonlib.stringlistify(variables) if list_new: FeatureNew.single_use('variables as list of strings', '0.56.0', self.subproject) - variables = {} + variables = collections.OrderedDict() for v in varlist: try: (key, value) = v.split('=', 1) |