extra/meson to 0.60.0-2

This commit is contained in:
Kevin Mihelich 2021-10-31 22:31:01 +00:00
parent 9c12fdc588
commit d4c09a755c
7 changed files with 302 additions and 15 deletions

View file

@ -0,0 +1,52 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xavier Claessens <xavier.claessens@collabora.com>
Date: Mon, 25 Oct 2021 09:19:25 -0400
Subject: [PATCH] i18n: merge_file() deprecate positional arguments
They always have been ignored but it became an hard error with no
deprecation period in 0.60.0. Since it breaks some GNOME projects,
deprecate for now and keep it removed for 0.61.0.
Fixes: #9441
---
mesonbuild/modules/i18n.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/mesonbuild/modules/i18n.py b/mesonbuild/modules/i18n.py
index 7c6f0f4dab62..975fbf63b0b5 100644
--- a/mesonbuild/modules/i18n.py
+++ b/mesonbuild/modules/i18n.py
@@ -22,7 +22,7 @@ from .. import mesonlib
from .. import mlog
from ..interpreter.type_checking import CT_BUILD_BY_DEFAULT, CT_INPUT_KW, CT_INSTALL_DIR_KW, CT_INSTALL_TAG_KW, CT_OUTPUT_KW, INSTALL_KW, NoneType, in_set_validator
from ..interpreterbase import FeatureNew
-from ..interpreterbase.decorators import ContainerTypeInfo, KwargInfo, noPosargs, typed_kwargs, typed_pos_args
+from ..interpreterbase.decorators import ContainerTypeInfo, KwargInfo, typed_kwargs, typed_pos_args
from ..scripts.gettext import read_linguas
if T.TYPE_CHECKING:
@@ -128,21 +128,23 @@ class I18nModule(ExtensionModule):
return [path.join(src_dir, d) for d in dirs]
@FeatureNew('i18n.merge_file', '0.37.0')
- @noPosargs
@typed_kwargs(
'i18n.merge_file',
CT_BUILD_BY_DEFAULT,
CT_INPUT_KW,
CT_INSTALL_DIR_KW,
CT_INSTALL_TAG_KW,
CT_OUTPUT_KW,
INSTALL_KW,
_ARGS.evolve(since='0.51.0'),
_DATA_DIRS,
KwargInfo('po_dir', str, required=True),
KwargInfo('type', str, default='xml', validator=in_set_validator({'xml', 'desktop'})),
)
def merge_file(self, state: 'ModuleState', args: T.List['TYPE_var'], kwargs: 'MergeFile') -> ModuleReturnValue:
+ if args:
+ mlog.deprecation('i18n.merge_file does not take any positional arguments. '
+ 'This will become a hard error in the next Meson release.')
if not shutil.which('xgettext'):
self.nogettext_warning()
return ModuleReturnValue(None, [])

View file

@ -0,0 +1,29 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xavier Claessens <xavier.claessens@collabora.com>
Date: Wed, 27 Oct 2021 10:55:21 -0400
Subject: [PATCH] test_clang_format: Do not assume meson source is in git
Fixes: #9437
---
unittests/allplatformstests.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py
index da461e449af2..57aa7c2d86fa 100644
--- a/unittests/allplatformstests.py
+++ b/unittests/allplatformstests.py
@@ -2536,6 +2536,14 @@ class AllPlatformTests(BasePlatformTests):
if self.backend is not Backend.ninja:
raise SkipTest(f'Clang-format is for now only supported on Ninja, not {self.backend.name}')
testdir = os.path.join(self.unit_test_dir, '54 clang-format')
+
+ # Ensure that test project is in git even when running meson from tarball.
+ srcdir = os.path.join(self.builddir, 'src')
+ shutil.copytree(testdir, srcdir)
+ _git_init(srcdir)
+ testdir = srcdir
+ self.new_builddir()
+
testfile = os.path.join(testdir, 'prog.c')
badfile = os.path.join(testdir, 'prog_orig_c')
goodfile = os.path.join(testdir, 'prog_expected_c')

View file

