After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743625 - Incorrect gresources handling in GtkTemplate.
Incorrect gresources handling in GtkTemplate.
Status: RESOLVED DUPLICATE of bug 741743
Product: vala
Classification: Core
Component: Code Generator: GSignal
0.26.x
Other Linux
: Normal major
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2015-01-28 08:38 UTC by ria.freelander
Modified: 2015-02-03 10:11 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description ria.freelander 2015-01-28 08:38:42 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).
Comment 1 Luca Bruno 2015-02-03 10:11:23 UTC
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 ***