Patchworkβ test: Use env to set TMPDIR when running emacs in screen.

login
register
about
Submitter Jameson Graef Rollins
Date 2011-11-10 19:35:02
Message ID <1320953702-16732-1-git-send-email-jrollins@finestructure.net>
Download mbox | patch
Permalink /patch/1480/
State New
Headers show

Comments

Jameson Graef Rollins - 2011-11-10 19:35:02
This is to get around a bug where screen unsets TMPDIR.  This causes
problems for users who set TMPDIR to something other than it's default
(/tmp).
---
This just adds some comments over the previous patch.
Thanks to Austin Clements for the suggestion.

 test/test-lib.sh |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

Patch

diff --git a/test/test-lib.sh b/test/test-lib.sh
index c81c709..5ed6a96 100755
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -844,7 +844,12 @@  test_emacs () {
 	if [ -z "$EMACS_SERVER" ]; then
 		EMACS_SERVER="notmuch-test-suite-$$"
 		# start a detached screen session with an emacs server
-		screen -S "$EMACS_SERVER" -d -m "$TMP_DIRECTORY/run_emacs" \
+		# The emacs server places its socket in TMPDIR, but ld.so unsets
+		# TMPDIR when loading setgid binaries like screen, so we must
+		# explicitly pass TMPDIR through to emacs.
+		screen -S "$EMACS_SERVER" -d -m \
+		    env TMPDIR="$TMPDIR" \
+		    "$TMP_DIRECTORY/run_emacs" \
 			--no-window-system \
 			--eval "(setq server-name \"$EMACS_SERVER\")" \
 			--eval '(server-start)' \