From 7d793d883661380e2be2aac946293aaa60413c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 10 Dec 2024 12:52:33 +0000 Subject: [PATCH] meson: unset GST_TRACERS for g-ir-scanner to avoid warnings People might have GST_TRACERS=leaks set in their environment by default, which will now trigger criticals during the build when calling g-ir-scanner, because we unset GST_PLUGIN_SYSTEM_PATH so that the scanner doesn't load any plugins. Fixes #4093 Part-of: --- subprojects/gst-devtools/meson.build | 1 + subprojects/gst-editing-services/meson.build | 1 + subprojects/gst-plugins-bad/meson.build | 1 + subprojects/gst-plugins-base/meson.build | 1 + subprojects/gst-rtsp-server/meson.build | 1 + subprojects/gstreamer/meson.build | 1 + 6 files changed, 6 insertions(+) diff --git a/subprojects/gst-devtools/meson.build b/subprojects/gst-devtools/meson.build index 1964a32392..1403701ccf 100644 --- a/subprojects/gst-devtools/meson.build +++ b/subprojects/gst-devtools/meson.build @@ -109,6 +109,7 @@ gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + 'g_setenv("GST_REGISTRY_1.0", "/no/way/this/exists.reg", TRUE);' + \ 'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \ 'g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);' + \ + 'g_setenv("GST_TRACERS", "", TRUE);' + \ 'gst_init(NULL,NULL);', '--quiet'] gir = find_program('g-ir-scanner', required : get_option('introspection')) build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled()) diff --git a/subprojects/gst-editing-services/meson.build b/subprojects/gst-editing-services/meson.build index e445571068..d0b843bfe9 100644 --- a/subprojects/gst-editing-services/meson.build +++ b/subprojects/gst-editing-services/meson.build @@ -141,6 +141,7 @@ gir_init_section = [ '--add-init-section=' + \ 'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \ 'g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);' + \ 'g_setenv("GST_DEBUG", "0", TRUE);' + \ + 'g_setenv("GST_TRACERS", "", TRUE);' + \ 'gst_init(NULL,NULL);' + \ 'ges_init();', '--quiet'] diff --git a/subprojects/gst-plugins-bad/meson.build b/subprojects/gst-plugins-bad/meson.build index ac6a430991..87c635f1de 100644 --- a/subprojects/gst-plugins-bad/meson.build +++ b/subprojects/gst-plugins-bad/meson.build @@ -538,6 +538,7 @@ gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + 'g_setenv("GST_REGISTRY_1.0", "@0@", TRUE);'.format(meson.current_build_dir() + '/gir_empty_registry.reg') + \ 'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \ 'g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);' + \ + 'g_setenv("GST_TRACERS", "", TRUE);' + \ 'gst_init(NULL,NULL);', '--quiet'] presetdir = join_paths(get_option('datadir'), 'gstreamer-' + api_version, 'presets') diff --git a/subprojects/gst-plugins-base/meson.build b/subprojects/gst-plugins-base/meson.build index 65d0944114..f2d2aacc0e 100644 --- a/subprojects/gst-plugins-base/meson.build +++ b/subprojects/gst-plugins-base/meson.build @@ -460,6 +460,7 @@ gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + 'g_setenv("GST_REGISTRY_1.0", "@0@", TRUE);'.format(meson.current_build_dir() + '/gir_empty_registry.reg') + \ 'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \ 'g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);' + \ + 'g_setenv("GST_TRACERS", "", TRUE);' + \ 'gst_init(NULL,NULL);', '--quiet'] pkgconfig = import('pkgconfig') diff --git a/subprojects/gst-rtsp-server/meson.build b/subprojects/gst-rtsp-server/meson.build index e17505c5b0..6990bb0fe6 100644 --- a/subprojects/gst-rtsp-server/meson.build +++ b/subprojects/gst-rtsp-server/meson.build @@ -179,6 +179,7 @@ gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + 'g_setenv("GST_REGISTRY_1.0", "@0@", TRUE);'.format(meson.current_build_dir() + '/gir_empty_registry.reg') + \ 'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \ 'g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);' + \ + 'g_setenv("GST_TRACERS", "", TRUE);' + \ 'gst_init(NULL,NULL);', '--quiet'] pkgconfig = import('pkgconfig') diff --git a/subprojects/gstreamer/meson.build b/subprojects/gstreamer/meson.build index 7edb712f78..308a3d2402 100644 --- a/subprojects/gstreamer/meson.build +++ b/subprojects/gstreamer/meson.build @@ -604,6 +604,7 @@ gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + 'g_setenv("GST_REGISTRY_1.0", "/no/way/this/exists.reg", TRUE);' + \ 'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \ 'g_setenv("GST_PLUGIN_SYSTEM_PATH_1_0", "", TRUE);' + \ + 'g_setenv("GST_TRACERS", "", TRUE);' + \ 'gst_init(NULL,NULL);', '--quiet'] gst_c_args = ['-DHAVE_CONFIG_H']