Follow

My markup language for is ready, and I'm eager to hear your feedback! Is it something you'd use in your apps? What features would you like to see next?

jwestman.net/2021/12/02/introd

@flyingpimonster I'm testing Blueprint with the default Vala template in Builder, but I found a problem:

I'm not well versed in meson and vala, but looks like valac reads gresources xml files when a template is used in code, so we need needs:

valac to find generated .ui files, which are in build dir and not in source dir
ninja must effectively generate .ui files before compiling .vala files

I resolved point 1 changing:

executable('test', test_sources, vala_args: '--target-glib=2.50', dependencies:test_deps, install: true, )


into

executable('test', test_sources, vala_args: [ '--target-glib=2.50', '--gresourcesdir=src/', ], dependencies:test_deps, install: true, )



But for point 2 I can't find the correct way and so I have to build two time first time. The first build fails because valac can't locate .ui file.
@flyingpimonster not really.

to me looks like that dependency between gresource and blueprint is correct.
but ninja tries to build in this order: vala->c , blueprint->ui, compile gresource, compile c, link

But valac needs to access source grsource xml to compile vala to c, because it needs to parse ui files (to check template class name maybe?), so the correct chain should be
blueprint->ui, vala->c, compile gresource, compile c, link.

here the output of ninja with "explain" and "verbose" on a clean build dir

