GNOME Bugzilla – Bug 743625
Incorrect gresources handling in GtkTemplate.
Last modified: 2015-02-03 10:11:23 UTC
I have following gresource.xml: <?xml version="1.0" encoding="UTF-8"?> <gresources> <gresource prefix="/org/vala-panel/app"> <file compressed="true" alias="runner.ui" preprocess="xml-stripblanks">../data/ui/app-runner.ui</file> <file compressed="true" alias="style.css">../data/css/vala-panel.css</file> <file compressed="true" alias="panel.png">../data/images/panel.png</file> </gresource> </gresources> And I have this into vala file: [GtkTemplate (ui = "/org/vala-panel/app/runner.ui")] internal class Runner : Gtk.Dialog { ... } my VALAFLAGS in Makefile.am is: project_VALAFLAGS = \ --vapidir=$(top_srcdir)/vapi \ --vapidir=. \ --target-glib=2.40 \ --gresources=$(top_srcdir)/data/vala-panel.gresource.xml \ --pkg gtk+-3.0 \ --pkg gio-2.0 \ --pkg gio-unix-2.0 \ --pkg config \ --pkg temp \ --pkg vala-panel \ --pkg gio-settingsbackend-2.0 \ $(VALAFLAGS) valac gives me this: error: UI resource not found: `/org/vala-panel/app/runner.ui'. Please make sure to specify the proper GResources xml files with --gresources. I think this line in valagtkmodule.vala caused this behaviour: codegen/valagtkmodule.vala:99 : if (ui_file == null || !FileUtils.test (ui_file, FileTest.EXISTS)) { AFAIK, g_file_test cannot work with relative paths, but GResource loader can.(C version of this program compiles and works as expected).
I think the problem is that "alias" wasn't recognized until a recent commit. Please try Vala 0.27.1 if you can. Thanks for taking the time to report this bug. This particular bug has already been reported into our bug tracking system, but we are happy to tell you that the problem has already been fixed. It should be solved in the next software version. You may want to check for a software upgrade. Please reopen if needed. *** This bug has been marked as a duplicate of bug 741743 ***