@ -0,0 +1,83 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dylan Baker <dylan@pnwbakers.com>
Date: Wed, 27 Oct 2021 11:02:04 -0700
Subject: [PATCH] modules/gnome: ensure that `install_dir` is set
The `mkenums` functions can have this unset if, and only if, the
c file only variant is called. Due to side effects if the header file is
generated then `install_dir` is ensured to be set for the c file. I have
removed this side effect so that our tests actually cover this case.
Fixes #9472
---
mesonbuild/modules/gnome.py | 22 ++++++++++++-------
.../frameworks/7 gnome/mkenums/meson.build | 6 ++---
2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 714b68a8da3c..4b3107e36738 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -1434,31 +1434,37 @@ class GnomeModule(ExtensionModule):
# so --template consumes it.
h_cmd = cmd + ['--template', '@INPUT@']
h_sources = [h_template] + sources
- custom_kwargs['install'] = install_header
- if 'install_dir' not in custom_kwargs:
- custom_kwargs['install_dir'] = \
+
+ # Copy so we don't mutate the arguments for the c_template
+ h_kwargs = custom_kwargs.copy()
+ h_kwargs['install'] = install_header
+ if 'install_dir' not in h_kwargs:
+ h_kwargs['install_dir'] = \
state.environment.coredata.get_option(mesonlib.OptionKey('includedir'))
h_target = self._make_mkenum_custom_target(state, h_sources,
h_output, h_cmd,
- custom_kwargs)
+ h_kwargs)
targets.append(h_target)
if c_template is not None:
c_output = os.path.basename(os.path.splitext(c_template)[0])
# We always set template as the first element in the source array
# so --template consumes it.
c_cmd = cmd + ['--template', '@INPUT@']
c_sources = [c_template] + sources
+
+ c_kwargs = custom_kwargs.copy()
# Never install the C file. Complain on bug tracker if you need it.
- custom_kwargs['install'] = False
+ c_kwargs['install'] = False
+ c_kwargs['install_dir'] = False
if h_template is not None:
if 'depends' in custom_kwargs:
- custom_kwargs['depends'] += [h_target]
+ c_kwargs['depends'] += [h_target]
else:
- custom_kwargs['depends'] = h_target
+ c_kwargs['depends'] = h_target
c_target = self._make_mkenum_custom_target(state, c_sources,
c_output, c_cmd,
- custom_kwargs)
+ c_kwargs)
targets.insert(0, c_target)
if c_template is None and h_template is None:
diff --git a/test cases/frameworks/7 gnome/mkenums/meson.build b/test cases/frameworks/7 gnome/mkenums/meson.build
index 8ff05ba5ea24..4cf4dcf8a01a 100644
--- a/test cases/frameworks/7 gnome/mkenums/meson.build
+++ b/test cases/frameworks/7 gnome/mkenums/meson.build
@@ -34,9 +34,9 @@ enums_c2 = gnome.mkenums('abc2',
sources : 'meson-sample.h',
depends : [enums_h1, enums_h2],
c_template : 'enums2.c.in',
- ftail : '/* trailing source file info */',
- install_header : true,
- install_dir : get_option('includedir'))
+ ftail : '/* trailing source file info */')
+# explicitly don't set install_dir here, for bug testing
+# See https://github.com/mesonbuild/meson/issues/9472
conf = configuration_data()
conf.set('ENUM_FILE', 'enums2.h')

View file

@ -0,0 +1,48 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dylan Baker <dylan@pnwbakers.com>
Date: Thu, 28 Oct 2021 10:53:26 -0700
Subject: [PATCH] modules/gnome: fix missing install_dir, again, harder
It turns out this could be missing in GResource*Target as well, due
mostly to the same problem, side effects of mutating a shared
dictionary; though it could also happen with a specific set of keywords
given and other omitted.
Fixes #9350
---
mesonbuild/modules/gnome.py | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index 4b3107e36738..e825981d40f1 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -278,18 +278,20 @@ class GnomeModule(ExtensionModule):
if install_header and not export:
raise MesonException('GResource header is installed yet export is not enabled')
- kwargs['input'] = args[1]
- kwargs['output'] = output
- kwargs['depends'] = depends
+ c_kwargs = kwargs.copy()
+ c_kwargs['input'] = args[1]
+ c_kwargs['output'] = output
+ c_kwargs['depends'] = depends
+ c_kwargs.setdefault('install_dir', [])
if not mesonlib.version_compare(glib_version, gresource_dep_needed_version):
# This will eventually go out of sync if dependencies are added
- kwargs['depend_files'] = depend_files
- kwargs['command'] = cmd
+ c_kwargs['depend_files'] = depend_files
+ c_kwargs['command'] = cmd
else:
depfile = f'{output}.d'
- kwargs['depfile'] = depfile
- kwargs['command'] = copy.copy(cmd) + ['--dependency-file', '@DEPFILE@']
- target_c = GResourceTarget(name, state.subdir, state.subproject, kwargs)
+ c_kwargs['depfile'] = depfile
+ c_kwargs['command'] = copy.copy(cmd) + ['--dependency-file', '@DEPFILE@']
+ target_c = GResourceTarget(name, state.subdir, state.subproject, c_kwargs)
if gresource: # Only one target for .gresource files
return ModuleReturnValue(target_c, [target_c])

