-
Notifications
You must be signed in to change notification settings - Fork 97
builder-manifest: Run appstream-compose with no-partial-urls argument #652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
40a7146
to
fba37bf
Compare
@ximion what do you think about this? atm the only use of appstreamcli in f-b is using compose but you last said compose api is not stable so we don't want to switch to it and using the api is also part of a larger cleanup. linking to libappstream just to check the version seems a bit much, so this is an easy way out. |
I'd say you do what you think is best for flatpak-builder - but I can offer my opinion and a bit of background information :-) The CLI interfaces of both ascli-compose as well as ascli are pretty much guaranteed to remain backwards-compatible. However, the generated output isn't something you generally should rely on, unless it is any of the YAML/JSON output (that will not change as it is intended to be machine-readable). That said, I can pretty much guarantee that the output of On partial URLs: This is a feature to allow for caching data while having the URL change and to allow for very cheap load balancing. E.g. if you have a database of components and change the URL of your CDN, you would have to go through each and every one to adjust the URL, while with partial URLs you just have to change the component catalog header. You can also - in theory - define multiple URLs where to get the assets from and have app-stores choose one at random, to distribute load on multiple sites. On depending on libappstream: Personally, TBH, I'd just do it here. Flatpak already depends on it, so you aren't introducing any exotic new dependency. Depending on the library is way more robust than any string parsing. You get the On libappstream-compose API: It's marked as unstable because it is "leaking" some internals like the font renderer that are needed by tools like appstream-generator so far. The API is marked as unstable because the hope is to reduce it a bit in future, if possible. It's also missing a version test macro and a tiny bit of polish. So yeah, that's my (long) 2 cents ^^ |
I think it makes sense to use the API to compose, as long as there aren't any differences in the output between cli and api. But if it was marked stable first it'd be nice. f-b is just using this much: flatpak-builder/src/builder-manifest.c Lines 3034 to 3088 in d2abdda
also for flathub, we also are setting |
You know you can just pass
As long as you use the same flags, the output is identical. All the CLI tool does is to call the respective API anyway. |
ah i didn't knew about the --allow-custom flag. |
I just remembered that we use the patch because we want to propagate all custom tags to our Flathub catalogue data. Sometimes some distributors use flathub catalogue for their own app store and eg. wants to highlight their apps in their store. Usually they end up using some custom tag in metainfo for their apps and want that in catalogue. Anyway once the api is stable and we can switch to it, we should be able to set a custom policy i think. |
I wonder what others think of it. The options are
or
|
Couldn't they go by developer-id if they wanted to highlight their own apps? There's also a merge mechanism in AppStream to edit components after the fact, but it was designed for Linux distributions, so I have no idea how well that would work for Flatpak: https://www.freedesktop.org/software/appstream/docs/chap-CatalogData.html#spec-asxml-tags Or, well, you could just define the custom key-name they should use for this, that will solve it too ;-) |
It's worth noting that once you link to libas-compose, you also automatically link against libas, because the former builds upon the latter :-) |
I tried the initial port to API here #664 but looks like there the private asc-fonts header is not available, so it doesn't compile by default. |
Upgrade to AppStream 1.0.6 or higher and that issue will be gone. Nothing in the public API uses anything from that header anyway, so alternatively you can also just drop that reference or provide an empty header. |
I will get back to this a bit later. I realised this needs to be behind an arg something like And drop/change it later for 1.5.0 or later when the appstream api is done. |
fba37bf
to
03e1f4d
Compare
What actually is the minimum AppStream release that you need to support? Looks like you have to support stuff from the 0.16.x stable series and can't yet fully depend on the 1.0-or-later series? (I also guess that backporting stuff to the 0.16.x stable branch won't help you if your versions are frozen). |
Ideally as minimum as possible, so that it can go to LTS distros without much trouble. I can bump it to whatever is needed but that's when 1.5.0 (unstable) starts. Not in 1.4.x. |
Yeah, that's fair, but I am asking because the last Ubuntu LTS, 24.04, has AppStream 1.0.2 which would be a much easier baseline for you. |
2200c5a
to
1801dbe
Compare
I need to adjust the tests, since offline tests are wanted. Instead of testing for the screenshot tags, I will test for the icon tag which works offline. |
d5485d4
to
f11e94a
Compare
1b50fc8
to
24a6f2f
Compare
Looks like sourceware is down... |
f398a81
to
18d30b4
Compare
It should be ready for review now. |
This could've been done with the libappstream API but since flatpak-builder has until now avoided linking to it and linking to it now does not make sense just to check the version. That is postponed until appstream-compose is API stable and we can port to it. The CLI output format has been stable for 8+ years, see [1] [2]. We prefer the library version in case of a mismatch. [1]: ximion/appstream@d83174a [2]: https://github.com/ximion/appstream/blob/56ecd0067495213a64f3a490cbbc030fcfd5b8f1/tools/appstreamcli.c#L1594-L1604
appstream-glib always composed with full urls. The URL policy got unintentionallly switched to partial urls during libappstream port in 1.3.x. Such a break in behaviour makes sense for unstable releases but we cannot revert back to full urls in a stable release. Using full URLs is desired for Flathub. So add a cli arg to control the behaviour and default to partial url. This may be flipped later in the next unstable release to default to full urls again. This is an alternative to #576
abff104
to
888cc64
Compare
888cc64
to
badbc9c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
This maintains the behaviour that flatpak-builder had in the Flathub image but uses the newly introduced argument See flatpak/flatpak-builder#652
This maintains the behaviour that flatpak-builder had in the Flathub image but uses the newly introduced argument See flatpak/flatpak-builder#652
This maintains the behaviour that flatpak-builder had in the Flathub image but uses the newly introduced argument See flatpak/flatpak-builder#652
We started getting errors for our flatpak CI runs a few weeks ago. Which coincided with an upstream infrastructure issue which would explain the screenshots error. After infra was fixed and the fact that we didn't get any successful runs, something else was going on. Turns out that `flatpak-builder` had a release which changed the behaviour of `--compose-url-policy` to default to `partial` instead of `full` which was used before. Our fix is simple, just change it back to `full` Fixes: cockpit-project#22444 Related-to: flatpak/flatpak-builder#652 Signed-off-by: Freya Gustavsson <[email protected]>
We started getting errors for our flatpak CI runs a few weeks ago. Which coincided with an upstream infrastructure issue which would explain the screenshots error. After infra was fixed and the fact that we didn't get any successful runs, something else was going on. Turns out that `flatpak-builder` had a release which changed the behaviour of `--compose-url-policy` to default to `partial` instead of `full` which was used before. Our fix is simple, just change it back to `full` Fixes: #22444 Related-to: flatpak/flatpak-builder#652 Signed-off-by: Freya Gustavsson <[email protected]>
See commits
Alternative to #576, closes #576
We can optionally pick up the meson/autotools bits from there, just to signal packagers that we ideally want >= 0.16.3 but then we have to bump CI or turn them into warnings.