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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8121>
This commit is contained in:
Tim-Philipp Müller 2024-12-10 12:52:33 +00:00 committed by GStreamer Marge Bot
parent 060563c357
commit 7d793d8836
6 changed files with 6 additions and 0 deletions

View file

@ -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())

View file

@ -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']

View file

@ -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')

View file

@ -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')

View file

@ -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')

View file

@ -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']