$ ninja -d explain -v ninja explain: output data/net.kirgroup.test.desktop doesn't exist ninja explain: data/net.kirgroup.test.desktop is dirty ninja explain: output data/net.kirgroup.test.appdata.xml doesn't exist ninja explain: data/net.kirgroup.test.appdata.xml is dirty ninja explain: output src/window.ui doesn't exist ninja explain: src/window.ui is dirty ninja explain: src/window.ui is dirty ninja explain: src/test-resources.c is dirty ninja explain: src/test-resources.c is dirty ninja explain: src/window.ui is dirty ninja explain: src/test.p/meson-generated_.._test-resources.c.o is dirty ninja explain: deps for 'src/test.p/meson-generated_main.c.o' are missing ninja explain: output src/test.p/main.c doesn't exist ninja explain: src/test.p/main.c is dirty ninja explain: src/test.p/meson-generated_main.c.o is dirty ninja explain: deps for 'src/test.p/meson-generated_window.c.o' are missing ninja explain: src/test.p/window.c is dirty ninja explain: src/test.p/meson-generated_window.c.o is dirty ninja explain: deps for 'src/test.p/meson-generated_application.c.o' are missing ninja explain: src/test.p/application.c is dirty ninja explain: src/test.p/meson-generated_application.c.o is dirty ninja explain: src/test is dirty [1/11] /usr/bin/meson --internal msgfmthelper ../../../../../../Progetti/test/data/net.kirgroup.test.appdata.xml.in data/net.kirgroup.test.appdata.xml xml ../../../../../../Progetti/test/data/../po [2/11] /usr/bin/meson --internal msgfmthelper ../../../../../../Progetti/test/data/net.kirgroup.test.desktop.in data/net.kirgroup.test.desktop desktop ../../../../../../Progetti/test/data/../po [3/11] valac -C --debug --debug --pkg libsoup-3.0 --pkg libadwaita-1 --pkg gtk4 --color=always --directory src/test.p --basedir ../../../../../../Progetti/test/src --gresources=../../../../../../Progetti/test/src/test.gresource.xml --target-glib=2.50 --gresourcesdir=src/ ../../../../../../Progetti/test/src/main.vala ../../../../../../Progetti/test/src/window.vala ../../../../../../Progetti/test/src/application.vala FAILED: src/test.p/main.c src/test.p/window.c src/test.p/application.c valac -C --debug --debug --pkg libsoup-3.0 --pkg libadwaita-1 --pkg gtk4 --color=always --directory src/test.p --basedir ../../../../../../Progetti/test/src --gresources=../../../../../../Progetti/test/src/test.gresource.xml --target-glib=2.50 --gresourcesdir=src/ ../../../../../../Progetti/test/src/main.vala ../../../../../../Progetti/test/src/window.vala ../../../../../../Progetti/test/src/application.vala ../../../../../../Progetti/test/src/window.vala:24.2-24.44: error: UI resource not found: `/net/kirgroup/test/window.ui'. Please make sure to specify the proper GResources xml files with --gresources and alternative search locations with --gresourcesdir. public class Window : Adw.ApplicationWindow { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Compilation failed: 1 error(s), 0 warning(s) [4/11] /home/fabio/Progetti/test/subprojects/blueprint-compiler/blueprint-compiler.py batch-compile src ../../../../../../Progetti/test/src ../../../../../../Progetti/test/src/window.blp ninja: build stopped: subcommand failed.



and this the output of the second try

$ ninja -d explain -v ninja explain: output src/test-resources.c doesn't exist ninja explain: src/test-resources.c is dirty ninja explain: src/test-resources.c is dirty ninja explain: output src/test-resources.h doesn't exist ninja explain: src/test.p/meson-generated_.._test-resources.c.o is dirty ninja explain: output src/test.p/window.c doesn't exist ninja explain: src/test.p/main.c is dirty ninja explain: src/test.p/main.c is dirty ninja explain: src/test.p/meson-generated_main.c.o is dirty ninja explain: src/test.p/window.c is dirty ninja explain: src/test.p/window.c is dirty ninja explain: src/test.p/meson-generated_window.c.o is dirty ninja explain: src/test.p/application.c is dirty ninja explain: src/test.p/application.c is dirty ninja explain: src/test.p/meson-generated_application.c.o is dirty ninja explain: src/test is dirty [1/8] /usr/bin/glib-compile-resources ../../../../../../Progetti/test/src/test.gresource.xml --sourcedir src --sourcedir ../../../../../../Progetti/test/src --c-name test --internal --generate --target src/test-resources.h [2/8] /usr/bin/glib-compile-resources ../../../../../../Progetti/test/src/test.gresource.xml --sourcedir src --sourcedir ../../../../../../Progetti/test/src --c-name test --internal --generate --target src/test-resources.c --dependency-file src/test-resources.c.d [3/8] ccache cc -Isrc/test.p -Isrc -I../../../../../../Progetti/test/src -I/usr/include/gtk-4.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/graphene-1.0 -I/usr/lib/graphene-1.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/libadwaita-1 -I/usr/include/libsoup-3.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -g -pthread -mfpmath=sse -msse -msse2 -mfpmath=sse -msse -msse2 -MD -MQ src/test.p/meson-generated_.._test-resources.c.o -MF src/test.p/meson-generated_.._test-resources.c.o.d -o src/test.p/meson-generated_.._test-resources.c.o -c src/test-resources.c [4/8] valac -C --debug --debug --pkg libsoup-3.0 --pkg libadwaita-1 --pkg gtk4 --color=always --directory src/test.p --basedir ../../../../../../Progetti/test/src --gresources=../../../../../../Progetti/test/src/test.gresource.xml --target-glib=2.50 --gresourcesdir=src/ ../../../../../../Progetti/test/src/main.vala ../../../../../../Progetti/test/src/window.vala ../../../../../../Progetti/test/src/application.vala ninja explain: output src/test.p/meson-generated_main.c.o doesn't exist ninja explain: output src/test.p/meson-generated_main.c.o doesn't exist [5/8] ccache cc -Isrc/test.p -Isrc -I../../../../../../Progetti/test/src -I/usr/include/gtk-4.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/graphene-1.0 -I/usr/lib/graphene-1.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/libadwaita-1 -I/usr/include/libsoup-3.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -w -g -pthread -mfpmath=sse -msse -msse2 -mfpmath=sse -msse -msse2 -MD -MQ src/test.p/meson-generated_main.c.o -MF src/test.p/meson-generated_main.c.o.d -o src/test.p/meson-generated_main.c.o -c src/test.p/main.c [6/8] ccache cc -Isrc/test.p -Isrc -I../../../../../../Progetti/test/src -I/usr/include/gtk-4.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/graphene-1.0 -I/usr/lib/graphene-1.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/libadwaita-1 -I/usr/include/libsoup-3.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -w -g -pthread -mfpmath=sse -msse -msse2 -mfpmath=sse -msse -msse2 -MD -MQ src/test.p/meson-generated_application.c.o -MF src/test.p/meson-generated_application.c.o.d -o src/test.p/meson-generated_application.c.o -c src/test.p/application.c [7/8] ccache cc -Isrc/test.p -Isrc -I../../../../../../Progetti/test/src -I/usr/include/gtk-4.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/lzo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/graphene-1.0 -I/usr/lib/graphene-1.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/libadwaita-1 -I/usr/include/libsoup-3.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -w -g -pthread -mfpmath=sse -msse -msse2 -mfpmath=sse -msse -msse2 -MD -MQ src/test.p/meson-generated_window.c.o -MF src/test.p/meson-generated_window.c.o.d -o src/test.p/meson-generated_window.c.o -c src/test.p/window.c [8/8] cc -o src/test src/test.p/meson-generated_.._test-resources.c.o src/test.p/meson-generated_main.c.o src/test.p/meson-generated_window.c.o src/test.p/meson-generated_application.c.o -Wl,--as-needed -Wl,--no-undefined -Wl,--start-group /usr/lib/libgtk-4.so /usr/lib/libpangocairo-1.0.so /usr/lib/libpango-1.0.so /usr/lib/libharfbuzz.so /usr/lib/libgdk_pixbuf-2.0.so /usr/lib/libcairo-gobject.so /usr/lib/libcairo.so /usr/lib/libgraphene-1.0.so /usr/lib/libgio-2.0.so /usr/lib/libgobject-2.0.so /usr/lib/libglib-2.0.so /usr/lib/libadwaita-1.so /usr/lib/libsoup-3.0.so -Wl,--export-dynamic /usr/lib/libgmodule-2.0.so -Wl,--end-group -pthread



(do you think I should move this thread to an issue on gitlab?)

@flyingpimonster for people who doesn’t knows you and what you are about, this is underadable.

@flyingpimonster no, wait. the question is what do YOU mean in this page

@loweel ah--yeah the post is pretty technical. Basically it's an easier way for GNOME app developers to create their UIs.

@flyingpimonster

is not because is technical. is because it completely lacks of background and context.

@flyingpimonster i really enjoy the syntax. Would love to hear more about your process for designing it.

Sign in to participate in the conversation
Fosstodon

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.