From 24a3e728ce444559374e6cf3fb4f74968fba29cc Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 24 Oct 2023 16:46:36 +0100 Subject: [PATCH 1/4] build: Bump Meson dependency to 1.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit And update all the CI builds to use the latest micro release from that series, 1.2.3. This version bump means we can: - Drop some backwards-compatibility Meson checks - Fix a periodic CI failure caused by a now-fixed Meson bug (https://github.com/mesonbuild/meson/pull/10633) It’s in line with our [Meson version policy](./docs/meson-version.md), as Meson 1.2.1 is available in [Debian Trixie](https://packages.debian.org/source/trixie/meson) and the [freedesktop SDK](https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/blob/c95902f2ed5cb7d9b8e352135facc539029ef6c9/elements/components/meson.bst). Signed-off-by: Philip Withnall --- .gitlab-ci.yml | 8 ++++---- .gitlab-ci/debian-stable.Dockerfile | 2 +- .gitlab-ci/fedora.Dockerfile | 2 +- .gitlab-ci/mingw.Dockerfile | 2 +- .gitlab-ci/test-msvc.bat | 2 +- .gitlab-ci/test-msys2.sh | 2 +- meson.build | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9d99d51de..d2b627de1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,10 +11,10 @@ cache: - _ccache/ variables: - FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v21" + FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v22" COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v7" - DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v15" - MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v11" + DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v16" + MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v12" MESON_TEST_TIMEOUT_MULTIPLIER: 4 G_MESSAGES_DEBUG: all MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload --fatal-meson-warnings" @@ -574,7 +574,7 @@ macos-x86_64: - ln -s /opt/cmake/CMake.app/Contents/bin/cmake .venv/bin - ln -s /opt/ccache/ccache .venv/bin - source .venv/bin/activate - - pip3 install meson==1.2.0 + - pip3 install meson==1.2.3 - pip3 install ninja==1.11.1 script: # FIXME: Use --wrap-mode=default so we download dependencies each time, diff --git a/.gitlab-ci/debian-stable.Dockerfile b/.gitlab-ci/debian-stable.Dockerfile index e6a2c7188..592a6b356 100644 --- a/.gitlab-ci/debian-stable.Dockerfile +++ b/.gitlab-ci/debian-stable.Dockerfile @@ -68,7 +68,7 @@ RUN locale-gen de_DE.UTF-8 \ ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8 -RUN pip3 install --break-system-packages meson==0.60.3 +RUN pip3 install --break-system-packages meson==1.2.3 ARG HOST_USER_ID=5555 ENV HOST_USER_ID ${HOST_USER_ID} diff --git a/.gitlab-ci/fedora.Dockerfile b/.gitlab-ci/fedora.Dockerfile index edadf71a2..5e28542ab 100644 --- a/.gitlab-ci/fedora.Dockerfile +++ b/.gitlab-ci/fedora.Dockerfile @@ -75,7 +75,7 @@ RUN dnf -y update \ make \ && dnf clean all -RUN pip3 install meson==0.60.3 +RUN pip3 install meson==1.2.3 COPY install-gitlab-cobertura-tools.sh . RUN ./install-gitlab-cobertura-tools.sh diff --git a/.gitlab-ci/mingw.Dockerfile b/.gitlab-ci/mingw.Dockerfile index 6ebd452a7..d801255ce 100644 --- a/.gitlab-ci/mingw.Dockerfile +++ b/.gitlab-ci/mingw.Dockerfile @@ -1,4 +1,4 @@ -FROM registry.gitlab.gnome.org/gnome/glib/fedora:v21 +FROM registry.gitlab.gnome.org/gnome/glib/fedora:v22 USER root diff --git a/.gitlab-ci/test-msvc.bat b/.gitlab-ci/test-msvc.bat index aee77d33d..2de8811ca 100644 --- a/.gitlab-ci/test-msvc.bat +++ b/.gitlab-ci/test-msvc.bat @@ -12,7 +12,7 @@ for %%x in (%*) do ( set args=%args:~1% :: FIXME: make warnings fatal -pip3 install --upgrade --user meson==1.0.0 || goto :error +pip3 install --upgrade --user meson==1.2.3 || goto :error meson setup %args% _build || goto :error python .gitlab-ci/check-missing-install-tag.py _build || goto :error meson compile -C _build || goto :error diff --git a/.gitlab-ci/test-msys2.sh b/.gitlab-ci/test-msys2.sh index 20032c4b4..3735b4c03 100755 --- a/.gitlab-ci/test-msys2.sh +++ b/.gitlab-ci/test-msys2.sh @@ -26,7 +26,7 @@ CCACHE_BASEDIR="$(pwd)" CCACHE_DIR="${CCACHE_BASEDIR}/_ccache" export CCACHE_BASEDIR CCACHE_DIR -pip3 install --upgrade --user meson==1.0.0 +pip3 install --upgrade --user meson==1.2.3 PATH="$(cygpath "$USERPROFILE")/.local/bin:$HOME/.local/bin:$PATH" DIR="$(pwd)" diff --git a/meson.build b/meson.build index d788cdfe1..6cab237d2 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('glib', 'c', version : '2.79.0', # NOTE: See the policy in docs/meson-version.md before changing the Meson dependency - meson_version : '>= 0.60.0', + meson_version : '>= 1.2.0', default_options : [ 'buildtype=debugoptimized', 'warning_level=3', From 8831f65a4d7f1a17787e2bd5b9a50dcf0a481f25 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Tue, 24 Oct 2023 16:48:23 +0100 Subject: [PATCH 2/4] build: Drop a no-longer-needed Meson backwards compatibility check See the previous commit. Signed-off-by: Philip Withnall --- gio/meson.build | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/gio/meson.build b/gio/meson.build index f8bcc4864..26e9b7b05 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -1086,20 +1086,11 @@ endif if multiarch_bindir != get_option('bindir') foreach exe : ['gio-querymodules', 'glib-compile-schemas'] - if meson.version().version_compare('>=0.61.0') - install_symlink( - exe, - install_dir : get_option('bindir'), - pointing_to : get_option('prefix') / multiarch_bindir / exe, - ) - else - warning( - 'Please use Meson >= 0.61.0 or create a symlink @1@ -> @2@ in packaging'.format( - get_option('prefix') / get_option('bindir') / exe, - get_option('prefix') / multiarch_bindir / exe, - ) - ) - endif + install_symlink( + exe, + install_dir : get_option('bindir'), + pointing_to : get_option('prefix') / multiarch_bindir / exe, + ) endforeach endif From 4ce58df8540f25f823418a1d45ddb07ada52ec22 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 25 Oct 2023 11:20:36 +0100 Subject: [PATCH 3/4] build: Change configure_file() to fs.copyfile() when copy is set Meson has preferred `fs.copyfile()` since 0.62. This fixes a set of Meson warnings. Signed-off-by: Philip Withnall --- docs/reference/gio/meson.build | 6 +----- gio/gdbus-2.0/codegen/meson.build | 8 ++++---- gio/meson.build | 2 ++ gio/tests/meson.build | 5 +---- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/docs/reference/gio/meson.build b/docs/reference/gio/meson.build index bdcdde601..0c4991377 100644 --- a/docs/reference/gio/meson.build +++ b/docs/reference/gio/meson.build @@ -154,11 +154,7 @@ if get_option('gtk_doc') command : [concat_files_helper, '@OUTPUT@', '@INPUT@'], ) - configure_file( - output : 'gio-docs-platform.xml', - input : platform_file, - copy : true, - ) + fs.copyfile(platform_file, 'gio-docs-platform.xml') content_files = [ 'migrating-posix.xml', diff --git a/gio/gdbus-2.0/codegen/meson.build b/gio/gdbus-2.0/codegen/meson.build index 65faae9b2..984698e2f 100644 --- a/gio/gdbus-2.0/codegen/meson.build +++ b/gio/gdbus-2.0/codegen/meson.build @@ -30,6 +30,7 @@ meson.override_find_program('gdbus-codegen', gdbus_codegen) codegen_dir = join_paths(glib_datadir, 'glib-2.0', 'codegen') gdbus_codegen_built_files = [] +gdbus_codegen_built_targets = [] gdbus_codegen_built_files += configure_file(input : 'config.py.in', output : 'config.py', install_dir : codegen_dir, @@ -39,8 +40,7 @@ gdbus_codegen_built_files += configure_file(input : 'config.py.in', foreach f : gdbus_codegen_files # Copy these into the builddir so that gdbus-codegen can be used uninstalled # and then install it too so that it can be used after installation - gdbus_codegen_built_files += configure_file(input : f, output : f, - install_dir : codegen_dir, - install_tag : 'bin-devel', - copy : true) + gdbus_codegen_built_targets += fs.copyfile(f, f, + install_dir : codegen_dir, + install_tag : 'bin-devel') endforeach diff --git a/gio/meson.build b/gio/meson.build index 26e9b7b05..9cdde1098 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -242,6 +242,7 @@ xdp_dbus_generated = custom_target('xdp-dbus', 'org.freedesktop.portal.Trash.xml'], output : ['xdp-dbus.h', 'xdp-dbus.c'], depend_files : gdbus_codegen_built_files, + depends : gdbus_codegen_built_targets, command : [python, gdbus_codegen, '--interface-prefix', 'org.freedesktop.portal.', '--output-directory', '@OUTDIR@', @@ -254,6 +255,7 @@ gdbus_daemon_generated = custom_target('gdbus-daemon-generated', input : ['dbus-daemon.xml'], output : ['gdbus-daemon-generated.h', 'gdbus-daemon-generated.c'], depend_files : gdbus_codegen_built_files, + depends : gdbus_codegen_built_targets, command : [python, gdbus_codegen, '--interface-prefix', 'org.', '--output-directory', '@OUTDIR@', diff --git a/gio/tests/meson.build b/gio/tests/meson.build index aaf341691..bc436fb79 100644 --- a/gio/tests/meson.build +++ b/gio/tests/meson.build @@ -890,10 +890,7 @@ if not meson.is_cross_build() '@INPUT@']) # referenced by test.gresource.xml - test_generated_txt = configure_file(input : 'test1.txt', - output : 'test-generated.txt', - copy : true, - ) + test_generated_txt = fs.copyfile('test1.txt', 'test-generated.txt') resources_extra_sources = [ test_gresource, From 7fd904506515f3defebfd5b8d771e87524f1e0da Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 25 Oct 2023 11:21:24 +0100 Subject: [PATCH 4/4] build: Drop pkgconfig.generate variables for builtin directories Meson has added these automatically since 0.62. This fixes a Meson warning. Signed-off-by: Philip Withnall --- gio/meson.build | 2 -- glib/meson.build | 2 -- 2 files changed, 4 deletions(-) diff --git a/gio/meson.build b/gio/meson.build index 9cdde1098..9f7c220f5 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -883,10 +883,8 @@ libgio_dep = declare_dependency(link_with : libgio, pkg.generate(libgio, requires : ['glib-2.0', 'gobject-2.0'], variables : [ - 'datadir=' + '${prefix}' / get_option('datadir'), 'schemasdir=' + '${datadir}' / schemas_subdir, 'dtdsdir=' + '${datadir}' / dtds_subdir, - 'bindir=' + '${prefix}' / get_option('bindir'), 'giomoduledir=' + pkgconfig_giomodulesdir, 'gio=' + '${bindir}' / 'gio', 'gio_querymodules=' + pkgconfig_multiarch_bindir / 'gio-querymodules', diff --git a/glib/meson.build b/glib/meson.build index 12fb12ff2..5940e6bc3 100644 --- a/glib/meson.build +++ b/glib/meson.build @@ -445,8 +445,6 @@ pkg.generate(libglib, subdirs : ['glib-2.0'], extra_cflags : ['-I${libdir}/glib-2.0/include'] + win32_cflags, variables : [ - 'bindir=' + '${prefix}' / get_option('bindir'), - 'datadir=' + '${prefix}' / get_option('datadir'), 'glib_genmarshal=' + '${bindir}' / 'glib-genmarshal', 'gobject_query=' + '${bindir}' / 'gobject-query', 'glib_mkenums=' + '${bindir}' / 'glib-mkenums',