mesonbuild / mesonbuild/meson

Can not use gnome.compile_resources to produce two gresource files with the same base name

Open
#4,477 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
6.6k
Forks
1.9k
Avg merge
2d 6h
Merged PRs (30d)
33

Description

For context, I'm working on a GTK theme project that includes two variants for different GTK versions. One feature GTK themes can take advantage of is to provide a `gtk.gresource` file that bundles up assets and CSS.

While updating the build files to bundle the assets rather than install them individually, I got the following error:

gtk/src/light/gtk-3.20/meson.build:149:6: ERROR: Tried to create target "gtk_gresource", but a target of that name already exists.

The directive on that line is:

gnome.compile_resources('gtk', gresource_xml,
gresource_bundle: true,
dependencies: generated_css,
install: true,
install_dir: gtk3_dir,
)

There is a similar directive in a different subdirectory generating another `gtk.gresource` file. Changing the first argument gets rid of the error, but also changes the output file name.

I can probably work around this by having one of them generate the wrong name and then use a custom target to copy it back to the desired name, but that feels like an ugly hack. Maybe compile_resources() should include the project subdirectory in the target name it generates?

Contributor guide

Open the contributing guide

Research direction

Start with the gtk/src/light/gtk-3.20/meson.build call to gnome.compile_resources and compare it with the similar call in the other subdirectory. Trace how compile_resources derives its target name, then check the relevant build-system tests if available; done means both gtk.gresource outputs can be generated with the same basename without a target collision or filename-copy workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.