From b646b1cab7a7b2e082058ab1e598ae8df48c697b Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 24 Nov 2022 12:06:10 +0000 Subject: [PATCH 1/5] Revert "meson: Use gnome.mkenum_simple()" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 756b424cce0ea7a0fe93b3a95c3529214ad70551. The freedesktop SDK, which is used by gnome-build-meta, only has Meson 0.63. Bumping GLib’s Meson dependency to 0.64 means that, at the moment, GLib is not buildable in gnome-build-meta and hence can’t be tested in nightly pipelines against other projects, etc. That’s bad for testing GLib. It’s arguably bad that we’re restricted to using an older version of Meson than shipped by Debian Testing, but that’s a separate discussion to be had. Revert the Meson 0.64 dependency until the freedesktop SDK ships Meson ≥ 0.64. This also means reverting the simplifications to use of `gnome.mkenum_simple()`. See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3077#note_1601064 --- gio/gio-autocleanups.h | 2 - gio/gioenumtypes.c.template | 63 +++++++++++++++++++++++++++++++ gio/gioenumtypes.h.template | 46 ++++++++++++++++++++++ gio/meson.build | 35 +++++++++++------ gobject/glib-enumtypes.c.template | 47 +++++++++++++++++++++++ gobject/glib-enumtypes.h.template | 24 ++++++++++++ gobject/meson.build | 37 ++++++++++-------- meson.build | 2 - 8 files changed, 226 insertions(+), 30 deletions(-) create mode 100644 gio/gioenumtypes.c.template create mode 100644 gio/gioenumtypes.h.template create mode 100644 gobject/glib-enumtypes.c.template create mode 100644 gobject/glib-enumtypes.h.template diff --git a/gio/gio-autocleanups.h b/gio/gio-autocleanups.h index 0f341c1cf..15e37d164 100644 --- a/gio/gio-autocleanups.h +++ b/gio/gio-autocleanups.h @@ -19,8 +19,6 @@ * Author: Ryan Lortie */ -#pragma once - #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION) #error "Only can be included directly." #endif diff --git a/gio/gioenumtypes.c.template b/gio/gioenumtypes.c.template new file mode 100644 index 000000000..5e119a342 --- /dev/null +++ b/gio/gioenumtypes.c.template @@ -0,0 +1,63 @@ +/*** BEGIN file-header ***/ +/* + * Copyright © 2007 Red Hat, Inc. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, see . + * + * Authors: Matthias Clasen + */ + +#ifndef GLIB_DISABLE_DEPRECATION_WARNINGS +#define GLIB_DISABLE_DEPRECATION_WARNINGS +#endif + +#include "config.h" +#include "gioenumtypes.h" +#include + +/*** END file-header ***/ + +/*** BEGIN file-production ***/ +/* enumerations from "@filename@" */ +/*** END file-production ***/ + +/*** BEGIN value-header ***/ +GType +@enum_name@_get_type (void) +{ + static gsize static_g_define_type_id = 0; + + if (g_once_init_enter (&static_g_define_type_id)) + { + static const G@Type@Value values[] = { +/*** END value-header ***/ + +/*** BEGIN value-production ***/ + { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, +/*** END value-production ***/ + +/*** BEGIN value-tail ***/ + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_@type@_register_static (g_intern_static_string ("@EnumName@"), values); + g_once_init_leave (&static_g_define_type_id, g_define_type_id); + } + + return static_g_define_type_id; +} + +/*** END value-tail ***/ diff --git a/gio/gioenumtypes.h.template b/gio/gioenumtypes.h.template new file mode 100644 index 000000000..c75a3b459 --- /dev/null +++ b/gio/gioenumtypes.h.template @@ -0,0 +1,46 @@ +/*** BEGIN file-header ***/ +/* + * Copyright © 2007 Red Hat, Inc. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, see . + * + * Authors: Matthias Clasen + */ + +#ifndef __GIO_ENUM_TYPES_H__ +#define __GIO_ENUM_TYPES_H__ + +#include +#include + +G_BEGIN_DECLS +/*** END file-header ***/ + +/*** BEGIN file-production ***/ + +/* enumerations from "@filename@" */ +/*** END file-production ***/ + +/*** BEGIN value-header ***/ +GIO_AVAILABLE_IN_ALL GType @enum_name@_get_type (void) G_GNUC_CONST; +#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) +/*** END value-header ***/ + +/*** BEGIN file-tail ***/ +G_END_DECLS + +#endif /* __GIO_ENUM_TYPES_H__ */ +/*** END file-tail ***/ diff --git a/gio/meson.build b/gio/meson.build index 076dfc07f..07ef31b93 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -765,16 +765,29 @@ gio_headers += settings_headers gio_headers += gdbus_headers install_headers(gio_headers, install_dir : gio_includedir) -mkenums_header_prefix = '#include ' -gioenumtypes = gnome.mkenums_simple('gioenumtypes', - sources : gio_headers, - decorator : 'GIO_AVAILABLE_IN_ALL', - body_prefix : mkenums_body_prefix, - header_prefix : mkenums_header_prefix, - install_header : true, - install_dir : join_paths(get_option('includedir'), 'glib-2.0/gio'), -) -gioenumtypes_h = gioenumtypes[1] +# We can't use gnome.mkenums() because the GNOME module looks for glib-mkenums +# in PATH, which means you can't bootstrap glib with its own glib-mkenums. +gioenumtypes_h = custom_target('gioenumtypes_h', + output : 'gioenumtypes.h', + capture : true, + input : gio_headers, + install : true, + install_dir : gio_includedir, + # FIXME: Not needed with Meson >= 0.64.0 + install_tag: 'devel', + command : [python, glib_mkenums, + '--template', files('gioenumtypes.h.template'), + '@INPUT@', gnetworking_h]) + +gioenumtypes_c = custom_target('gioenumtypes_c', + output : 'gioenumtypes.c', + capture : true, + input : gio_headers, + depends : [gioenumtypes_h], + command : [python, glib_mkenums, + '--template', files('gioenumtypes.c.template'), + '@INPUT@', gnetworking_h]) + gioenumtypes_dep = declare_dependency(sources : [gioenumtypes_h, glib_enumtypes_h, gvisibility_h]) # inotify @@ -827,7 +840,7 @@ else endif libgio = library('gio-2.0', - gioenumtypes, gnetworking_h, gio_sources, + gioenumtypes_h, gioenumtypes_c, gnetworking_h, gio_sources, gio_dtrace_hdr, gio_dtrace_obj, version : library_version, soversion : soversion, diff --git a/gobject/glib-enumtypes.c.template b/gobject/glib-enumtypes.c.template new file mode 100644 index 000000000..42f9c341f --- /dev/null +++ b/gobject/glib-enumtypes.c.template @@ -0,0 +1,47 @@ +/*** BEGIN file-header ***/ +#include "config.h" +#include "glib-enumtypes.h" +#include + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + +/*** END file-header ***/ + +/*** BEGIN file-tail ***/ + +G_GNUC_END_IGNORE_DEPRECATIONS + +/*** END file-tail ***/ + +/*** BEGIN file-production ***/ +/* enumerations from "@filename@" */ + +/*** END file-production ***/ + +/*** BEGIN value-header ***/ +GType +@enum_name@_get_type (void) +{ + static gsize static_g_define_type_id = 0; + + if (g_once_init_enter (&static_g_define_type_id)) + { + static const G@Type@Value values[] = { +/*** END value-header ***/ + +/*** BEGIN value-production ***/ + { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, +/*** END value-production ***/ + +/*** BEGIN value-tail ***/ + { 0, NULL, NULL } + }; + GType g_define_type_id = + g_@type@_register_static (g_intern_static_string ("@EnumName@"), values); + g_once_init_leave (&static_g_define_type_id, g_define_type_id); + } + + return static_g_define_type_id; +} + +/*** END value-tail ***/ diff --git a/gobject/glib-enumtypes.h.template b/gobject/glib-enumtypes.h.template new file mode 100644 index 000000000..f907d9cae --- /dev/null +++ b/gobject/glib-enumtypes.h.template @@ -0,0 +1,24 @@ +/*** BEGIN file-header ***/ +#ifndef __GOBJECT_ENUM_TYPES_H__ +#define __GOBJECT_ENUM_TYPES_H__ + +#include + +G_BEGIN_DECLS +/*** END file-header ***/ + +/*** BEGIN file-production ***/ + +/* enumerations from "@filename@" */ +/*** END file-production ***/ + +/*** BEGIN value-header ***/ +GOBJECT_AVAILABLE_IN_2_60 GType @enum_name@_get_type (void) G_GNUC_CONST; +#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) +/*** END value-header ***/ + +/*** BEGIN file-tail ***/ +G_END_DECLS + +#endif /* __GOBJECT_ENUM_TYPES_H__ */ +/*** END file-tail ***/ diff --git a/gobject/meson.build b/gobject/meson.build index 07ad13229..dafc44b09 100644 --- a/gobject/meson.build +++ b/gobject/meson.build @@ -109,32 +109,39 @@ endforeach # # For now, we only include gunicode.h here, since GScriptType is needed for # Pango. More headers can be added as needed in future. +# +# We can't use gnome.mkenums() because the GNOME module looks for glib-mkenums +# in PATH, which means you can't bootstrap glib with its own glib-mkenums. glib_enumtypes_input_headers = files( '../glib/gunicode.h', ) -mkenums_body_prefix = ''' - #ifndef GLIB_DISABLE_DEPRECATION_WARNINGS - #define GLIB_DISABLE_DEPRECATION_WARNINGS - #endif - #include "config.h" -''' - -glib_enumtypes = gnome.mkenums_simple('glib-enumtypes', - sources : glib_enumtypes_input_headers, - decorator : 'GOBJECT_AVAILABLE_IN_2_60', - body_prefix : mkenums_body_prefix, - install_header : true, +glib_enumtypes_h = custom_target('glib_enumtypes_h', + output : 'glib-enumtypes.h', + capture : true, + input : glib_enumtypes_input_headers, + install : true, install_dir : join_paths(get_option('includedir'), 'glib-2.0/gobject'), -) -glib_enumtypes_h = glib_enumtypes[1] + install_tag: 'devel', + command : [python, glib_mkenums, + '--template', files('glib-enumtypes.h.template'), + '@INPUT@']) + +glib_enumtypes_c = custom_target('glib_enumtypes_c', + output : 'glib-enumtypes.c', + capture : true, + input : glib_enumtypes_input_headers, + depends : [glib_enumtypes_h], + command : [python, glib_mkenums, + '--template', files('glib-enumtypes.c.template'), + '@INPUT@']) # Expose as variable to be used by gobject-introspection # when it includes GLib as a subproject glib_types_h = files('glib-types.h') libgobject = library('gobject-2.0', - gobject_dtrace_obj, gobject_dtrace_hdr, glib_enumtypes, + gobject_dtrace_obj, gobject_dtrace_hdr, glib_enumtypes_h, glib_enumtypes_c, sources : gobject_sources, version : library_version, soversion : soversion, diff --git a/meson.build b/meson.build index 9b2f296a4..996056f7d 100644 --- a/meson.build +++ b/meson.build @@ -9,8 +9,6 @@ project('glib', 'c', ] ) -gnome = import('gnome') - cc = meson.get_compiler('c') c_standards = {} From b4231844a27352062324a2486f0169315aef5a9c Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 24 Nov 2022 12:09:55 +0000 Subject: [PATCH 2/5] Revert "build: Use fs.copyfile() instead of configure_file()" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 19353017a786e90e00c29890ba6ca2ef88798df4. The freedesktop SDK, which is used by gnome-build-meta, only has Meson 0.63. Bumping GLib’s Meson dependency to 0.64 means that, at the moment, GLib is not buildable in gnome-build-meta and hence can’t be tested in nightly pipelines against other projects, etc. That’s bad for testing GLib. It’s arguably bad that we’re restricted to using an older version of Meson than shipped by Debian Testing, but that’s a separate discussion to be had. Revert the Meson 0.64 dependency until the freedesktop SDK ships Meson ≥ 0.64. This also means reverting the simplifications to use of `gnome.mkenum_simple()`. See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3077#note_1601064 --- docs/reference/gio/meson.build | 6 +++++- gio/gdbus-2.0/codegen/meson.build | 11 ++++++----- gio/meson.build | 6 ++---- gio/tests/meson.build | 25 +++++++++++-------------- meson.build | 1 - 5 files changed, 24 insertions(+), 25 deletions(-) diff --git a/docs/reference/gio/meson.build b/docs/reference/gio/meson.build index c93764388..35f0ba552 100644 --- a/docs/reference/gio/meson.build +++ b/docs/reference/gio/meson.build @@ -155,7 +155,11 @@ if get_option('gtk_doc') command : [concat_files_helper, '@OUTPUT@', '@INPUT@'], ) - fs.copyfile(platform_file, 'gio-docs-platform.xml') + configure_file( + output : 'gio-docs-platform.xml', + input : platform_file, + copy : true, + ) content_files = [ 'overview.xml', diff --git a/gio/gdbus-2.0/codegen/meson.build b/gio/gdbus-2.0/codegen/meson.build index 124ff5357..16abd97d6 100644 --- a/gio/gdbus-2.0/codegen/meson.build +++ b/gio/gdbus-2.0/codegen/meson.build @@ -28,17 +28,18 @@ meson.override_find_program('gdbus-codegen', gdbus_codegen) codegen_dir = join_paths(glib_datadir, 'glib-2.0', 'codegen') -gdbus_codegen_depend_files = configure_file(input : 'config.py.in', +gdbus_codegen_built_files = [] +gdbus_codegen_built_files += configure_file(input : 'config.py.in', output : 'config.py', install_dir : codegen_dir, install_tag : 'bin-devel', configuration : gdbus_codegen_conf) -gdbus_codegen_depends = [] 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_depends += fs.copyfile(f, - install_dir : codegen_dir, - install_tag : 'bin-devel') + gdbus_codegen_built_files += configure_file(input : f, output : f, + install_dir : codegen_dir, + install_tag : 'bin-devel', + copy : true) endforeach diff --git a/gio/meson.build b/gio/meson.build index 07ef31b93..24d44989d 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -240,8 +240,7 @@ xdp_dbus_generated = custom_target('xdp-dbus', 'org.freedesktop.portal.ProxyResolver.xml', 'org.freedesktop.portal.Trash.xml'], output : ['xdp-dbus.h', 'xdp-dbus.c'], - depends : gdbus_codegen_depends, - depend_files : gdbus_codegen_depend_files, + depend_files : gdbus_codegen_built_files, command : [python, gdbus_codegen, '--interface-prefix', 'org.freedesktop.portal.', '--output-directory', '@OUTDIR@', @@ -253,8 +252,7 @@ xdp_dbus_generated = custom_target('xdp-dbus', gdbus_daemon_generated = custom_target('gdbus-daemon-generated', input : ['dbus-daemon.xml'], output : ['gdbus-daemon-generated.h', 'gdbus-daemon-generated.c'], - depends : gdbus_codegen_depends, - depend_files : gdbus_codegen_depend_files, + depend_files : gdbus_codegen_built_files, command : [python, gdbus_codegen, '--interface-prefix', 'org.', '--output-directory', '@OUTDIR@', diff --git a/gio/tests/meson.build b/gio/tests/meson.build index 78b7f87b4..da4161766 100644 --- a/gio/tests/meson.build +++ b/gio/tests/meson.build @@ -308,8 +308,7 @@ if host_machine.system() != 'windows' input : ['test-codegen.xml'], output : ['gdbus-test-codegen-generated.h', 'gdbus-test-codegen-generated.c'], - depends : gdbus_codegen_depends, - depend_files : gdbus_codegen_depend_files, + depend_files : gdbus_codegen_built_files, command : [python, gdbus_codegen, '--interface-prefix', 'org.project.', '--output-directory', '@OUTDIR@', @@ -325,8 +324,7 @@ if host_machine.system() != 'windows' input : ['test-codegen.xml'], output : ['gdbus-test-codegen-generated-min-required-2-64.h', 'gdbus-test-codegen-generated-min-required-2-64.c'], - depends : gdbus_codegen_depends, - depend_files : gdbus_codegen_depend_files, + depend_files : gdbus_codegen_built_files, command : [python, gdbus_codegen, '--glib-min-required', '2.64', '--interface-prefix', 'org.project.', @@ -342,8 +340,7 @@ if host_machine.system() != 'windows' custom_target('gdbus-test-codegen-generated-interface-info-h', input : ['test-codegen.xml'], output : ['gdbus-test-codegen-generated-interface-info.h'], - depends : gdbus_codegen_depends, - depend_files : gdbus_codegen_depend_files, + depend_files : gdbus_codegen_built_files, command : [python, gdbus_codegen, '--interface-info-header', annotate_args, @@ -352,8 +349,7 @@ if host_machine.system() != 'windows' custom_target('gdbus-test-codegen-generated-interface-info-c', input : ['test-codegen.xml'], output : ['gdbus-test-codegen-generated-interface-info.c'], - depends : gdbus_codegen_depends, - depend_files : gdbus_codegen_depend_files, + depend_files : gdbus_codegen_built_files, command : [python, gdbus_codegen, '--interface-info-body', annotate_args, @@ -461,8 +457,7 @@ if host_machine.system() != 'windows' input : ['../org.freedesktop.portal.Documents.xml'], output : ['fake-document-portal-generated.h', 'fake-document-portal-generated.c'], - depends : gdbus_codegen_depends, - depend_files : gdbus_codegen_depend_files, + depend_files : gdbus_codegen_built_files, command : [python, gdbus_codegen, '--interface-prefix', 'org.freedesktop.portal.', '--output-directory', '@OUTDIR@', @@ -742,9 +737,6 @@ if not meson.is_cross_build() output : ['gresource-big-test.txt'], command : [python, '@INPUT0@', '@OUTPUT@']) - # referenced by test.gresource.xml - test_generated_txt = fs.copyfile('test1.txt', 'test-generated.txt') - test_gresource = custom_target('test.gresource', input : 'test.gresource.xml', output : 'test.gresource', @@ -755,7 +747,6 @@ if not meson.is_cross_build() '--sourcedir=' + meson.current_build_dir(), '--internal', '@INPUT@'], - depends: test_generated_txt, install_dir : installed_tests_execdir, install_tag : 'tests', install : installed_tests_enabled) @@ -825,6 +816,12 @@ if not meson.is_cross_build() '--manual-register', '@INPUT@']) + # referenced by test.gresource.xml + test_generated_txt = configure_file(input : 'test1.txt', + output : 'test-generated.txt', + copy : true, + ) + resources_extra_sources = [ test_gresource, test_resources_c, diff --git a/meson.build b/meson.build index 996056f7d..6e0f679f8 100644 --- a/meson.build +++ b/meson.build @@ -2360,7 +2360,6 @@ if want_systemtap and enable_dtrace enable_systemtap = true endif -fs = import('fs') pkg = import('pkgconfig') windows = import('windows') subdir('tools') From 66499d21990e6e9b87c1d35fe83e47e7af67fed3 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 24 Nov 2022 12:10:03 +0000 Subject: [PATCH 3/5] =?UTF-8?q?Revert=20"build:=20Don=E2=80=99t=20define?= =?UTF-8?q?=20redundant=20built-in=20variables=20in=20pkgconfig=20calls"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 7e3e591d430e6576292379a4f2d94d5fc0656c36. The freedesktop SDK, which is used by gnome-build-meta, only has Meson 0.63. Bumping GLib’s Meson dependency to 0.64 means that, at the moment, GLib is not buildable in gnome-build-meta and hence can’t be tested in nightly pipelines against other projects, etc. That’s bad for testing GLib. It’s arguably bad that we’re restricted to using an older version of Meson than shipped by Debian Testing, but that’s a separate discussion to be had. Revert the Meson 0.64 dependency until the freedesktop SDK ships Meson ≥ 0.64. This also means reverting the simplifications to use of `gnome.mkenum_simple()`. See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3077#note_1601064 --- gio/meson.build | 4 +++- glib/meson.build | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gio/meson.build b/gio/meson.build index 24d44989d..1f7c1092d 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -877,7 +877,9 @@ libgio_dep = declare_dependency(link_with : libgio, pkg.generate(libgio, requires : ['glib-2.0', 'gobject-2.0'], - variables : ['schemasdir=' + join_paths('${datadir}', schemas_subdir), + variables : ['datadir=' + join_paths('${prefix}', get_option('datadir')), + 'schemasdir=' + join_paths('${datadir}', schemas_subdir), + 'bindir=' + join_paths('${prefix}', get_option('bindir')), 'giomoduledir=' + pkgconfig_giomodulesdir, 'gio=' + join_paths('${bindir}', 'gio'), 'gio_querymodules=@0@'.format(pkgconfig_multiarch_bindir / 'gio-querymodules'), diff --git a/glib/meson.build b/glib/meson.build index fef346e2f..4130b1ba6 100644 --- a/glib/meson.build +++ b/glib/meson.build @@ -438,7 +438,8 @@ pkg.generate(libglib, libraries_private : [win32_ldflags], subdirs : ['glib-2.0'], extra_cflags : ['-I${libdir}/glib-2.0/include'] + win32_cflags, - variables : ['glib_genmarshal=' + join_paths('${bindir}', 'glib-genmarshal'), + variables : ['bindir=' + join_paths('${prefix}', get_option('bindir')), + 'glib_genmarshal=' + join_paths('${bindir}', 'glib-genmarshal'), 'gobject_query=' + join_paths('${bindir}', 'gobject-query'), 'glib_mkenums=' + join_paths('${bindir}', 'glib-mkenums')], version : glib_version, From 3fad4d45bfef5567531afbfef7983db796080501 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 24 Nov 2022 12:10:07 +0000 Subject: [PATCH 4/5] Revert "build: Bump Meson dependency to 0.64.0" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 91f14cd058555f16b5abef1a577332921b08497b. The freedesktop SDK, which is used by gnome-build-meta, only has Meson 0.63. Bumping GLib’s Meson dependency to 0.64 means that, at the moment, GLib is not buildable in gnome-build-meta and hence can’t be tested in nightly pipelines against other projects, etc. That’s bad for testing GLib. It’s arguably bad that we’re restricted to using an older version of Meson than shipped by Debian Testing, but that’s a separate discussion to be had. Revert the Meson 0.64 dependency until the freedesktop SDK ships Meson ≥ 0.64. This also means reverting the simplifications to use of `gnome.mkenum_simple()`. See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3077#note_1601064 --- .gitlab-ci.yml | 16 +++++----------- .gitlab-ci/coverity.Dockerfile | 2 +- .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 +- 8 files changed, 12 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2f26e635f..36e86de73 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:v20" - COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v8" - DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v15" - MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v10" + FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v19" + COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v7" + DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v14" + MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v9" MESON_TEST_TIMEOUT_MULTIPLIER: 4 G_MESSAGES_DEBUG: all MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload --fatal-meson-warnings" @@ -439,9 +439,6 @@ freebsd-12-x86_64: LANG: C.UTF-8 before_script: - bash .gitlab-ci/show-execution-environment.sh - - python3 -m ensurepip --user - - /var/tmp/gitlab_runner/.local/bin/pip3 install --user meson==0.64.0 - - export PATH=/var/tmp/gitlab_runner/.local/bin:$PATH script: # We cannot use -Wl,--no-undefined because GLib uses 'environ' variable. # FreeBSD supports xattr, but its API is different from Linux xattr. @@ -475,9 +472,6 @@ freebsd-13-x86_64: LANG: C.UTF-8 before_script: - bash .gitlab-ci/show-execution-environment.sh - - python3 -m ensurepip --user - - /var/tmp/gitlab_runner/.local/bin/pip3 install --user meson==0.64.0 - - export PATH=/var/tmp/gitlab_runner/.local/bin:$PATH script: - meson ${MESON_COMMON_OPTIONS} --localstatedir=/var -Db_lundef=false -Dxattr=false _build - ninja -C _build @@ -509,7 +503,7 @@ macos: CFLAGS: '-Wno-overlength-strings' before_script: - bash .gitlab-ci/show-execution-environment.sh - - pip3 install --user meson==0.64.0 + - pip3 install --user meson==0.60.1 - pip3 install --user ninja - export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH script: diff --git a/.gitlab-ci/coverity.Dockerfile b/.gitlab-ci/coverity.Dockerfile index fb8753640..241861ec9 100644 --- a/.gitlab-ci/coverity.Dockerfile +++ b/.gitlab-ci/coverity.Dockerfile @@ -1,4 +1,4 @@ -FROM registry.gitlab.gnome.org/gnome/glib/fedora:v20 +FROM registry.gitlab.gnome.org/gnome/glib/fedora:v18 ARG COVERITY_SCAN_PROJECT_NAME ARG COVERITY_SCAN_TOKEN diff --git a/.gitlab-ci/debian-stable.Dockerfile b/.gitlab-ci/debian-stable.Dockerfile index 19b16acdf..b2559cad6 100644 --- a/.gitlab-ci/debian-stable.Dockerfile +++ b/.gitlab-ci/debian-stable.Dockerfile @@ -66,7 +66,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 meson==0.64.0 +RUN pip3 install meson==0.60.3 # FIXME: Once we use Debian Bookworm, we can just install the `reuse` package RUN pip3 install reuse==1.0.0 diff --git a/.gitlab-ci/fedora.Dockerfile b/.gitlab-ci/fedora.Dockerfile index 069e3b9fe..85f910cb9 100644 --- a/.gitlab-ci/fedora.Dockerfile +++ b/.gitlab-ci/fedora.Dockerfile @@ -74,7 +74,7 @@ RUN dnf -y update \ make \ && dnf clean all -RUN pip3 install meson==0.64.0 +RUN pip3 install meson==0.60.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 736142b69..b109122fc 100644 --- a/.gitlab-ci/mingw.Dockerfile +++ b/.gitlab-ci/mingw.Dockerfile @@ -57,7 +57,7 @@ RUN dnf -y install \ WORKDIR /opt COPY cross_file_mingw64.txt /opt -RUN pip3 install meson==0.64.0 +RUN pip3 install meson==0.60.3 ARG HOST_USER_ID=5555 ENV HOST_USER_ID ${HOST_USER_ID} diff --git a/.gitlab-ci/test-msvc.bat b/.gitlab-ci/test-msvc.bat index 97b39552d..1ad2e4a57 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==0.64.0 || goto :error +pip3 install --upgrade --user meson==0.60.3 || goto :error meson %args% _build || goto :error python .gitlab-ci/check-missing-install-tag.py _build || goto :error ninja -C _build || goto :error diff --git a/.gitlab-ci/test-msys2.sh b/.gitlab-ci/test-msys2.sh index f83a8e714..8b24c243d 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==0.64.0 +pip3 install --upgrade --user meson==0.60.3 PATH="$(cygpath "$USERPROFILE")/.local/bin:$HOME/.local/bin:$PATH" DIR="$(pwd)" diff --git a/meson.build b/meson.build index 6e0f679f8..422e30653 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('glib', 'c', version : '2.75.1', # NOTE: See the policy in docs/meson-version.md before changing the Meson dependency - meson_version : '>= 0.64.0', + meson_version : '>= 0.60.0', default_options : [ 'buildtype=debugoptimized', 'warning_level=3', From 5d2072577473f13ef389a932c53db6e8e8578ae5 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 24 Nov 2022 12:13:21 +0000 Subject: [PATCH 5/5] docs: Update Meson version policy to mention freedesktop SDK To avoid this happening again: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3077#note_1601064. Signed-off-by: Philip Withnall --- docs/meson-version.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/meson-version.md b/docs/meson-version.md index e1aa7407d..4a4ff825b 100644 --- a/docs/meson-version.md +++ b/docs/meson-version.md @@ -17,7 +17,9 @@ Policy * Stable branches of GLib will not change their Meson dependency after the first release of that stable series * Unstable branches of GLib can bump their Meson dependency if - - at least that version of Meson currently available in Debian Testing; or + - at least that version of Meson is currently [available in the freedesktop + SDK](https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/blob/master/elements/components/meson.bst); *and* + - at least that version of Meson is currently available in Debian Testing, or - the Python version required by the new Meson dependency is available in Debian Stable *and* the oldest currently-supported Ubuntu LTS * The version of Meson used by GLib should be pinned and pre-installed in the @@ -28,3 +30,8 @@ The reasoning behind allowing a version bump if the Python which Meson depends on is available in Debian Stable is that it’s [straightforward to install a more recent Meson version using `pip`](https://mesonbuild.com/Getting-meson.html#installing-meson-with-pip). + +The reasoning behind requiring the version of Meson to be available in the +freedesktop SDK is that it is used to build GLib on nightly pipelines in +[gnome-build-meta](https://gitlab.gnome.org/GNOME/gnome-build-meta/), which is +used to test GLib against multiple third party projects.