View file

@ -0,0 +1,22 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dylan Baker <dylan@pnwbakers.com>
Date: Thu, 28 Oct 2021 11:46:18 -0700
Subject: [PATCH] modules/gnome: use `install_dir = []` instead of false
---
mesonbuild/modules/gnome.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index e825981d40f1..94b9793baa06 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -1458,7 +1458,7 @@ class GnomeModule(ExtensionModule):
c_kwargs = custom_kwargs.copy()
# Never install the C file. Complain on bug tracker if you need it.
c_kwargs['install'] = False
- c_kwargs['install_dir'] = False
+ c_kwargs['install_dir'] = []
if h_template is not None:
if 'depends' in custom_kwargs:
c_kwargs['depends'] += [h_target]

View file

@ -0,0 +1,39 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Paolo Bonzini <pbonzini@redhat.com>
Date: Wed, 27 Oct 2021 23:38:32 +0200
Subject: [PATCH] mtest: accept very long lines
Unless parsing TAP output, there is no strict requirement for
"meson test" to process test output one line at a time; it simply
looks nicer to not print a partial line if it can be avoided.
However, in the case of extremely long lines StreamReader.readline
can fail with a ValueError. Use readuntil('\n') instead and
just process whatever pieces of the line it returns.
Fixes: #8591
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
mesonbuild/mtest.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py
index 74d7d8bf1ca7..8faf98955fae 100644
--- a/mesonbuild/mtest.py
+++ b/mesonbuild/mtest.py
@@ -1092,7 +1092,14 @@ async def read_decode(reader: asyncio.StreamReader, console_mode: ConsoleUser) -
stdo_lines = []
try:
while not reader.at_eof():
- line = decode(await reader.readline())
+ # Prefer splitting by line, as that produces nicer output
+ try:
+ line_bytes = await reader.readuntil(b'\n')
+ except asyncio.IncompleteReadError as e:
+ line_bytes = e.partial
+ except asyncio.LimitOverrunError as e:
+ line_bytes = await reader.readexactly(e.consumed)
+ line = decode(line_bytes)
stdo_lines.append(line)
if console_mode is ConsoleUser.STDOUT:
print(line, end='', flush=True)

View file

