[gnome-builder] runner: disable environ clearing when running on the host



commit 61045d44576e12859b3b95d2943760fa6e676b2d
Author: Christian Hergert <chergert redhat com>
Date:   Tue Sep 13 23:49:26 2016 -0700

    runner: disable environ clearing when running on the host
    
    By default, allow the child to inherit from the host. While we don't want
    this for building, we do want it for running.

 libide/runner/ide-runner.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/libide/runner/ide-runner.c b/libide/runner/ide-runner.c
index 5f2d58e..a59ba7f 100644
--- a/libide/runner/ide-runner.c
+++ b/libide/runner/ide-runner.c
@@ -171,13 +171,33 @@ ide_runner_real_run_async (IdeRunner           *self,
 
   launcher = ide_subprocess_launcher_new (priv->flags);
 
+  /*
+   * We want the runners to run on the host so that we aren't captive to
+   * our containing system (flatpak, jhbuild, etc).
+   */
   ide_subprocess_launcher_set_run_on_host (launcher, priv->run_on_host);
 
+  /*
+   * We don't want the environment cleared because we need access to
+   * things like DISPLAY, WAYLAND_DISPLAY, and DBUS_SESSION_BUS_ADDRESS.
+   */
+  ide_subprocess_launcher_set_clear_env (launcher, FALSE);
+
+  /*
+   * Overlay the environment provided.
+   */
   ide_subprocess_launcher_overlay_environment (launcher, priv->env);
 
+  /*
+   * Push all of our configured arguments in order.
+   */
   for (GList *iter = priv->argv.head; iter != NULL; iter = iter->next)
     ide_subprocess_launcher_push_argv (launcher, iter->data);
 
+  /*
+   * Set the working directory for the process.
+   * FIXME: Allow this to be configurable! Add IdeRunner::cwd.
+   */
   ide_subprocess_launcher_set_cwd (launcher, g_get_home_dir ());
 
   subprocess = ide_subprocess_launcher_spawn_sync (launcher, cancellable, &error);


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