Revert "meson: update to 0.52.0."

This reverts commit 6b8bf86f64.

0.52.0 did break gnome-builder https://gitlab.gnome.org/GNOME/gnome-builder/issues/1057
This commit is contained in:
John 2019-10-16 17:36:44 +02:00
parent 91c13ef7e2
commit 4d8a5a9f04
3 changed files with 50 additions and 125 deletions

View File

@ -0,0 +1,47 @@
From 77c3e6a4aaed07e626f4bf4deb7eb66e0f03a33d Mon Sep 17 00:00:00 2001
From: James Westman <flyingpimonster@flyingpimonster.net>
Date: Mon, 24 Jun 2019 12:04:12 -0500
Subject: [PATCH] Fix two errors when cross-compiling with Vala
- AttributeError: 'ValaCompiler' object has no attribute 'get_program_dirs'
Fixed by adding a `get_program_dirs()` function to the base Compiler
class, to match `get_library_dirs()`
- KeyError: 'vala_COMPILER'
Fixed by creating the Vala compile rules for all machines, not just
the build machine.
---
mesonbuild/backend/ninjabackend.py | 3 +--
mesonbuild/compilers/compilers.py | 3 +++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index a454e6ab5f..b830e377e4 100644
--- mesonbuild/backend/ninjabackend.py
+++ mesonbuild/backend/ninjabackend.py
@@ -1653,8 +1653,7 @@ def generate_compile_rule_for(self, langname, compiler):
self.generate_cs_compile_rule(compiler)
return
if langname == 'vala':
- if self.environment.machines.matches_build_machine(compiler.for_machine):
- self.generate_vala_compile_rules(compiler)
+ self.generate_vala_compile_rules(compiler)
return
if langname == 'rust':
self.generate_rust_compile_rules(compiler)
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 5855de71c8..86c1e33407 100644
--- mesonbuild/compilers/compilers.py
+++ mesonbuild/compilers/compilers.py
@@ -1117,6 +1117,9 @@ def find_library(self, *args, **kwargs):
def get_library_dirs(self, *args, **kwargs):
return ()
+ def get_program_dirs(self, *args, **kwargs):
+ return ()
+
def has_multi_arguments(self, args, env) -> Tuple[bool, bool]:
raise EnvironmentException(
'Language {} does not support has_multi_arguments.'.format(

View File

@ -1,123 +0,0 @@
https://github.com/mesonbuild/meson/issues/6010
This breaks build for wlroots and possibly other things.
From 1930fc82e24a72625cd851903c22d893e4817a3c Mon Sep 17 00:00:00 2001
From: Xavier Claessens <xavier.claessens@collabora.com>
Date: Tue, 8 Oct 2019 11:02:00 -0400
Subject: [PATCH 1/2] Fix `if not disabler()` case
Closes: #6010
---
mesonbuild/interpreterbase.py | 2 ++
test cases/common/163 disabler/meson.build | 22 ++++++++++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/mesonbuild/interpreterbase.py b/mesonbuild/interpreterbase.py
index 082515c45a..5c83900292 100644
--- mesonbuild/interpreterbase.py
+++ mesonbuild/interpreterbase.py
@@ -500,6 +500,8 @@ def evaluate_dictstatement(self, cur):
def evaluate_notstatement(self, cur):
v = self.evaluate_statement(cur.value)
+ if is_disabler(v):
+ return v
if not isinstance(v, bool):
raise InterpreterException('Argument to "not" is not a boolean.')
return not v
diff --git a/test cases/common/163 disabler/meson.build b/test cases/common/163 disabler/meson.build
index 5eb24ba11c..8da2a0bd14 100644
--- test cases/common/163 disabler/meson.build
+++ test cases/common/163 disabler/meson.build
@@ -76,3 +76,25 @@ else
has_not_changed = true
endif
assert(has_not_changed, 'App has changed.')
+
+if_is_disabled = true
+if disabler()
+ if_is_disabled = false
+else
+ if_is_disabled = false
+endif
+assert(if_is_disabled, 'Disabler in "if condition" must skip both blocks')
+
+if not disabler()
+ if_is_disabled = false
+else
+ if_is_disabled = false
+endif
+assert(if_is_disabled, 'Disabler in "if not condition" must skip both blocks')
+
+if disabler() == 1
+ if_is_disabled = false
+else
+ if_is_disabled = false
+endif
+assert(if_is_disabled, 'Disabler in "if a==b" must skip both blocks')
From 9855b2d3c58800f485355229102212eaebf6645a Mon Sep 17 00:00:00 2001
From: Xavier Claessens <xavier.claessens@collabora.com>
Date: Tue, 8 Oct 2019 12:09:01 -0400
Subject: [PATCH 2/2] Test disabler in foreach loops
The is_disabler() check in evaluate_foreach() was useless because we
already checked that items is a list.
---
mesonbuild/interpreterbase.py | 4 ----
test cases/common/163 disabler/meson.build | 22 ++++++++++++++++++++++
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/mesonbuild/interpreterbase.py b/mesonbuild/interpreterbase.py
index 5c83900292..562ba273c4 100644
--- mesonbuild/interpreterbase.py
+++ mesonbuild/interpreterbase.py
@@ -682,8 +682,6 @@ def evaluate_foreach(self, node):
if len(node.varnames) != 1:
raise InvalidArguments('Foreach on array does not unpack')
varname = node.varnames[0].value
- if is_disabler(items):
- return items
for item in items:
self.set_variable(varname, item)
try:
@@ -695,8 +693,6 @@ def evaluate_foreach(self, node):
elif isinstance(items, dict):
if len(node.varnames) != 2:
raise InvalidArguments('Foreach on dict unpacks key and value')
- if is_disabler(items):
- return items
for key, value in items.items():
self.set_variable(node.varnames[0].value, key)
self.set_variable(node.varnames[1].value, value)
diff --git a/test cases/common/163 disabler/meson.build b/test cases/common/163 disabler/meson.build
index 8da2a0bd14..1f0580cb52 100644
--- test cases/common/163 disabler/meson.build
+++ test cases/common/163 disabler/meson.build
@@ -98,3 +98,25 @@ else
if_is_disabled = false
endif
assert(if_is_disabled, 'Disabler in "if a==b" must skip both blocks')
+
+loops = 0
+disablers = 0
+foreach i : [true, disabler(), true]
+ loops += 1
+ if is_disabler(i)
+ disablers += 1
+ endif
+endforeach
+assert(loops == 3, 'Disabler in foreach array')
+assert(disablers == 1, 'Disabler in foreach array')
+
+loops = 0
+disablers = 0
+foreach k, i : {'a': true, 'b': disabler(), 'c': true}
+ loops += 1
+ if is_disabler(i)
+ disablers += 1
+ endif
+endforeach
+assert(loops == 3, 'Disabler in foreach dict')
+assert(disablers == 1, 'Disabler in foreach dict')

View File

@ -1,6 +1,7 @@
# Template file for 'meson'
pkgname=meson
version=0.52.0
reverts="0.52.0_1 0.52.0_2"
version=0.51.2
revision=2
archs=noarch
build_style=python3-module
@ -15,7 +16,7 @@ license="Apache-2.0"
homepage="https://mesonbuild.com"
changelog="https://raw.githubusercontent.com/mesonbuild/meson/master/docs/markdown/Release-notes-for-${version%.?}.0.md"
distfiles="https://github.com/mesonbuild/meson/archive/${version}.tar.gz"
checksum=0f426ed1362c38bcc5b9027ec6aec3445d6db88e8d7249ed992e9af88a42d0e0
checksum=96871cf62c9cf2b212e2f38aa3e543323403b1314fd3835e14120ef837c00f01
do_check() {
# meson depends on trillion of things to perform actual tests