Running gnome-builder generated project from command line

Hi folks!

My current project is a GTK Python application targeting the newly released Gnome SDK 47. I’ve generated the project files using the Gnome Builder application and it runs and builds fine via the IDE. As Gnome Builder is somewhat limited, I’m using PyCharm and building in the terminal. Previously I could do so, using the Gnome SDK 46. However, updating the SDK version in the manifest causes the following issue:

$ flatpak-builder --force-clean --user --repo=repo builddir org.bswa.Gnome47Test.json 
Emptying app dir 'builddir'
Downloading sources
Fetching full git repo file:///home/jr/Code/gnome_47_test
Starting build of org.bswa.Gnome47Test
Cache hit for gnome_47_test, skipping build
Cache miss, checking out last cache hit
Cleaning up
Running appstream-compose
bwrap: execvp appstream-compose: No such file or directory
Error: ERROR: appstream-compose failed: Child process exited with code 1

I’ve installed the appropriate packages in Linux Mint and can run appstream-compose from the command line. Obviously Gnome Builder can run it, and could before I installed the packages.

Any help would be greatly appreciated.

You need to update your flatpak-builder to the latest version 1.4.4

appstream-compose support was removed last year and it was also removed from the runtime this year.

Thanks for the tip! I’ve added the flatpak ppa and installed flatpak-builder 1.4.4

I now have the following error:

$ flatpak-builder --force-clean --user builddir org.bswa.Gnome47Test.json 
Emptying app dir 'builddir'
Downloading sources
Fetching full git repo file:///home/jr/Code/gnome_47_test
Starting build of org.bswa.Gnome47Test
Cache hit for gnome_47_test, skipping build
Cache miss, checking out last cache hit
Cleaning up
Renaming org.bswa.Gnome47Test.appdata.xml to share/metainfo/org.bswa.Gnome47Test.metainfo.xml
Running appstreamcli compose
Only accepting components: org.bswa.Gnome47Test, org.bswa.Gnome47Test.desktop
Processing directory: /home/jr/Code/gnome_47_test/.flatpak-builder/rofiles/rofiles-CMwPv0/files
Composing metadata...
Run failed, some data was ignored.
Errors were raised during this compose run:
org.bswa.Gnome47Test.desktop
  E: metainfo-no-summary
Refer to the generated issue report data for details on the individual problems.
Error: ERROR: appstreamcli compose failed: Child process exited with code 1

I cannot find the metainfo-no-summary error on this page:

Cheers,

J.R.

So digging into the build directory I find this:

$ cat org.bswa.Gnome47Test.metainfo.xml 
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
  <id>org.bswa.Gnome47Test.desktop</id>
  <metadata_license>CC0-1.0</metadata_license>
  <project_license>GPL-3.0-or-later</project_license>
  <description>
    <p>No description</p>
  </description>
</component>

$SOMETHING has generated this, again not sure what.

EDIT:

BTW, this is just the hello world python GTK project generated by Gnome Builder, with the only change being the gnome platform version.

Digging into the project files, we have

data/org.bswa.Gnome47Test.appdata.xml.in

The contents of which are the same as above.

You have to add all the required fields in that appdata file and validate it with appstreamcli validate

See the required fields starting from MetaInfo guidelines | Flathub Documentation

So if I can satisfy this it should work?

$ flatpak run --command=flatpak-builder-lint org.flatpak.Builder appstream data/org.bswa.Gnome47Test.appdata.xml.in
E: org.bswa.Gnome47Test.desktop:~: component-name-missing
   The component is missing a name (<name/> tag).

E: org.bswa.Gnome47Test.desktop:~: component-summary-missing
   The component is missing a summary (<summary/> tag).

I: org.bswa.Gnome47Test.desktop:7: description-first-para-too-short No description
   The first `description/p` paragraph of this component might be too short (< 80 characters).
   Please consider starting with a longer paragraph to improve how the description looks like in
   software centers and to provide more detailed information on this component immediately in the
   first paragraph.

W: org.bswa.Gnome47Test.desktop:~: url-homepage-missing
   This component is missing an `url` element of type `homepage` to link to the project's homepage.

E: org.bswa.Gnome47Test.desktop:~: desktop-app-launchable-omitted
   This `desktop-application` component has no `desktop-id` launchable tag, however it contains all
   the necessary information to display the application. The omission of the launchable entry means
   that this application can not be launched directly from installers or software centers. If this
   is intended, this information can be ignored, otherwise it is strongly recommended to add a
   launchable tag as well.

E: org.bswa.Gnome47Test.desktop:~: releases-info-missing
   This component is missing information about releases. Consider adding a `releases` tag to
   describe releases and their changes.

