[gnome-builder] meson: be lazier about initial pipeline setup



commit 4c65ae9647da697a25feca06b6dd4d00489dab2f
Author: Christian Hergert <chergert redhat com>
Date:   Sat Feb 2 01:36:26 2019 -0800

    meson: be lazier about initial pipeline setup

 src/plugins/meson/gbp-meson-build-system.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/meson/gbp-meson-build-system.c b/src/plugins/meson/gbp-meson-build-system.c
index 05832bfb9..cc34cd7b0 100644
--- a/src/plugins/meson/gbp-meson-build-system.c
+++ b/src/plugins/meson/gbp-meson-build-system.c
@@ -292,12 +292,12 @@ gbp_meson_build_system_load_commands_async (GbpMesonBuildSystem *self,
    * here about whether or not it is setup fully. It may be delayed due
    * to device initialization.
    */
-  if (pipeline == NULL || !ide_pipeline_is_ready (pipeline))
+  if (pipeline == NULL)
     {
       ide_task_return_new_error (task,
                                  G_IO_ERROR,
                                  G_IO_ERROR_NOT_INITIALIZED,
-                                 "The pipeline is not yet ready to handle requests");
+                                 "There is no pipeline to access");
       return;
     }
 
@@ -322,6 +322,20 @@ gbp_meson_build_system_load_commands_async (GbpMesonBuildSystem *self,
       return;
     }
 
+  /*
+   * Because we're accessing the pipeline directly, we need to be careful
+   * here about whether or not it is setup fully. It may be delayed due
+   * to device initialization.
+   */
+  if (!ide_pipeline_is_ready (pipeline))
+    {
+      ide_task_return_new_error (task,
+                                 G_IO_ERROR,
+                                 G_IO_ERROR_NOT_INITIALIZED,
+                                 "The pipeline is not yet ready to handle requests");
+      return;
+    }
+
   /*
    * It looks like we need to ensure the build pipeline advances to the the
    * CONFIGURE phase so that meson has generated a new compile_commands.json


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