Skip to content

Commit 28835cc

Browse files
eli-schwartzjpakkane
authored andcommitted
gnome module: fix regression that broke using built xml files as gresources
In commit 3dcc712 we moved to typed_pos_args. In the process, we deleted some code to specifically raise an error if you use custom_target or generator outputs, instead leaving it out of the typed pos args. However, that support was specifically supposed to be there. It was only an error in part of an if statement for handling old versions of glib-compile-resources. The specific error it calls out is that we need to manually parse the depfile at configure time, due to an external bug; obviously this is impossible if the gresource is only created at build time. Reinstate the original error message check, and allow built outputs to be used as compile_resources() inputs. Fixes #10367
1 parent b19d312 commit 28835cc

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

mesonbuild/modules/gnome.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def post_install(self, state: 'ModuleState', args: T.List['TYPE_var'], kwargs: '
371371
rv.append(script)
372372
return ModuleReturnValue(None, rv)
373373

374-
@typed_pos_args('gnome.compile_resources', str, (str, mesonlib.File))
374+
@typed_pos_args('gnome.compile_resources', str, (str, mesonlib.File, build.CustomTarget, build.CustomTargetIndex, build.GeneratedList))
375375
@typed_kwargs(
376376
'gnome.compile_resources',
377377
_BUILD_BY_DEFAULT,
@@ -426,6 +426,13 @@ def compile_resources(self, state: 'ModuleState', args: T.Tuple[str, 'FileOrStri
426426
ifile = os.path.join(state.environment.get_build_dir(), input_file.subdir, input_file.fname)
427427
else:
428428
ifile = os.path.join(input_file.subdir, input_file.fname)
429+
430+
elif isinstance(input_file, (build.CustomTarget, build.CustomTargetIndex, build.GeneratedList)):
431+
raise MesonException('Resource xml files generated at build-time cannot be used with '
432+
'gnome.compile_resources() in the current version of glib-compile-resources '
433+
'because we need to scan the xml for dependencies due to '
434+
'<https://bugzilla.gnome.org/show_bug.cgi?id=774368>\nUse '
435+
'configure_file() instead to generate it at configure-time.')
429436
else:
430437
ifile = os.path.join(state.subdir, input_file)
431438

0 commit comments

Comments
 (0)