E: org.bswa.Gnome47Test.desktop:~: content-rating-missing
   This component has no `content_rating` tag to provide age rating information. You can generate
   the tag data online by answering a few questions at https://hughsie.github.io/oars/

I: org.bswa.Gnome47Test.desktop:~: developer-info-missing
   This component contains no `developer` element with information about its author.

✘ Validation failed: errors: 5, warnings: 1, infos: 2, pedantic: 1

I feel that I’m on the wrong track here. I ended up with this file:

<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
	<id>org.bswa.Gnome47Test.desktop</id>
	<metadata_license>CC0-1.0</metadata_license>
	<project_license>GPL-3.0-or-later</project_license>
	<description>
	  <p>This is a really long description that will surely satisfy our linter, right?
	    No, longer! Seriously, we want something so long your jaw will drop.
	  </p>
	</description>
  <name>App Name</name>
  <summary>Short summary</summary>
  <url type="homepage">https://example.org/</url>
  <launchable type="desktop-id">org.bswa.Gnome47Test.desktop</launchable>
  <releases>
    <release version="0.0.1" date="2024-09-26">
      <url type="details">https://example.org/changelog.html#version_0.0.1</url>
      <description>
        <p>Release description</p>
          <ul>
            <li>List of changes</li>
            <li>List of changes</li>
          </ul>
      </description>
    </release>
  </releases>
  <content_rating type="oars-1.1" />
  <developer id="org.bswa">
    <name>J.R></name>
  </developer>
</component>

And I still get the same error:

Errors were raised during this compose run:
org.bswa.Gnome47Test.desktop
  E: metainfo-no-summary

I ended up with this file:

Yes this one is fine.

Can you share your manifest ?

Here you go. Hope this helps.

{
    "app-id" : "org.bswa.Gnome47Test",
    "runtime" : "org.gnome.Platform",
    "runtime-version" : "47",
    "sdk" : "org.gnome.Sdk",
    "command" : "gnome_47_test",
    "finish-args" : [
        "--share=network",
        "--share=ipc",
        "--socket=fallback-x11",
        "--device=dri",
        "--socket=wayland"
    ],
    "cleanup" : [
        "/include",
        "/lib/pkgconfig",
        "/man",
        "/share/doc",
        "/share/gtk-doc",
        "/share/man",
        "/share/pkgconfig",
        "*.la",
        "*.a"
    ],
    "modules" : [
        {
            "name" : "gnome_47_test",
            "builddir" : true,
            "buildsystem" : "meson",
            "sources" : [
                {
                    "type" : "git",
                    "url" : "file:///home/jr/Code/gnome_47_test"
                }
            ]
        }
    ]
}

I can’t build it myself if you use file:// sources.

The source for this project is entirely generated by Gnome Builder, with only the runtime version changed in the manifest. I’ve put the project up on GitHub:

Maybe take a quick glance at the readme I created.

Thanks again for taking the time to look at this.

I do wonder though, how much of this I really need. meson, ninja, appstream and so on and so forth.

The goal I have in mind is to create a GTK front end to an existing python project. I had some success without flatpak, but I’d like to use the more modern Adwaita features available in the new runtime.

The alternative is to roll my own flatpak project structure, but I’m not sure how difficult that would be.

Well, your appdata.xml.in file is again missing those fields gnome_47_test/data/org.bswa.Gnome47Test.appdata.xml.in at master · jhanarato/gnome_47_test · GitHub. Add those extra fields to that file.

Your meson.build is generating appdata.xml from appdata.xml.in and installing that.

I reverted the appstream changes before pushing to github. Adding them doesn’t solve the problem. However, I’ve put them back and pushed again.

I suspect in my case I really don’t need the appstream metadata to be complete. I just ran the linter to see if I could figure out what was wrong.

Perhaps the meson build script is failing to find a file it’s looking for?

Hang on a minute… I have a new error now:

Errors were raised during this compose run:
org.bswa.Gnome47Test.desktop
  E: no-valid-category

Add some more categories to your desktop file gnome_47_test/data/org.bswa.Gnome47Test.desktop.in at 1a76bea379e6351057564dd49d7ceda299f01f39 · jhanarato/gnome_47_test · GitHub

See the list of valid categories https://specifications.freedesktop.org/menu-spec/latest/apa.html

I edited the desktop file, changing categories to “Development”

It still didn’t work… but ohhhhh…

I hadn’t realised that even though the files are stored locally, flatpak is pulling those changes via the local git repository. So I’ve been making all these changes, but not committing them. No wonder I’ve been struggling so much. Just putting the repo online gave me the answer.

So thank you!

This topic was automatically closed after 46 hours. New replies are no longer allowed.