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

login
register
about
Submitter Jameson Graef Rollins
Date 2011-11-10 16:59:35
Message ID <1320944375-29843-1-git-send-email-jrollins@finestructure.net>
Download mbox | patch
Permalink /patch/1479/
State New
Headers show

Comments

Jameson Graef Rollins - 2011-11-10 16:59:35
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).
---
 test/test-lib.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
Jameson Graef Rollins - 2011-11-10 17:09:53
On Thu, 10 Nov 2011 08:59:35 -0800, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> 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).

Arg.  This was supposed to be sent to the previous thread about this.
Ironically, I'm using the patch that removes id: from the message-id
kill-ring, but then I manually added it back to git send-email!  HA!

So there is now discussion about use detach instead of screen, which is
much more minimal and doesn't use setuid and setgid and therefore
doesn't purge TMPDIR.

In any event, I think we need to push this patch until we have a patch
to use detach in hand.

jamie.
Austin Clements - 2011-11-10 19:28:36
This looks good to me, though it would be good to add a comment
explaining why this dance is necessary.  Perhaps something along the
lines of

# 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.

Quoth Jameson Graef Rollins on Nov 10 at  8:59 am:
> 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).
> ---
>  test/test-lib.sh |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/test/test-lib.sh b/test/test-lib.sh
> index ff5183f..108537e 100755
> --- a/test/test-lib.sh
> +++ b/test/test-lib.sh
> @@ -842,7 +842,9 @@ 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" \
> +		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)' \

Patch

diff --git a/test/test-lib.sh b/test/test-lib.sh
index ff5183f..108537e 100755
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -842,7 +842,9 @@  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" \
+		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)' \