[gnome-builder/wip/chergert/pipeline: 1/2] ctags: override TMPDIR for persistent storage



commit dad24d487ef2eec54b486e6b0368d7824ce6a5cb
Author: Christian Hergert <chergert redhat com>
Date:   Thu Feb 2 23:04:17 2017 -0800

    ctags: override TMPDIR for persistent storage
    
    We wan't persistent storage for TMPDIR when generating tags because
    it can result in large files being created (which can exhaust ram if
    /tmp is tmpfs).
    
    This should also be safe on BSD since we are just using ~/.cache/...

 plugins/ctags/ide-ctags-builder.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/plugins/ctags/ide-ctags-builder.c b/plugins/ctags/ide-ctags-builder.c
index cbb0b3d..ce40b6a 100644
--- a/plugins/ctags/ide-ctags-builder.c
+++ b/plugins/ctags/ide-ctags-builder.c
@@ -212,6 +212,13 @@ ide_ctags_builder_build_worker (GTask        *task,
   launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_NONE);
   g_subprocess_launcher_set_cwd (launcher, workpath);
   g_subprocess_launcher_set_stdout_file_path (launcher, tags_file);
+  /*
+   * ctags can sometimes write to TMPDIR for incremental writes so that it
+   * can sort internally. On large files this can cause us to run out of
+   * tmpfs. Instead, just use the home dir which should map to something
+   * that is persistent.
+   */
+  g_subprocess_launcher_setenv (launcher, "TMPDIR", tagsdir, TRUE);
   process = g_subprocess_launcher_spawnv (launcher, (const gchar * const *)argv->pdata, &error);
 
   EGG_COUNTER_INC (parse_count);


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