[gnome-builder/wip/gtk4-port] libide/foundry: add minimal environment from prepare_to_run



commit cd8794234a08a1029e79fcc70d882f840137f1a1
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jun 28 03:37:35 2022 -0700

    libide/foundry: add minimal environment from prepare_to_run
    
    I don't want to see this duplicated everywhere.

 src/libide/foundry/ide-run-manager.c | 5 -----
 src/libide/foundry/ide-runtime.c     | 3 +++
 src/plugins/host/gbp-host-runtime.c  | 1 -
 3 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/src/libide/foundry/ide-run-manager.c b/src/libide/foundry/ide-run-manager.c
index bd723a484..87cbaf5d3 100644
--- a/src/libide/foundry/ide-run-manager.c
+++ b/src/libide/foundry/ide-run-manager.c
@@ -818,11 +818,6 @@ ide_run_manager_prepare_run_context (IdeRunManager *self,
   environ = g_environ_setenv (environ, "USER", g_get_user_name (), TRUE);
   ide_run_context_push_expansion (run_context, (const char * const *)environ);
 
-  /* First we need to setup our basic runtime envronment so that we can be
-   * reasonably certain the application can access the desktop session.
-   */
-  ide_run_context_add_minimal_environment (run_context);
-
   /* Setup working directory */
   {
     const char *cwd = ide_run_command_get_cwd (run_command);
diff --git a/src/libide/foundry/ide-runtime.c b/src/libide/foundry/ide-runtime.c
index 2ba0fb70f..2e4b70fdb 100644
--- a/src/libide/foundry/ide-runtime.c
+++ b/src/libide/foundry/ide-runtime.c
@@ -798,6 +798,9 @@ ide_runtime_prepare_to_run (IdeRuntime    *self,
 
   IDE_RUNTIME_GET_CLASS (self)->prepare_to_run (self, pipeline, run_context);
 
+  /* Give the run_context access to some environment */
+  ide_run_context_add_minimal_environment (run_context);
+
   IDE_EXIT;
 }
 
diff --git a/src/plugins/host/gbp-host-runtime.c b/src/plugins/host/gbp-host-runtime.c
index d1cb8286a..058142081 100644
--- a/src/plugins/host/gbp-host-runtime.c
+++ b/src/plugins/host/gbp-host-runtime.c
@@ -102,7 +102,6 @@ gbp_host_runtime_prepare_to_run (IdeRuntime    *runtime,
   g_assert (IDE_IS_RUN_CONTEXT (run_context));
 
   ide_run_context_push_host (run_context);
-  ide_run_context_add_minimal_environment (run_context);
 
   config = ide_pipeline_get_config (pipeline);
   prefix = ide_config_get_prefix (config);


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