From 51e3e7d9ae330cd798604d0bd1ac70d0daa93681 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Thu, 5 Sep 2024 04:31:09 -0700 Subject: [PATCH] build: Bump Meson dependency to 1.4.0 Meson 1.5.1 is available in the fd.o SDK and in Debian testing, so the glib Meson policy says we can update. Update the minimum only as far as 1.4.0 because we don't yet have a need for 1.5.0. This allows us to: - Use file.full_path() to avoid deprecation warnings on str.format(file). - Set c_std=gnu99,c99 to avoid deprecation warnings with gnu99 on MSVC. Update all the CI builds to use the latest 1.4.x patch release, 1.4.2. The FreeBSD runner cannot be updated via `gitlab-ci.yml`, so will be broken for now. Similarly, the macOS build will not work unless `-Dc_std=gnu99` is specified at configure time, due to https://github.com/mesonbuild/meson/issues/13639. --- .gitlab-ci.yml | 20 +++++++++----------- .gitlab-ci/alpine.Dockerfile | 2 +- .gitlab-ci/debian-stable.Dockerfile | 2 +- .gitlab-ci/fedora.Dockerfile | 2 +- .gitlab-ci/mingw.Dockerfile | 2 +- .gitlab-ci/test-msvc.bat | 2 +- gio/tests/meson.build | 2 +- girepository/introspection/meson.build | 8 ++++---- meson.build | 7 +++---- 9 files changed, 22 insertions(+), 25 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5113c2213..132aadca2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,11 +11,11 @@ cache: - _ccache/ variables: - FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v39.1" + FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v39.2" COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v7" - DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v19" - ALPINE_IMAGE: "registry.gitlab.gnome.org/gnome/glib/alpine:v3" - MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v39.1" + DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v20" + ALPINE_IMAGE: "registry.gitlab.gnome.org/gnome/glib/alpine:v4" + MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v39.2" GOBJECT_INTROSPECTION_TAG: "1.80.1" MESON_TEST_TIMEOUT_MULTIPLIER: 4 G_MESSAGES_DEBUG: all @@ -284,12 +284,7 @@ hurd-i386: - hurd needs: [] script: - # FIXME: We can’t use ${MESON_COMMON_OPTIONS} here because the Hurd runner - # has Meson 1.3 installed. See the comment below about the same problem on - # FreeBSD. - - meson setup - --buildtype debug - --wrap-mode=nodownload + - meson setup ${MESON_COMMON_OPTIONS} --werror --default-library=both --prefix=$HOME/glib-installed @@ -713,7 +708,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.3 + - pip3 install meson==1.4.2 - pip3 install ninja==1.11.1 script: # FIXME: Use --wrap-mode=default so we download dependencies each time, @@ -721,8 +716,11 @@ macos-x86_64: # already contains the dependencies. See: # - https://gitlab.gnome.org/GNOME/glib/merge_requests/388 # - https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/225 + # FIXME: Override c_std to not be a list, until + # https://github.com/mesonbuild/meson/issues/13639 is fixed. - meson setup ${MESON_COMMON_OPTIONS} --wrap-mode=default + -Dc_std=gnu99 --werror _build - meson compile -C _build diff --git a/.gitlab-ci/alpine.Dockerfile b/.gitlab-ci/alpine.Dockerfile index 8043a1075..aae7f9441 100644 --- a/.gitlab-ci/alpine.Dockerfile +++ b/.gitlab-ci/alpine.Dockerfile @@ -25,7 +25,7 @@ RUN apk add --no-cache \ ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8 MUSL_LOCPATH=/usr/share/i18n/locales/musl -RUN pip3 install --break-system-packages meson==1.2.3 +RUN pip3 install --break-system-packages meson==1.4.2 ARG HOST_USER_ID=5555 ENV HOST_USER_ID ${HOST_USER_ID} diff --git a/.gitlab-ci/debian-stable.Dockerfile b/.gitlab-ci/debian-stable.Dockerfile index cdcfdc293..81b5b4762 100644 --- a/.gitlab-ci/debian-stable.Dockerfile +++ b/.gitlab-ci/debian-stable.Dockerfile @@ -71,7 +71,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==1.2.3 +RUN pip3 install --break-system-packages meson==1.4.2 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 745d804b5..0ce84fdd1 100644 --- a/.gitlab-ci/fedora.Dockerfile +++ b/.gitlab-ci/fedora.Dockerfile @@ -79,7 +79,7 @@ RUN dnf -y update \ make \ && dnf clean all -RUN pip3 install meson==1.2.3 +RUN pip3 install meson==1.4.2 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 64ad06e72..034f69a0f 100644 --- a/.gitlab-ci/mingw.Dockerfile +++ b/.gitlab-ci/mingw.Dockerfile @@ -1,4 +1,4 @@ -FROM registry.gitlab.gnome.org/gnome/glib/fedora:v39.1 +FROM registry.gitlab.gnome.org/gnome/glib/fedora:v39.2 USER root diff --git a/.gitlab-ci/test-msvc.bat b/.gitlab-ci/test-msvc.bat index 6fddb36a4..f96edb077 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.2.3 || goto :error +pip3 install --upgrade --user meson==1.4.2 || goto :error meson setup %args% _build || goto :error meson compile -C _build || goto :error diff --git a/gio/tests/meson.build b/gio/tests/meson.build index f2c11e360..731eb6e38 100644 --- a/gio/tests/meson.build +++ b/gio/tests/meson.build @@ -7,7 +7,7 @@ common_gio_tests_deps = [ test_c_args = [ '-DG_LOG_DOMAIN="GLib-GIO"', - '-DGLIB_MKENUMS="@0@"'.format(glib_mkenums), + '-DGLIB_MKENUMS="@0@"'.format(glib_mkenums.full_path()), '-DGLIB_COMPILE_SCHEMAS="@0@"'.format(glib_compile_schemas.full_path()), '-UG_DISABLE_ASSERT', ] diff --git a/girepository/introspection/meson.build b/girepository/introspection/meson.build index 8c9e23ec3..97fd73105 100644 --- a/girepository/introspection/meson.build +++ b/girepository/introspection/meson.build @@ -242,14 +242,14 @@ gio_gir_args = [ if host_system == 'windows' gio_gir_sources += [ gio_win32_include_headers, win32_sources ] foreach h: gio_win32_include_headers - gio_gir_args += '--c-include=@0@'.format(h) + gio_gir_args += '--c-include=' + h.full_path() endforeach gio_gir_packages += 'gio-windows-2.0' gio_gir_args += '--pkg=gio-windows-2.0' else gio_gir_sources += [ gio_unix_include_headers, unix_sources ] foreach h: gio_unix_include_headers - gio_gir_args += '--c-include=@0@'.format(h) + gio_gir_args += '--c-include=' + h.full_path() endforeach gio_gir_packages += 'gio-unix-2.0' gio_gir_args += '--pkg=gio-unix-2.0' @@ -278,7 +278,7 @@ gio_gir = gnome.generate_gir(libgio, if host_system == 'windows' gio_win32_gir_c_includes = [] foreach h: gio_win32_include_headers - gio_win32_gir_c_includes += '--c-include=@0@'.format(h) + gio_win32_gir_c_includes += '--c-include=' + h.full_path() endforeach gio_win32_gir = gnome.generate_gir(libgio, @@ -308,7 +308,7 @@ if host_system == 'windows' else gio_unix_gir_c_includes = [] foreach h: gio_unix_include_headers - gio_unix_gir_c_includes += '--c-include=@0@'.format(h) + gio_unix_gir_c_includes += '--c-include=' + h.full_path() endforeach gio_unix_gir = gnome.generate_gir(libgio, diff --git a/meson.build b/meson.build index 06e13edf4..34d36846d 100644 --- a/meson.build +++ b/meson.build @@ -1,11 +1,11 @@ project('glib', 'c', version : '2.83.0', # NOTE: See the policy in docs/meson-version.md before changing the Meson dependency - meson_version : '>= 1.2.0', + meson_version : '>= 1.4.0', default_options : [ 'buildtype=debugoptimized', 'warning_level=3', - 'c_std=gnu99' + 'c_std=gnu99,c99' ] ) @@ -222,8 +222,7 @@ if valgrind.found() '--num-callers=50', '--show-leak-kinds=definite,possible', '--show-error-list=yes', - '--suppressions=@0@'.format(meson.project_source_root() / - '@0@'.format(valgrind_suppression_file)), + '--suppressions=' + valgrind_suppression_file.full_path(), ], env: common_test_env, timeout_multiplier: 20,