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 775863 - flatpak: Install the gnome runtime if necessary
flatpak: Install the gnome runtime if necessary
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-12-09 01:31 UTC by Matthew Leeds
Modified: 2016-12-13 01:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
flatpak: Install the gnome runtime if necessary (14.12 KB, patch)
2016-12-09 01:32 UTC, Matthew Leeds
committed Details | Review
flatpak: Refresh list of runtimes when necessary (4.86 KB, patch)
2016-12-09 09:25 UTC, Matthew Leeds
committed Details | Review

Description Matthew Leeds 2016-12-09 01:31:57 UTC
.
Comment 1 Matthew Leeds 2016-12-09 01:32:00 UTC
Created attachment 341652 [details] [review]
flatpak: Install the gnome runtime if necessary

By default GNOME flatpak apps use org.gnome.Platform and org.gnome.Sdk
as their runtime and sdk, respectively. This commit makes Builder
install those if necessary.
Comment 2 Matthew Leeds 2016-12-09 01:37:53 UTC
I wonder if we could get the runtime providers to "refresh" so that if someone installs the flatpak runtime between when they open Builder and when they build the app the behavior still makes sense.
Comment 3 Christian Hergert 2016-12-09 02:07:05 UTC
Similar to how we use inotify (via GFileMonitor) on the git index, we could probably watch the OSTree index that flatpak uses. I believe those are always mutated with atomic renames, so we should be able to get reliable notification.

Possibly the repo/summary file for each configured repo?
Comment 4 Matthew Leeds 2016-12-09 09:25:58 UTC
Created attachment 341663 [details] [review]
flatpak: Refresh list of runtimes when necessary

If the user installs or uninstalls a runtime while Builder is running,
we want to detect that and update the list of runtimes in the Build
Preferences view. This commit accomplishes that using a GFileMonitor.
It does have the side effect that the runtimes are reloaded even if an
unrelated change happens to the flatpak installation (such as installing
or updating apps).
Comment 5 Christian Hergert 2016-12-13 00:48:55 UTC
Review of attachment 341663 [details] [review]:

Cool! pushed with small patch to use connect_object() for object tracking, CONNECT_SWAPPED, and G_CALLBACK().
Comment 6 Christian Hergert 2016-12-13 01:02:43 UTC
Lovely!

Attachment 341652 [details] pushed as 1b56a54 - flatpak: Install the gnome runtime if necessary