[gnome-builder] pipeline: protect against spurious builds
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] pipeline: protect against spurious builds
- Date: Thu, 5 Oct 2017 01:03:14 +0000 (UTC)
commit b6d34b6b4f371ba075294c9b7baff13fff2a96f3
Author: Christian Hergert <chergert redhat com>
Date: Wed Oct 4 17:55:54 2017 -0700
pipeline: protect against spurious builds
If this is an automated build operation, such as those by
fetching build flags, try to protect ourselves against spurious
builds.
A full rebuild or normal build request should still progress as
normal. This simply checks for advancing up to CONFIGURE when
there was a previous failure.
Any UI element (such as clicking Build or activating the
"build" action) will still result in a proper build.
src/libide/buildsystem/ide-build-pipeline.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/libide/buildsystem/ide-build-pipeline.c b/src/libide/buildsystem/ide-build-pipeline.c
index 649389f..92e1e2e 100644
--- a/src/libide/buildsystem/ide-build-pipeline.c
+++ b/src/libide/buildsystem/ide-build-pipeline.c
@@ -1539,6 +1539,22 @@ ide_build_pipeline_do_flush (gpointer data)
g_assert (G_IS_TASK (task_data->task));
/*
+ * If this build request could cause us to spin while we are continually
+ * failing to reach the CONFIGURE stage, protect ourselves as early as we
+ * can. We'll defer to a rebuild request to cause the full thing to build.
+ */
+ if (self->failed &&
+ task_data->type == TASK_BUILD &&
+ task_data->phase <= IDE_BUILD_PHASE_CONFIGURE)
+ {
+ g_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_FAILED,
+ "The build pipeline is in a failed state and requires a rebuild");
+ IDE_RETURN (G_SOURCE_REMOVE);
+ }
+
+ /*
* Now mark the pipeline as busy to protect ourself from anything recursively
* calling into the pipeline.
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]