unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Glenn Morris <rgm@gnu.org>
To: Jorgen Schaefer <contact@jorgenschaefer.de>
Cc: 19657@debbugs.gnu.org
Subject: bug#19657: 25.0.50; Test failures in Emacs master, can't figure out what I'm doing wrong
Date: Thu, 22 Jan 2015 19:50:30 -0500	[thread overview]
Message-ID: <1i7fweuxpl.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <fmvbjyvc5l.fsf@fencepost.gnu.org> (Glenn Morris's message of "Thu, 22 Jan 2015 14:38:30 -0500")

Glenn Morris wrote:

> mkdir $HOME/foo
> TMPDIR=$HOME/foo make package-test            # fails

I think this is due to with-package-test's manipulation of HOME in
process-environment. The problem can be summarized as:

(file-truename (abbreviate-file-name "/home/rgm/foo"))
    ->  "/home/rgm/foo"

(let ((process-environment (cons "HOME=/home/rgm/bar" process-environment)))
  (file-truename (abbreviate-file-name "/home/rgm/foo")))
    ->  "/home/rgm/bar/foo"

Because abbreviated-home-dir is cached the first time it is used.
And find-file-noselect does various cycles of abbreviate/expand/truename.
So calling find-file-noselect after changing HOME will mess up for
files under the new HOME.

So basically if you want to change HOME, remember to reset
abbreviated-home-dir as well, else get various odd problems.

Yuck.

Anyway, the following patch seems to fix this specific case.

(Maybe abbreviated-home-dir should either be removed, or check that HOME
hasn't changed since it was set.)

*** a/test/automated/package-test.el
--- b/test/automated/package-test.el
***************
*** 91,96 ****
--- 91,97 ----
    `(let* ((package-test-user-dir (make-temp-file "pkg-test-user-dir-" t))
            (process-environment (cons (format "HOME=%s" package-test-user-dir)
                                       process-environment))
+           (abbreviated-home-dir)
            (package-user-dir package-test-user-dir)
            (package-archives `(("gnu" . ,package-test-data-dir)))
            (old-yes-no-defn (symbol-function 'yes-or-no-p))
***************
*** 340,346 ****
       (should (search-forward "simple-single is an installed package." nil t))
       (should (search-forward
                (format "Status: Installed in `%s/' (unsigned)."
!                       (expand-file-name "simple-single-1.3" package-user-dir))
                nil t))
       (should (search-forward "Version: 1.3" nil t))
       (should (search-forward "Summary: A single-file package with no dependencies"
--- 341,348 ----
       (should (search-forward "simple-single is an installed package." nil t))
       (should (search-forward
                (format "Status: Installed in `%s/' (unsigned)."
!                       (abbreviate-file-name
!                        (expand-file-name "simple-single-1.3" package-user-dir)))
                nil t))
       (should (search-forward "Version: 1.3" nil t))
       (should (search-forward "Summary: A single-file package with no dependencies"
***************
*** 410,416 ****
         (should (search-forward "signed-good is an installed package." nil t))
         (should (search-forward
  		(format "Status: Installed in `%s/'."
! 			(expand-file-name "signed-good-1.0" package-user-dir))
  		nil t))))))
  
  
--- 412,419 ----
         (should (search-forward "signed-good is an installed package." nil t))
         (should (search-forward
  		(format "Status: Installed in `%s/'."
!                         (abbreviate-file-name
!                          (expand-file-name "signed-good-1.0" package-user-dir)))
  		nil t))))))
  
  






  parent reply	other threads:[~2015-01-23  0:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22 19:00 bug#19657: 25.0.50; Test failures in Emacs master, can't figure out what I'm doing wrong Jorgen Schaefer
2015-01-22 19:38 ` Glenn Morris
2015-01-22 19:57   ` Jorgen Schäfer
2015-01-22 20:04     ` Glenn Morris
2015-01-22 23:11       ` Stefan Monnier
2015-01-23  0:50   ` Glenn Morris [this message]
2015-01-23  0:54     ` Dmitry Gutov
2015-01-23  2:03       ` Glenn Morris
2015-01-23  9:48       ` Eli Zaretskii
2015-01-23 13:37         ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1i7fweuxpl.fsf@fencepost.gnu.org \
    --to=rgm@gnu.org \
    --cc=19657@debbugs.gnu.org \
    --cc=contact@jorgenschaefer.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).