From c00df192ee4a505519a64eb41dfb1374b54abfbb Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Tue, 20 Sep 2022 11:00:10 -0400 Subject: [PATCH 1/4] meson: Set install_tag on installed tests files This could be done automatically by Meson, this commit can be reverted when we have that Meson PR in our CI: https://github.com/mesonbuild/meson/pull/10829 --- gio/tests/meson.build | 46 +++++++++++++++++++++---- gio/tests/services/meson.build | 1 + glib/tests/meson.build | 29 ++++++++++++++-- glib/tests/path-test-subdir/meson.build | 1 + gmodule/tests/meson.build | 4 +++ gobject/tests/meson.build | 5 +++ gobject/tests/performance/meson.build | 2 ++ 7 files changed, 79 insertions(+), 9 deletions(-) diff --git a/gio/tests/meson.build b/gio/tests/meson.build index c3e4e4cb3..8213599fa 100644 --- a/gio/tests/meson.build +++ b/gio/tests/meson.build @@ -222,6 +222,7 @@ if host_machine.system() != 'windows' name_prefix : '', dependencies: libdl_dep, install_dir : installed_tests_execdir, + install_tag : 'tests', install: installed_tests_enabled, ) ], @@ -419,6 +420,7 @@ if host_machine.system() != 'windows' c_args : test_c_args, dependencies : common_gio_tests_deps, install_dir : installed_tests_execdir, + install_tag : 'tests', install : installed_tests_enabled) gio_tests += { @@ -544,6 +546,7 @@ foreach appinfo_test_desktop_file : appinfo_test_desktop_files input: appinfo_test_desktop_file + '.in', output: appinfo_test_desktop_file, install_dir: installed_tests_execdir, + install_tag: 'tests', configuration: cdata, ) else @@ -566,11 +569,24 @@ if installed_tests_enabled 'org.gtk.test.dbusappinfo.flatpak.desktop', 'test1.overlay', install_dir : installed_tests_execdir, + install_tag : 'tests', + ) + install_subdir('x-content', + install_dir : installed_tests_execdir, + install_tag : 'tests', + ) + install_subdir('desktop-files', + install_dir : installed_tests_execdir, + install_tag : 'tests', + ) + install_subdir('thumbnails', + install_dir : installed_tests_execdir, + install_tag : 'tests', + ) + install_subdir('cert-tests', + install_dir : installed_tests_execdir, + install_tag : 'tests', ) - install_subdir('x-content', install_dir : installed_tests_execdir) - install_subdir('desktop-files', install_dir : installed_tests_execdir) - install_subdir('thumbnails', install_dir : installed_tests_execdir) - install_subdir('cert-tests', install_dir : installed_tests_execdir) cdata = configuration_data() cdata.set('installed_tests_dir', installed_tests_execdir) @@ -579,10 +595,17 @@ if installed_tests_enabled input: installed_tests_template, output: 'static-link.test', install_dir: installed_tests_metadir, + install_tag: 'tests', configuration: cdata ) - install_subdir('static-link', install_dir : installed_tests_execdir) - install_data('static-link.py', install_dir : installed_tests_execdir) + install_subdir('static-link', + install_dir : installed_tests_execdir, + install_tag : 'tests', + ) + install_data('static-link.py', + install_dir : installed_tests_execdir, + install_tag : 'tests', + ) monitor_tests = [ 'memory-monitor-dbus', @@ -600,6 +623,7 @@ if installed_tests_enabled input: installed_tests_template_tap, output: monitor_test + '.test', install_dir: installed_tests_metadir, + install_tag: 'tests', configuration: cdata ) cdata = configuration_data() @@ -608,6 +632,7 @@ if installed_tests_enabled input: monitor_test + '.py.in', output: monitor_test + '.py', install_dir : installed_tests_execdir, + install_tag : 'tests', configuration: cdata, ) endforeach @@ -633,6 +658,7 @@ if meson.can_run_host_binaries() link_args : export_dynamic_ldflags, dependencies : common_gio_tests_deps, install_dir : installed_tests_execdir, + install_tag : 'tests', install : installed_tests_enabled ) @@ -654,6 +680,7 @@ if meson.can_run_host_binaries() '--internal', '@INPUT@'], install_dir : installed_tests_execdir, + install_tag : 'tests', install : installed_tests_enabled) test_resources2_c = custom_target('test_resources2.c', @@ -766,6 +793,7 @@ if meson.can_run_host_binaries() '--internal', '@INPUT@'], install_dir : installed_tests_execdir, + install_tag : 'tests', install : installed_tests_enabled) # Create resource data file @@ -847,6 +875,7 @@ foreach test_name, extra_args : gio_tests input: installed_tests_template_tap, output: test_name + '.test', install_dir: installed_tests_metadir, + install_tag: 'tests', configuration: test_conf ) endif @@ -856,6 +885,7 @@ foreach test_name, extra_args : gio_tests dependencies : common_gio_tests_deps + extra_args.get('dependencies', []), install_rpath : extra_args.get('install_rpath', ''), install_dir: installed_tests_execdir, + install_tag: 'tests', install: install, ) @@ -885,6 +915,7 @@ foreach program_name, extra_args : test_extra_programs c_args : test_c_args, dependencies : common_gio_tests_deps + extra_args.get('dependencies', []), install_dir : installed_tests_execdir, + install_tag : 'tests', install : install, ) endforeach @@ -902,6 +933,7 @@ foreach test_name : python_tests install_data( files(test_name), install_dir: installed_tests_execdir, + install_tag: 'tests', install_mode: 'rwxr-xr-x', ) @@ -913,6 +945,7 @@ foreach test_name : python_tests input: installed_tests_template_tap, output: test_name + '.test', install_dir: installed_tests_metadir, + install_tag: 'tests', configuration: test_conf, ) endif @@ -923,6 +956,7 @@ if installed_tests_enabled install_data( files('taptestrunner.py'), install_dir: installed_tests_execdir, + install_tag: 'tests', ) endif diff --git a/gio/tests/services/meson.build b/gio/tests/services/meson.build index fd5117e23..b6a901bc5 100644 --- a/gio/tests/services/meson.build +++ b/gio/tests/services/meson.build @@ -25,6 +25,7 @@ foreach service_file : dbus_service_files ) install_data(meson.current_build_dir() / service_file + '.to-install', install_dir: installed_tests_execdir / 'services', + install_tag: 'tests', rename: [service_file], ) endif diff --git a/glib/tests/meson.build b/glib/tests/meson.build index d74617823..9a4b6107a 100644 --- a/glib/tests/meson.build +++ b/glib/tests/meson.build @@ -202,6 +202,7 @@ else name_prefix : '', dependencies: libdl_dep, install_dir : installed_tests_execdir, + install_tag : 'tests', install: installed_tests_enabled, ), ], @@ -230,10 +231,20 @@ if installed_tests_enabled 'NormalizationTest.txt', 'pages.ini', install_dir : installed_tests_execdir, + install_tag : 'tests', + ) + install_subdir('bookmarks', + install_dir : installed_tests_execdir, + install_tag : 'tests', + ) + install_subdir('markups', + install_dir : installed_tests_execdir, + install_tag : 'tests', + ) + install_subdir('time-zones', + install_dir : installed_tests_execdir, + install_tag : 'tests', ) - install_subdir('bookmarks', install_dir : installed_tests_execdir) - install_subdir('markups', install_dir : installed_tests_execdir) - install_subdir('time-zones', install_dir : installed_tests_execdir) endif test_env = environment() @@ -258,6 +269,7 @@ foreach test_name, extra_args : glib_tests input: installed_tests_template_tap, output: test_name + '.test', install_dir: installed_tests_metadir, + install_tag: 'tests', configuration: test_conf ) endif @@ -267,6 +279,7 @@ foreach test_name, extra_args : glib_tests link_args : extra_args.get('link_args', []), dependencies : test_deps + extra_args.get('dependencies', []), install_dir: installed_tests_execdir, + install_tag: 'tests', install: install, ) @@ -284,6 +297,7 @@ if installed_tests_enabled install_data( 'utf8.txt', install_dir : installed_tests_execdir, + install_tag : 'tests', ) endif @@ -295,6 +309,7 @@ executable('assert-msg-test', ['assert-msg-test.c'], c_args : test_cargs, dependencies : test_deps, install_dir : installed_tests_execdir, + install_tag : 'tests', install : installed_tests_enabled, win_subsystem : extra_args.get('win_subsystem', 'console'), ) @@ -312,6 +327,7 @@ foreach test_name : python_tests install_data( files(test_name), install_dir: installed_tests_execdir, + install_tag: 'tests', install_mode: 'rwxr-xr-x', ) @@ -323,6 +339,7 @@ foreach test_name : python_tests input: installed_tests_template_tap, output: test_name + '.test', install_dir: installed_tests_metadir, + install_tag: 'tests', configuration: test_conf, ) endif @@ -332,6 +349,7 @@ executable('spawn-path-search-helper', 'spawn-path-search-helper.c', c_args : test_cargs, dependencies : test_deps, install_dir: installed_tests_execdir, + install_tag: 'tests', install: installed_tests_enabled, ) @@ -339,6 +357,7 @@ executable('spawn-test-helper', 'spawn-test-helper.c', c_args : test_cargs, dependencies : test_deps, install_dir: installed_tests_execdir, + install_tag: 'tests', install: installed_tests_enabled, ) @@ -347,6 +366,7 @@ executable('test-spawn-echo', 'test-spawn-echo.c', c_args : test_cargs, dependencies : test_deps, install_dir: installed_tests_execdir, + install_tag: 'tests', install: installed_tests_enabled, ) @@ -356,12 +376,14 @@ if host_machine.system() == 'windows' c_args : test_cargs, dependencies : test_deps, install_dir: installed_tests_execdir, + install_tag: 'tests', install: installed_tests_enabled, ) executable('spawn-test-win32-gui', 'spawn-test-win32-gui.c', c_args : test_cargs, dependencies : test_deps, install_dir: installed_tests_execdir, + install_tag: 'tests', install: installed_tests_enabled, win_subsystem: 'windows', ) @@ -371,6 +393,7 @@ executable('testing-helper', 'testing-helper.c', c_args : test_cargs, dependencies : test_deps, install_dir: installed_tests_execdir, + install_tag: 'tests', install: installed_tests_enabled, ) diff --git a/glib/tests/path-test-subdir/meson.build b/glib/tests/path-test-subdir/meson.build index 351254cd8..50c604899 100644 --- a/glib/tests/path-test-subdir/meson.build +++ b/glib/tests/path-test-subdir/meson.build @@ -2,5 +2,6 @@ executable('spawn-test-helper', 'spawn-test-helper.c', c_args : test_cargs, dependencies : test_deps, install_dir: join_paths(installed_tests_execdir, 'path-test-subdir'), + install_tag: 'tests', install: installed_tests_enabled, ) diff --git a/gmodule/tests/meson.build b/gmodule/tests/meson.build index cc8125eda..d8ad5f758 100644 --- a/gmodule/tests/meson.build +++ b/gmodule/tests/meson.build @@ -30,12 +30,14 @@ foreach module : ['moduletestplugin_a', 'moduletestplugin_b'] shared_module(module + '_plugin', 'lib@0@.c'.format(module), dependencies : [libglib_dep, libgmodule_dep], install_dir : installed_tests_execdir, + install_tag : 'tests', install : installed_tests_enabled, name_suffix : module_suffix ) shared_library(module + '_library', 'lib@0@.c'.format(module), dependencies : [libglib_dep, libgmodule_dep], install_dir : installed_tests_execdir, + install_tag : 'tests', install : installed_tests_enabled, name_suffix : module_suffix ) @@ -63,6 +65,7 @@ foreach test_name, extra_args : gmodule_tests input: installed_tests_template_tap, output: test_name + '.test', install_dir: installed_tests_metadir, + install_tag: 'tests', configuration: test_conf ) endif @@ -73,6 +76,7 @@ foreach test_name, extra_args : gmodule_tests dependencies : test_deps + extra_args.get('dependencies', []), export_dynamic : extra_args.get('export_dynamic', false), install_dir: installed_tests_execdir, + install_tag: 'tests', install: install, ) diff --git a/gobject/tests/meson.build b/gobject/tests/meson.build index 58cf4ab1f..d0fa60567 100644 --- a/gobject/tests/meson.build +++ b/gobject/tests/meson.build @@ -139,6 +139,7 @@ foreach test_name, extra_args : gobject_tests input: installed_tests_template_tap, output: test_name + '.test', install_dir: installed_tests_metadir, + install_tag: 'tests', configuration: test_conf ) endif @@ -147,6 +148,7 @@ foreach test_name, extra_args : gobject_tests c_args : test_cargs + extra_args.get('c_args', []), dependencies : test_deps + extra_args.get('dependencies', []), install_dir: installed_tests_execdir, + install_tag: 'tests', install: install, ) @@ -175,6 +177,7 @@ foreach test_name : python_tests install_data( files(test_name), install_dir: installed_tests_execdir, + install_tag: 'tests', install_mode: 'rwxr-xr-x', ) @@ -186,6 +189,7 @@ foreach test_name : python_tests input: installed_tests_template_tap, output: test_name + '.test', install_dir: installed_tests_metadir, + install_tag: 'tests', configuration: test_conf, ) endif @@ -196,5 +200,6 @@ if installed_tests_enabled install_data( files('taptestrunner.py'), install_dir: installed_tests_execdir, + install_tag: 'tests', ) endif diff --git a/gobject/tests/performance/meson.build b/gobject/tests/performance/meson.build index 22bf79da0..f9102ff4a 100644 --- a/gobject/tests/performance/meson.build +++ b/gobject/tests/performance/meson.build @@ -26,6 +26,7 @@ foreach test_name, extra_args : gobject_tests input: installed_tests_template, output: test_name + '.test', install_dir: installed_tests_metadir, + install_tag: 'tests', configuration: test_conf, ) endif @@ -34,6 +35,7 @@ foreach test_name, extra_args : gobject_tests c_args : test_cargs + extra_args.get('c_args', []), dependencies : test_deps + extra_args.get('dependencies', []), install_dir: installed_tests_execdir, + install_tag: 'tests', install: install, ) From 49fd523af34a50696fef650dc685a98620cfd474 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Tue, 20 Sep 2022 11:29:27 -0400 Subject: [PATCH 2/4] meson: Set install_tag on systemtap files This could be done automatically by Meson, this commit can be reverted when we have that Meson PR in our CI: https://github.com/mesonbuild/meson/pull/10829 --- glib/meson.build | 1 + gobject/meson.build | 1 + 2 files changed, 2 insertions(+) diff --git a/glib/meson.build b/glib/meson.build index 1e6dc36be..503948766 100644 --- a/glib/meson.build +++ b/glib/meson.build @@ -488,6 +488,7 @@ if enable_systemtap output : '@0@.stp'.format(libglib.full_path().split('/').get(-1)), configuration : stp_cdata, install_dir : tapset_install_dir, + install_tag : 'systemtap', ) endif diff --git a/gobject/meson.build b/gobject/meson.build index a994eb591..c12ff6d7d 100644 --- a/gobject/meson.build +++ b/gobject/meson.build @@ -179,6 +179,7 @@ if enable_systemtap output : '@0@.stp'.format(libgobject.full_path().split('/').get(-1)), configuration : stp_cdata, install_dir : tapset_install_dir, + install_tag : 'systemtap', ) endif From a73ca336aa7b0e535338868b296f658a62f0fd77 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Sun, 18 Sep 2022 16:51:55 -0400 Subject: [PATCH 3/4] meson: Set install_tag on remaining installed files --- gio/gdbus-2.0/codegen/meson.build | 2 ++ gio/meson.build | 24 +++++++++++++++--------- glib/meson.build | 7 ++++++- gobject/meson.build | 6 +++++- meson.build | 4 +++- po/meson.build | 5 ++++- tools/meson.build | 4 +++- 7 files changed, 38 insertions(+), 14 deletions(-) diff --git a/gio/gdbus-2.0/codegen/meson.build b/gio/gdbus-2.0/codegen/meson.build index f0a256898..16abd97d6 100644 --- a/gio/gdbus-2.0/codegen/meson.build +++ b/gio/gdbus-2.0/codegen/meson.build @@ -32,6 +32,7 @@ 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) foreach f : gdbus_codegen_files @@ -39,5 +40,6 @@ foreach f : gdbus_codegen_files # 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) endforeach diff --git a/gio/meson.build b/gio/meson.build index fdd2528df..14f0d8259 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -800,13 +800,15 @@ if have_bash endif install_data([ - 'completion/gapplication', - 'completion/gdbus', - 'completion/gio', - 'completion/gsettings', - 'completion/gresource' - ], - install_dir: bash_comp_inst_dir) + 'completion/gapplication', + 'completion/gdbus', + 'completion/gio', + 'completion/gsettings', + 'completion/gresource' + ], + install_dir: bash_comp_inst_dir, + install_tag: 'bin', + ) endif if enable_dtrace @@ -1017,10 +1019,14 @@ executable('gsettings', 'gsettings-tool.c', link_args : noseh_link_args, dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep]) install_data('gschema.dtd', - install_dir : join_paths(get_option('datadir'), schemas_subdir)) + install_dir : get_option('datadir') / schemas_subdir, + install_tag : 'devel', +) install_data(['gschema.loc', 'gschema.its'], - install_dir : join_paths(get_option('datadir'), 'gettext/its')) + install_dir : get_option('datadir') / 'gettext' / 'its', + install_tag : 'devel', +) executable('gdbus', 'gdbus-tool.c', install : true, diff --git a/glib/meson.build b/glib/meson.build index 503948766..c365901a1 100644 --- a/glib/meson.build +++ b/glib/meson.build @@ -1,5 +1,6 @@ glibconfig_h = configure_file(input : 'glibconfig.h.in', output : 'glibconfig.h', install_dir : join_paths(get_option('libdir'), 'glib-2.0/include'), + install_tag : 'devel', configuration : glibconfig_conf) subdir('libcharset') @@ -453,7 +454,10 @@ configure_file( install_mode: 'rwxr-xr-x' ) -install_data('glib_gdb.py', install_dir : join_paths(glib_pkgdatadir, 'gdb')) +install_data('glib_gdb.py', + install_dir : glib_pkgdatadir / 'gdb', + install_tag : 'devel', +) # This is needed to make gdb find glib_gdb.py env = environment() @@ -480,6 +484,7 @@ configure_file( output: 'libglib-2.0.so.@0@-gdb.py'.format(library_version), configuration: gdb_conf, install_dir: gdb_install_dir, + install_tag: 'devel', install: gdb_install, ) diff --git a/gobject/meson.build b/gobject/meson.build index c12ff6d7d..bc44d5db1 100644 --- a/gobject/meson.build +++ b/gobject/meson.build @@ -158,7 +158,10 @@ executable('gobject-query', 'gobject-query.c', install_tag : 'bin-devel', dependencies : [libglib_dep, libgobject_dep]) -install_data('gobject_gdb.py', install_dir : join_paths(glib_pkgdatadir, 'gdb')) +install_data('gobject_gdb.py', + install_dir : glib_pkgdatadir / 'gdb', + install_tag : 'devel', +) gdb_conf = configuration_data() gdb_conf.set('datadir', glib_datadir) configure_file( @@ -166,6 +169,7 @@ configure_file( output: 'libgobject-2.0.so.@0@-gdb.py'.format(library_version), configuration: gdb_conf, install_dir: gdb_install_dir, + install_tag: 'devel', install: gdb_install, ) diff --git a/meson.build b/meson.build index 4885de994..3a81ec5ca 100644 --- a/meson.build +++ b/meson.build @@ -2391,7 +2391,9 @@ endif # Install m4 macros that other projects use install_data('m4macros/glib-2.0.m4', 'm4macros/glib-gettext.m4', 'm4macros/gsettings.m4', - install_dir : join_paths(get_option('datadir'), 'aclocal')) + install_dir : get_option('datadir') / 'aclocal', + install_tag : 'devel', +) configure_file(output : 'config.h', configuration : glib_conf) diff --git a/po/meson.build b/po/meson.build index 9fab01864..489d12754 100644 --- a/po/meson.build +++ b/po/meson.build @@ -2,4 +2,7 @@ i18n = import('i18n') i18n.gettext('glib20', preset: 'glib') -install_data('Makefile.in.in', install_dir : glib_pkgdatadir + '/gettext/po') +install_data('Makefile.in.in', + install_dir : glib_pkgdatadir / 'gettext' / 'po', + install_tag : 'devel', +) diff --git a/tools/meson.build b/tools/meson.build index 0542fb89b..e91c8a2f9 100644 --- a/tools/meson.build +++ b/tools/meson.build @@ -18,5 +18,7 @@ if host_system != 'windows' # Install Valgrind suppression file (except on Windows, # as Valgrind is currently not supported on Windows) install_data('glib.supp', - install_dir : join_paths(get_option('datadir'), 'glib-2.0', 'valgrind')) + install_dir : get_option('datadir') / 'glib-2.0' / 'valgrind', + install_tag : 'devel', + ) endif From 497f15181087ff00f94edae7bc372386529ca0e0 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 19 Sep 2022 10:29:40 -0400 Subject: [PATCH 4/4] ci: Check that all installed files have a tag --- .gitlab-ci/check-missing-install-tag.py | 25 +++++++++++++++++++++++++ .gitlab-ci/run-tests.sh | 2 ++ .gitlab-ci/test-msvc.bat | 1 + 3 files changed, 28 insertions(+) create mode 100755 .gitlab-ci/check-missing-install-tag.py diff --git a/.gitlab-ci/check-missing-install-tag.py b/.gitlab-ci/check-missing-install-tag.py new file mode 100755 index 000000000..7081bc746 --- /dev/null +++ b/.gitlab-ci/check-missing-install-tag.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python3 + +""" +This script checks Meson configuration logs to verify no installed file is +missing installation tag. +""" + +import argparse +from pathlib import Path + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('builddir', type=Path) + args = parser.parse_args() + + logfile = args.builddir / 'meson-logs' / 'meson-log.txt' + with logfile.open(encoding='utf-8') as f: + if 'Failed to guess install tag' in f.read(): + print(f'Some files are missing install_tag, see {logfile} for details.') + return 1 + return 0 + + +if __name__ == "__main__": + exit(main()) diff --git a/.gitlab-ci/run-tests.sh b/.gitlab-ci/run-tests.sh index 86402dcaf..634f861eb 100755 --- a/.gitlab-ci/run-tests.sh +++ b/.gitlab-ci/run-tests.sh @@ -1,5 +1,7 @@ #!/bin/bash +./.gitlab-ci/check-missing-install-tag.py _build + meson test \ -C _build \ --timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \ diff --git a/.gitlab-ci/test-msvc.bat b/.gitlab-ci/test-msvc.bat index 37976d4d0..82e445e00 100644 --- a/.gitlab-ci/test-msvc.bat +++ b/.gitlab-ci/test-msvc.bat @@ -14,6 +14,7 @@ set args=%args:~1% :: FIXME: make warnings fatal 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 :: FIXME: dont ignore test errors