[gnome-builder] flatpak: reload pipeline after bootstrapping



commit 50568ea9c3488410235fe89821add311fa4fa268
Author: Christian Hergert <chergert redhat com>
Date:   Wed Feb 17 14:16:19 2021 -0800

    flatpak: reload pipeline after bootstrapping
    
    If we are installing runtimes as part of the bootstrap, then we need to
    reload the pipeline if it was successful. Otherwise, we risk things like
    meson not being found and missing pipeline stages.

 src/plugins/flatpak/gbp-flatpak-runtime-provider.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/src/plugins/flatpak/gbp-flatpak-runtime-provider.c 
b/src/plugins/flatpak/gbp-flatpak-runtime-provider.c
index c9c31b171..87cc650b5 100644
--- a/src/plugins/flatpak/gbp-flatpak-runtime-provider.c
+++ b/src/plugins/flatpak/gbp-flatpak-runtime-provider.c
@@ -478,10 +478,13 @@ install_task_completed_cb (GbpFlatpakRuntimeProvider *self,
   g_assert (pspec != NULL);
   g_assert (IDE_IS_TASK (task));
 
-  context = ide_object_ref_context (IDE_OBJECT (self));
+  if (!ide_task_had_error (task))
+    {
+      context = ide_object_ref_context (IDE_OBJECT (self));
 
-  if (context != NULL)
-    ide_build_manager_invalidate (ide_build_manager_from_context (context));
+      if (context != NULL)
+        ide_build_manager_invalidate (ide_build_manager_from_context (context));
+    }
 
   IDE_EXIT;
 }
@@ -810,6 +813,16 @@ gbp_flatpak_runtime_provider_bootstrap_async (IdeRuntimeProvider  *provider,
     }
   else
     {
+      /* We need to invalidate the pipeline if there are runtimes
+       * to install after they've been installed or we risk having
+       * missing bits like meson not found.
+       */
+      g_signal_connect_object (task,
+                               "notify::completed",
+                               G_CALLBACK (install_task_completed_cb),
+                               self,
+                               G_CONNECT_SWAPPED);
+
       /* Do not propagate cancellable to this operation or we risk cancelling
        * in-flight operations that the user is expecting to complete.
        */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]