[gnome-builder/wip/gtk4-port: 1703/1774] libide/foundry: use run context for creating launchers
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/gtk4-port: 1703/1774] libide/foundry: use run context for creating launchers
- Date: Mon, 11 Jul 2022 22:31:54 +0000 (UTC)
commit 33329fd5aa99e02716fbbef3fc5a2209016727b4
Author: Christian Hergert <chergert redhat com>
Date: Tue Jun 28 12:43:38 2022 -0700
libide/foundry: use run context for creating launchers
This is one of our last holdouts using ide_runtime_create_launcher() which
we want to get rid of.
src/libide/foundry/ide-pipeline.c | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
---
diff --git a/src/libide/foundry/ide-pipeline.c b/src/libide/foundry/ide-pipeline.c
index d3041be44..52ee08557 100644
--- a/src/libide/foundry/ide-pipeline.c
+++ b/src/libide/foundry/ide-pipeline.c
@@ -2965,14 +2965,14 @@ ide_pipeline_create_launcher (IdePipeline *self,
GError **error)
{
g_autoptr(IdeSubprocessLauncher) ret = NULL;
+ g_autoptr(IdeRunContext) run_context = NULL;
+ g_auto(GStrv) environ = NULL;
IdeRuntime *runtime;
g_return_val_if_fail (IDE_IS_MAIN_THREAD (), NULL);
g_return_val_if_fail (IDE_IS_PIPELINE (self), NULL);
- runtime = ide_config_get_runtime (self->config);
-
- if (runtime == NULL)
+ if (!(runtime = ide_config_get_runtime (self->config)))
{
g_set_error (error,
G_IO_ERROR,
@@ -2982,17 +2982,19 @@ ide_pipeline_create_launcher (IdePipeline *self,
return NULL;
}
- ret = ide_runtime_create_launcher (runtime, error);
+ environ = ide_environment_get_environ (ide_config_get_environment (self->config));
+
+ run_context = ide_run_context_new ();
+ ide_runtime_prepare_to_build (runtime, self, run_context);
+ ide_run_context_set_cwd (run_context, ide_pipeline_get_builddir (self));
+ ide_run_context_add_environ (run_context, (const char * const *)environ);
+ /* Always ignore V=1 from configurations */
+ ide_run_context_setenv (run_context, "V", "0");
+
+ ret = ide_run_context_end (run_context, error);
if (ret != NULL)
{
- IdeEnvironment *env = ide_config_get_environment (self->config);
-
- ide_subprocess_launcher_set_clear_env (ret, TRUE);
- ide_subprocess_launcher_overlay_environment (ret, env);
- /* Always ignore V=1 from configurations */
- ide_subprocess_launcher_setenv (ret, "V", "0", TRUE);
- ide_subprocess_launcher_set_cwd (ret, ide_pipeline_get_builddir (self));
ide_subprocess_launcher_set_flags (ret,
(G_SUBPROCESS_FLAGS_STDERR_PIPE |
G_SUBPROCESS_FLAGS_STDOUT_PIPE));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]