flatpak-builder fails due missing categories in metadata
When running flatpak-builder
on a fresh project appstreamcli compose
fails due missing menu categories in metadata:
flatpak-builder output
~/code/gtk-rust-template/my-awesome-app> flatpak-builder --user flatpak_app build-aux/org.domain.MyAwesomeApp.Devel.json
Downloading sources
Initializing build dir
Committing stage init to cache
Starting build of org.domain.MyAwesomeApp.Devel
========================================================================
Building module my-awesome-app in /home/mistapproach/code/gtk-rust-template/my-awesome-app/.flatpak-builder/build/my-awesome-app-1
========================================================================
The Meson build system
Version: 1.2.3
Source dir: /run/build/my-awesome-app
Build dir: /run/build/my-awesome-app/_flatpak_build
Build type: native build
Project name: my-awesome-app
Project version: 0.1.0
Rust compiler for the host machine: rustc -C linker=cc (rustc 1.76.0)
Rust linker for the host machine: rustc -C linker=cc ld.bfd 2.42
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (2.0.2)
Run-time dependency glib-2.0 found: YES 2.78.4
Run-time dependency gio-2.0 found: YES 2.78.4
Run-time dependency gtk4 found: YES 4.12.5
Program glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Program glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Program desktop-file-validate found: YES (/usr/bin/desktop-file-validate)
Program appstreamcli found: YES (/usr/bin/appstreamcli)
Program cargo found: YES (/usr/lib/sdk/rust-stable/bin/cargo)
Message: Setting up git pre-commit hook..
Found pkg-config: /usr/bin/pkg-config (2.0.2)
Dependency gio-2.0 found: YES 2.78.4 (cached)
Program /usr/bin/glib-compile-resources found: YES (/usr/bin/glib-compile-resources)
Configuring org.domain.MyAwesomeApp.desktop.in using configuration
Program msgfmt found: YES (/usr/bin/msgfmt)
Configuring org.domain.MyAwesomeApp.metainfo.xml.in using configuration
Configuring org.domain.MyAwesomeApp.Devel.gschema.xml using configuration
Program msginit found: YES (/usr/bin/msginit)
Program msgmerge found: YES (/usr/bin/msgmerge)
Program xgettext found: YES (/usr/bin/xgettext)
Configuring config.rs using configuration
Message: Building in debug mode
Dependency gio-2.0 found: YES 2.78.4 (cached)
Program /usr/bin/glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Program gtk4-update-icon-cache found: YES (/usr/bin/gtk4-update-icon-cache)
Program update-desktop-database found: YES (/usr/bin/update-desktop-database)
Build targets in project: 7
my-awesome-app 0.1.0
User defined options
prefix : /app
profile: development
Found ninja-1.11.1 at /usr/bin/ninja
[1/4] Generating src/cargo-build with a custom command
Updating crates.io index
Downloaded pin-utils v0.1.0
Downloaded cairo-rs v0.19.2
Downloaded gdk4 v0.8.0
Downloaded equivalent v1.0.1
Downloaded temp-dir v0.1.12
Downloaded field-offset v0.3.6
Downloaded futures-macro v0.3.30
Downloaded thread_local v1.1.7
Downloaded gsk4-sys v0.8.0
Downloaded cfg-if v1.0.0
Downloaded gettext-rs v0.7.0
Downloaded proc-macro-error-attr v1.0.4
Downloaded memoffset v0.9.0
Downloaded graphene-sys v0.19.0
Downloaded slab v0.4.9
Downloaded serde_spanned v0.6.5
Downloaded futures-core v0.3.30
Downloaded thiserror v1.0.57
Downloaded gdk-pixbuf-sys v0.19.0
Downloaded toml_datetime v0.6.5
Downloaded futures-executor v0.3.30
Downloaded lazy_static v1.4.0
Downloaded gdk-pixbuf v0.19.2
Downloaded thiserror-impl v1.0.57
Downloaded autocfg v1.1.0
Downloaded version-compare v0.1.1
Downloaded heck v0.4.1
Downloaded proc-macro-crate v3.1.0
Downloaded rustc_version v0.4.0
Downloaded pkg-config v0.3.30
Downloaded futures-task v0.3.30
Downloaded cairo-sys-rs v0.19.2
Downloaded futures-io v0.3.30
Downloaded version_check v0.9.4
Downloaded nu-ansi-term v0.46.0
Downloaded overload v0.1.1
Downloaded system-deps v6.2.0
Downloaded graphene-rs v0.19.2
Downloaded locale_config v0.3.0
Downloaded tracing-attributes v0.1.27
Downloaded gsk4 v0.8.0
Downloaded target-lexicon v0.12.13
Downloaded pango-sys v0.19.0
Downloaded proc-macro-error v1.0.4
Downloaded tracing-log v0.2.0
Downloaded gobject-sys v0.19.0
Downloaded futures-channel v0.3.30
Downloaded log v0.4.20
Downloaded once_cell v1.19.0
Downloaded smallvec v1.13.1
Downloaded gtk4-macros v0.8.0
Downloaded pin-project-lite v0.2.13
Downloaded semver v1.0.22
Downloaded bitflags v2.4.2
Downloaded cfg-expr v0.15.7
Downloaded quote v1.0.35
Downloaded unicode-ident v1.0.12
Downloaded anyhow v1.0.80
Downloaded glib-sys v0.19.0
Downloaded cc v1.0.83
Downloaded toml v0.8.10
Downloaded gdk4-sys v0.8.0
Downloaded glib-macros v0.19.2
Downloaded proc-macro2 v1.0.78
Downloaded gio-sys v0.19.0
Downloaded pango v0.19.2
Downloaded tracing v0.1.40
Downloaded sharded-slab v0.1.7
Downloaded serde v1.0.196
Downloaded tracing-core v0.1.32
Downloaded indexmap v2.2.3
Downloaded toml_edit v0.21.1
Downloaded toml_edit v0.22.6
Downloaded memchr v2.7.1
Downloaded gtk4-sys v0.8.0
Downloaded hashbrown v0.14.3
Downloaded winnow v0.6.1
Downloaded winnow v0.5.40
Downloaded futures-util v0.3.30
Downloaded aho-corasick v1.1.2
Downloaded gio v0.19.2
Downloaded tracing-subscriber v0.3.18
Downloaded regex v1.10.3
Downloaded syn v1.0.109
Downloaded syn v2.0.49
Downloaded glib v0.19.2
Downloaded regex-syntax v0.8.2
Downloaded gtk4 v0.8.0
Downloaded regex-automata v0.4.5
Downloaded libc v0.2.153
Downloaded gettext-sys v0.21.3
Downloaded 91 crates (13.4 MB) in 7.74s (largest was `gettext-sys` at 6.5 MB)
Compiling serde v1.0.196
Compiling equivalent v1.0.1
Compiling hashbrown v0.14.3
Compiling target-lexicon v0.12.13
Compiling winnow v0.6.1
Compiling heck v0.4.1
Compiling smallvec v1.13.1
Compiling pkg-config v0.3.30
Compiling version-compare v0.1.1
Compiling proc-macro2 v1.0.78
Compiling unicode-ident v1.0.12
Compiling libc v0.2.153
Compiling autocfg v1.1.0
Compiling memchr v2.7.1
Compiling winnow v0.5.40
Compiling futures-core v0.3.30
Compiling pin-project-lite v0.2.13
Compiling thiserror v1.0.57
Compiling pin-utils v0.1.0
Compiling futures-task v0.3.30
Compiling bitflags v2.4.2
Compiling version_check v0.9.4
Compiling gio v0.19.2
Compiling semver v1.0.22
Compiling futures-io v0.3.30
Compiling syn v1.0.109
Compiling once_cell v1.19.0
Compiling lazy_static v1.4.0
Compiling anyhow v1.0.80
Compiling regex-syntax v0.8.2
Compiling temp-dir v0.1.12
Compiling cfg-if v1.0.0
Compiling overload v0.1.1
Compiling log v0.4.20
Compiling futures-channel v0.3.30
Compiling sharded-slab v0.1.7
Compiling slab v0.4.9
Compiling memoffset v0.9.0
Compiling tracing-core v0.1.32
Compiling thread_local v1.1.7
Compiling nu-ansi-term v0.46.0
Compiling proc-macro-error-attr v1.0.4
Compiling proc-macro-error v1.0.4
Compiling aho-corasick v1.1.2
Compiling indexmap v2.2.3
Compiling cfg-expr v0.15.7
Compiling tracing-log v0.2.0
Compiling rustc_version v0.4.0
Compiling tracing-subscriber v0.3.18
Compiling quote v1.0.35
Compiling field-offset v0.3.6
Compiling syn v2.0.49
Compiling cc v1.0.83
Compiling gettext-sys v0.21.3
Compiling regex-automata v0.4.5
Compiling toml_datetime v0.6.5
Compiling serde_spanned v0.6.5
Compiling toml_edit v0.22.6
Compiling toml_edit v0.21.1
Compiling regex v1.10.3
Compiling locale_config v0.3.0
Compiling gettext-rs v0.7.0
Compiling proc-macro-crate v3.1.0
Compiling futures-macro v0.3.30
Compiling thiserror-impl v1.0.57
Compiling tracing-attributes v0.1.27
Compiling toml v0.8.10
Compiling glib-macros v0.19.2
Compiling gtk4-macros v0.8.0
Compiling system-deps v6.2.0
Compiling futures-util v0.3.30
Compiling tracing v0.1.40
Compiling glib-sys v0.19.0
Compiling gobject-sys v0.19.0
Compiling gio-sys v0.19.0
Compiling gdk-pixbuf-sys v0.19.0
Compiling cairo-sys-rs v0.19.2
Compiling pango-sys v0.19.0
Compiling gdk4-sys v0.8.0
Compiling graphene-sys v0.19.0
Compiling gsk4-sys v0.8.0
Compiling gtk4-sys v0.8.0
Compiling futures-executor v0.3.30
Compiling glib v0.19.2
Compiling cairo-rs v0.19.2
Compiling graphene-rs v0.19.2
Compiling pango v0.19.2
Compiling gdk-pixbuf v0.19.2
Compiling gdk4 v0.8.0
Compiling gsk4 v0.8.0
Compiling gtk4 v0.8.0
Compiling my-awesome-app v0.1.0 (/run/build/my-awesome-app)
Finished dev [unoptimized + debuginfo] target(s) in 36.57s
[3/4] Generating data/org.domain.MyAwesomeApp.Devel.metainfo.xml with a custom command
[0/2] Generating src/cargo-build with a custom command
Finished dev [unoptimized + debuginfo] target(s) in 0.03s
[1/2] Installing files.
Installing data/resources/resources.gresource to /app/share/my-awesome-app
Installing data/org.domain.MyAwesomeApp.Devel.desktop to /app/share/applications
Installing data/org.domain.MyAwesomeApp.Devel.metainfo.xml to /app/share/metainfo
Installing src/my-awesome-app to /app/bin
Installing /run/build/my-awesome-app/data/icons/org.domain.MyAwesomeApp.Devel.svg to /app/share/icons/hicolor/scalable/apps
Installing /run/build/my-awesome-app/data/icons/org.domain.MyAwesomeApp-symbolic.svg to /app/share/icons/hicolor/symbolic/apps
Installing /run/build/my-awesome-app/_flatpak_build/data/org.domain.MyAwesomeApp.Devel.gschema.xml to /app/share/glib-2.0/schemas
Running custom install script '/usr/bin/glib-compile-schemas /app/share/glib-2.0/schemas'
Running custom install script '/usr/bin/gtk4-update-icon-cache -q -t -f /app/share/icons/hicolor'
Running custom install script '/usr/bin/update-desktop-database -q /app/share/applications'
Running tests
[0/2] Generating src/cargo-build with a custom command
Finished dev [unoptimized + debuginfo] target(s) in 0.03s
[1/2] Running all tests.
1/3 validate-desktop OK 0.01s
2/3 validate-gschema OK 0.01s
3/3 validate-appdata OK 0.02s
Ok: 3
Expected Fail: 0
Fail: 0
Unexpected Pass: 0
Skipped: 0
Timeout: 0
Full log written to /run/build/my-awesome-app/_flatpak_build/meson-logs/testlog.txt
compressing debuginfo in: /home/mistapproach/code/gtk-rust-template/my-awesome-app/.flatpak-builder/rofiles/rofiles-xNCPLj/files/bin/my-awesome-app
processing: /home/mistapproach/code/gtk-rust-template/my-awesome-app/.flatpak-builder/rofiles/rofiles-xNCPLj/files/bin/my-awesome-app
[15] .debug_gdb_scripts ignoring allocated section
[36] .debug_abbrev compressed -> .zdebug_abbrev (258482 => 40546 15.69%)
[37] .debug_aranges compressed -> .zdebug_aranges (1536144 => 87010 5.66%)
[38] .debug_info compressed -> .zdebug_info (28167910 => 8956062 31.80%)
[39] .debug_line compressed -> .zdebug_line (7508746 => 1217089 16.21%)
[40] .debug_loc compressed -> .zdebug_loc (549703 => 18481 3.36%)
[41] .debug_ranges compressed -> .zdebug_ranges (5161072 => 114723 2.22%)
[42] .debug_rnglists compressed -> .zdebug_rnglists (66 => 56 84.85%)
[47] .debug_line_str compressed -> .zdebug_line_str (274 => 169 61.68%)
[48] .debug_str compressed -> .zdebug_str (28843578 => 7230763 25.07%)
[43] Updating section string table
stripping /home/mistapproach/code/gtk-rust-template/my-awesome-app/.flatpak-builder/rofiles/rofiles-xNCPLj/files/bin/my-awesome-app to /home/mistapproach/code/gtk-rust-template/my-awesome-app/.flatpak-builder/rofiles/rofiles-xNCPLj/files/lib/debug/bin/my-awesome-app.debug
Committing stage build-my-awesome-app to cache
Cleaning up
Running appstreamcli compose
Only accepting components: org.domain.MyAwesomeApp.Devel, org.domain.MyAwesomeApp.Devel.desktop
Processing directory: /home/mistapproach/code/gtk-rust-template/my-awesome-app/.flatpak-builder/rofiles/rofiles-xNCPLj/files
Composing metadata...
** (appstreamcli-compose:6602): CRITICAL **: 19:19:37.981: as_icon_set_scale: assertion 'scale >= 1' failed
Run failed, some data was ignored.
Errors were raised during this compose run:
general
E: filters-but-no-output
org.domain.MyAwesomeApp.Devel
E: no-valid-category
Refer to the generated issue report data for details on the individual problems.
Error: ERROR: appstreamcli compose failed: Child process exited with code 1
The solution is to add missing tags in build-aux/<app-id>.metadata.xml.in.in
:
<categories>
<category>GNOME</category>
<category>GTK</category>
</categories>