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.
This commit is contained in:
Benjamin Gilbert 2024-09-05 04:31:09 -07:00 committed by Philip Withnall
parent b7203e9406
commit 51e3e7d9ae
9 changed files with 22 additions and 25 deletions

View File

@ -11,11 +11,11 @@ cache:
- _ccache/ - _ccache/
variables: 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" COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v7"
DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v19" DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v20"
ALPINE_IMAGE: "registry.gitlab.gnome.org/gnome/glib/alpine:v3" ALPINE_IMAGE: "registry.gitlab.gnome.org/gnome/glib/alpine:v4"
MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v39.1" MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v39.2"
GOBJECT_INTROSPECTION_TAG: "1.80.1" GOBJECT_INTROSPECTION_TAG: "1.80.1"
MESON_TEST_TIMEOUT_MULTIPLIER: 4 MESON_TEST_TIMEOUT_MULTIPLIER: 4
G_MESSAGES_DEBUG: all G_MESSAGES_DEBUG: all
@ -284,12 +284,7 @@ hurd-i386:
- hurd - hurd
needs: [] needs: []
script: script:
# FIXME: We cant use ${MESON_COMMON_OPTIONS} here because the Hurd runner - meson setup ${MESON_COMMON_OPTIONS}
# has Meson 1.3 installed. See the comment below about the same problem on
# FreeBSD.
- meson setup
--buildtype debug
--wrap-mode=nodownload
--werror --werror
--default-library=both --default-library=both
--prefix=$HOME/glib-installed --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/cmake/CMake.app/Contents/bin/cmake .venv/bin
- ln -s /opt/ccache/ccache .venv/bin - ln -s /opt/ccache/ccache .venv/bin
- source .venv/bin/activate - source .venv/bin/activate
- pip3 install meson==1.2.3 - pip3 install meson==1.4.2
- pip3 install ninja==1.11.1 - pip3 install ninja==1.11.1
script: script:
# FIXME: Use --wrap-mode=default so we download dependencies each time, # FIXME: Use --wrap-mode=default so we download dependencies each time,
@ -721,8 +716,11 @@ macos-x86_64:
# already contains the dependencies. See: # already contains the dependencies. See:
# - https://gitlab.gnome.org/GNOME/glib/merge_requests/388 # - https://gitlab.gnome.org/GNOME/glib/merge_requests/388
# - https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/225 # - 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} - meson setup ${MESON_COMMON_OPTIONS}
--wrap-mode=default --wrap-mode=default
-Dc_std=gnu99
--werror --werror
_build _build
- meson compile -C _build - meson compile -C _build

View File

@ -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 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 ARG HOST_USER_ID=5555
ENV HOST_USER_ID ${HOST_USER_ID} ENV HOST_USER_ID ${HOST_USER_ID}

View File

@ -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 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 ARG HOST_USER_ID=5555
ENV HOST_USER_ID ${HOST_USER_ID} ENV HOST_USER_ID ${HOST_USER_ID}

View File

@ -79,7 +79,7 @@ RUN dnf -y update \
make \ make \
&& dnf clean all && dnf clean all
RUN pip3 install meson==1.2.3 RUN pip3 install meson==1.4.2
COPY install-gitlab-cobertura-tools.sh . COPY install-gitlab-cobertura-tools.sh .
RUN ./install-gitlab-cobertura-tools.sh RUN ./install-gitlab-cobertura-tools.sh

View File

@ -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 USER root

View File

@ -12,7 +12,7 @@ for %%x in (%*) do (
set args=%args:~1% set args=%args:~1%
:: FIXME: make warnings fatal :: 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 setup %args% _build || goto :error
meson compile -C _build || goto :error meson compile -C _build || goto :error

View File

@ -7,7 +7,7 @@ common_gio_tests_deps = [
test_c_args = [ test_c_args = [
'-DG_LOG_DOMAIN="GLib-GIO"', '-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()), '-DGLIB_COMPILE_SCHEMAS="@0@"'.format(glib_compile_schemas.full_path()),
'-UG_DISABLE_ASSERT', '-UG_DISABLE_ASSERT',
] ]

View File

@ -242,14 +242,14 @@ gio_gir_args = [
if host_system == 'windows' if host_system == 'windows'
gio_gir_sources += [ gio_win32_include_headers, win32_sources ] gio_gir_sources += [ gio_win32_include_headers, win32_sources ]
foreach h: gio_win32_include_headers foreach h: gio_win32_include_headers
gio_gir_args += '--c-include=@0@'.format(h) gio_gir_args += '--c-include=' + h.full_path()
endforeach endforeach
gio_gir_packages += 'gio-windows-2.0' gio_gir_packages += 'gio-windows-2.0'
gio_gir_args += '--pkg=gio-windows-2.0' gio_gir_args += '--pkg=gio-windows-2.0'
else else
gio_gir_sources += [ gio_unix_include_headers, unix_sources ] gio_gir_sources += [ gio_unix_include_headers, unix_sources ]
foreach h: gio_unix_include_headers foreach h: gio_unix_include_headers
gio_gir_args += '--c-include=@0@'.format(h) gio_gir_args += '--c-include=' + h.full_path()
endforeach endforeach
gio_gir_packages += 'gio-unix-2.0' gio_gir_packages += 'gio-unix-2.0'
gio_gir_args += '--pkg=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' if host_system == 'windows'
gio_win32_gir_c_includes = [] gio_win32_gir_c_includes = []
foreach h: gio_win32_include_headers 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 endforeach
gio_win32_gir = gnome.generate_gir(libgio, gio_win32_gir = gnome.generate_gir(libgio,
@ -308,7 +308,7 @@ if host_system == 'windows'
else else
gio_unix_gir_c_includes = [] gio_unix_gir_c_includes = []
foreach h: gio_unix_include_headers 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 endforeach
gio_unix_gir = gnome.generate_gir(libgio, gio_unix_gir = gnome.generate_gir(libgio,

View File

@ -1,11 +1,11 @@
project('glib', 'c', project('glib', 'c',
version : '2.83.0', version : '2.83.0',
# NOTE: See the policy in docs/meson-version.md before changing the Meson dependency # 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 : [ default_options : [
'buildtype=debugoptimized', 'buildtype=debugoptimized',
'warning_level=3', 'warning_level=3',
'c_std=gnu99' 'c_std=gnu99,c99'
] ]
) )
@ -222,8 +222,7 @@ if valgrind.found()
'--num-callers=50', '--num-callers=50',
'--show-leak-kinds=definite,possible', '--show-leak-kinds=definite,possible',
'--show-error-list=yes', '--show-error-list=yes',
'--suppressions=@0@'.format(meson.project_source_root() / '--suppressions=' + valgrind_suppression_file.full_path(),
'@0@'.format(valgrind_suppression_file)),
], ],
env: common_test_env, env: common_test_env,
timeout_multiplier: 20, timeout_multiplier: 20,