GNU bug report logs - #58265
29.0.50; [PATCH] $HOME adjustment for 'ert-remote-temporary-file-directory' is wrong

Previous Next

Package: emacs;

Reported by: Jim Porter <jporterbugs <at> gmail.com>

Date: Mon, 3 Oct 2022 01:33:02 UTC

Severity: normal

Tags: patch

Found in version 29.0.50

Done: Jim Porter <jporterbugs <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 58265 in the body.
You can then email your comments to 58265 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#58265; Package emacs. (Mon, 03 Oct 2022 01:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jim Porter <jporterbugs <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 03 Oct 2022 01:33:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; [PATCH] $HOME adjustment for
 'ert-remote-temporary-file-directory' is wrong
Date: Sun, 2 Oct 2022 18:32:32 -0700
[Message part 1 (text/plain, inline)]
I tried to use 'ert-remote-temporary-file-directory' in a test for an 
external package, but it ended up breaking some existing tests simply by 
requiring both tramp and ert-x. These tests indirectly used 'cd' (by way 
of 'compilation-start'), which triggered the failure.

Steps to reproduce:

  $ mkdir -p ~/src
  $ emacs -Q --batch -l tramp -l ert-x --eval '(cd "~/src/")'

Result:

  Error: error ("No such directory: ~/src/")
    mapbacktrace(#f(compiled-function (evald func args flags) 
#<bytecode 0xc43976fdbae86a5>))
    debug-early-backtrace()
    debug-early(error (error "No such directory: ~/src/"))
    error("No such directory: %s" "~/src/")
    cd("~/src")
    eval((cd "~/src") t)
    command-line-1(("-l" "tramp" "-l" "ert-x" "--eval" "(cd \"~/src/\")"))
    command-line()
    normal-top-level()
  No such directory: ~/src/

Looking at ert-x.el, I think this is because 
'ert-remote-temporary-file-directory' does some fixup on $HOME, but it 
was too aggressive. See attached.
[0001-Fix-logic-of-HOME-adjustment-for-ert-remote-temporar.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58265; Package emacs. (Mon, 03 Oct 2022 01:49:01 GMT) Full text and rfc822 format available.

Message #8 received at 58265 <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: 58265 <at> debbugs.gnu.org
Subject: Re: bug#58265: 29.0.50; [PATCH] $HOME adjustment for
 'ert-remote-temporary-file-directory' is wrong
Date: Sun, 2 Oct 2022 18:48:01 -0700
On 10/2/2022 6:32 PM, Jim Porter wrote:
>    Error: error ("No such directory: ~/src/")
>      mapbacktrace(#f(compiled-function (evald func args flags) 
> #<bytecode 0xc43976fdbae86a5>))
>      debug-early-backtrace()
>      debug-early(error (error "No such directory: ~/src/"))
>      error("No such directory: %s" "~/src/")
>      cd("~/src")
>      eval((cd "~/src") t)

Whoops, I tried to shorten the path that I was using to test in the 
backtrace but messed up in a couple spots here. Pretend these are 
"~/src/" too. :)

>      command-line-1(("-l" "tramp" "-l" "ert-x" "--eval" "(cd \"~/src/\")"))
>      command-line()
>      normal-top-level()
>    No such directory: ~/src/




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58265; Package emacs. (Mon, 03 Oct 2022 09:18:01 GMT) Full text and rfc822 format available.

Message #11 received at 58265 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 58265 <at> debbugs.gnu.org
Subject: Re: bug#58265: 29.0.50; [PATCH] $HOME adjustment for
 'ert-remote-temporary-file-directory' is wrong
Date: Mon, 03 Oct 2022 11:17:42 +0200
Jim Porter <jporterbugs <at> gmail.com> writes:

> Looking at ert-x.el, I think this is because
> 'ert-remote-temporary-file-directory' does some fixup on $HOME, but it
> was too aggressive. See attached.

Looks good to me; please go ahead and push.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58265; Package emacs. (Mon, 03 Oct 2022 11:54:01 GMT) Full text and rfc822 format available.

Message #14 received at 58265 <at> debbugs.gnu.org (full text, mbox):

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: 58265 <at> debbugs.gnu.org
Subject: Re: bug#58265: 29.0.50; [PATCH] $HOME adjustment for
 'ert-remote-temporary-file-directory' is wrong
Date: Mon, 03 Oct 2022 13:53:12 +0200
Jim Porter <jporterbugs <at> gmail.com> writes:

Hi Jim,

> Looking at ert-x.el, I think this is because
> 'ert-remote-temporary-file-directory' does some fixup on $HOME, but it
> was too aggressive. See attached.
>
> diff --git a/lisp/emacs-lisp/ert-x.el b/lisp/emacs-lisp/ert-x.el
> index bfd796586d..a891f068a7 100644
> --- a/lisp/emacs-lisp/ert-x.el
> +++ b/lisp/emacs-lisp/ert-x.el
> @@ -568,7 +568,7 @@ ert-remote-temporary-file-directory
>           `("\\`mock\\'" nil ,(system-name)))
>          ;; Emacs's Makefile sets $HOME to a nonexistent value.  Needed
>          ;; in batch mode only, therefore.
> -        (unless (and (null noninteractive) (file-directory-p "~/"))
> +        (when (and noninteractive (not (file-directory-p "~/")))
>            (setenv "HOME" temporary-file-directory))
>          (format "/mock::%s" temporary-file-directory))))
>      "Temporary directory for remote file tests.")

IIRC, I've applied the original setting due to problems on hydra or emba
(don't remember exactly). Let's see how your patch works there.

Best regards, Michael.




Reply sent to Jim Porter <jporterbugs <at> gmail.com>:
You have taken responsibility. (Tue, 04 Oct 2022 00:45:02 GMT) Full text and rfc822 format available.

Notification sent to Jim Porter <jporterbugs <at> gmail.com>:
bug acknowledged by developer. (Tue, 04 Oct 2022 00:45:02 GMT) Full text and rfc822 format available.

Message #19 received at 58265-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Porter <jporterbugs <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 58265-done <at> debbugs.gnu.org
Subject: Re: bug#58265: 29.0.50; [PATCH] $HOME adjustment for
 'ert-remote-temporary-file-directory' is wrong
Date: Mon, 3 Oct 2022 17:44:18 -0700
On 10/3/2022 2:17 AM, Lars Ingebrigtsen wrote:
> Jim Porter <jporterbugs <at> gmail.com> writes:
> 
>> Looking at ert-x.el, I think this is because
>> 'ert-remote-temporary-file-directory' does some fixup on $HOME, but it
>> was too aggressive. See attached.
> 
> Looks good to me; please go ahead and push.

Thanks. Pushed as 43eaa05ff2265ae33f71b73670a8a150a7a716ae. Closing this 
bug now.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 01 Nov 2022 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 228 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.