@ -7,53 +7,67 @@
pkgname=meson
pkgver=0.60.0
pkgrel=1
pkgrel=2
pkgdesc='High productivity build system'
url='https://mesonbuild.com/'
arch=('any')
license=('Apache')
depends=('python-setuptools' 'ninja')
makedepends=('git')
checkdepends=('gcc-objc' 'vala' 'rust' 'gcc-fortran' 'mono' 'boost' 'qt5-base' 'git' 'cython'
'gtkmm3' 'gtest' 'gmock' 'protobuf' 'wxgtk3' 'python-gobject' 'gobject-introspection'
'itstool' 'gtk3' 'java-environment=8' 'gtk-doc' 'llvm' 'clang' 'sdl2' 'graphviz'
'doxygen' 'vulkan-validation-layers' 'openssh' 'mercurial' 'gtk-sharp-2' 'qt5-tools'
'libwmf' 'valgrind' 'cmake' 'netcdf-fortran' 'openmpi' 'nasm' 'gnustep-base' 'libelf'
'python-pytest-xdist' 'python2-setuptools' 'ldc' 'rust-bindgen' 'cuda' 'hotdoc')
_commit=f64e5cee6bc7ab8c00c31f341afc6043867773d0 # tags/0.60.0^0
source=("git+https://github.com/mesonbuild/meson#commit=$_commit"
source=(https://github.com/mesonbuild/meson/releases/download/${pkgver/rc/.rc}/meson-${pkgver}.tar.gz{,.asc}
0001-i18n-merge_file-deprecate-positional-arguments.patch
0002-test_clang_format-Do-not-assume-meson-source-is-in-g.patch
0003-modules-gnome-ensure-that-install_dir-is-set.patch
0004-modules-gnome-fix-missing-install_dir-again-harder.patch
0005-modules-gnome-use-install_dir-instead-of-false.patch
0006-mtest-accept-very-long-lines.patch
skip-test.diff
arch-meson)
sha512sums=('SKIP'
sha512sums=('05275f003445672c1613db6c4c62ab39bfedc64cf2261f91d361a2aa24116a08185874b2e5dfa7daeebd584313bd91f4e0856fe68b36d8709065f80529902dda'
'SKIP'
'08b603acb19cf85f824e2e05ee7f2cd720ee46e488042498e4ef671e2a341c8f6ca22ef4f76fab2c48ab4d99949990753b3489ddaf20f08d3a9145899140d3aa'
'e5b98b635f0bbc36aafd180a8fc683a5aac5f6f06b245b71e9ab536f180538330c279bdc0c33a898d5adb3bb1d1feb0746f577eba2ce6ce1a915a3fba3c24568'
'1a71752d98adf3759077a0f93483a4051af9365dbd40626fb96897eb65a0ee29e3b9fc77fdd9bdc68fd257247e7e4c97c3052efbbeacbde5329ce0790373c8c2'
'56453fec090b7f64ae55d7938fdeda50f5746354a5f179992e7edcde150a610039a35ec4d5f0bb88436b5db5fb5c7dd072731166abaab7dcffc1a14c258d81fb'
'dd5d6e640ba71ea84617b856ee0dc9a222fbcbdf506e75ce4777b7f2280af4c8f27a5f03c1fc0c173f455d1b85d18d0a779ff95a1df1d06ae5db1848c43a4e54'
'ff39077b1c6e8f1b348e2bf3f6d1801fb69bfb37f25f2a8d935b5456bc38da7528309cd7d5f279205d77759b80f4746be1ab5c25e3c7ee9536aa5a72c096fc8d'
'486e60b1d470c64d07d4686bd0b4374924967b9e024ff6d9fe248f512995ece19b8b09dd69c91f26dec4bb92c61fc3d275a2b7e481c2acd10ebb90d7e3cb7e20'
'278f5e4de3aa1170d9b4f9f212985d664f44d90ffec727febeeea1ed570046c6469558a5d123a41bf4c2fdf99dbe7832515b06f1ace423c63e2e95ba6d0ef235')
validpgpkeys=('19E2D6D9B46D8DAA6288F877C24E631BABB1FE70') # Jussi Pakkanen <jpakkane@gmail.com>
pkgver() {
cd ${pkgname}
git describe --tags | sed 's/-/+/g'
}
prepare() {
cd ${pkgname}
cd ${pkgname}-${pkgver}
# Backports from 0.60 branch
patch -Np1 -i ../0001-i18n-merge_file-deprecate-positional-arguments.patch
patch -Np1 -i ../0002-test_clang_format-Do-not-assume-meson-source-is-in-g.patch
patch -Np1 -i ../0003-modules-gnome-ensure-that-install_dir-is-set.patch
patch -Np1 -i ../0004-modules-gnome-fix-missing-install_dir-again-harder.patch
patch -Np1 -i ../0005-modules-gnome-use-install_dir-instead-of-false.patch
patch -Np1 -i ../0006-mtest-accept-very-long-lines.patch
# Our containers do not allow sanitizers to run
git apply -3 ../skip-test.diff
patch -Np1 -i ../skip-test.diff
}
build() {
cd ${pkgname}
cd ${pkgname}-${pkgver}
python setup.py build
}
check() (
cd ${pkgname}
cd ${pkgname}-${pkgver}
export LC_CTYPE=en_US.UTF-8 CPPFLAGS= CFLAGS= CXXFLAGS= LDFLAGS=
./run_tests.py
)
package() {
cd ${pkgname}
cd ${pkgname}-${pkgver}
python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
install -d "${pkgdir}/usr/share/vim/vimfiles"