unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: 71235@debbugs.gnu.org
Subject: bug#71235: Failing test on macOS: tramp-test17-dired-with-wildcards
Date: Thu, 30 May 2024 14:12:48 +0200	[thread overview]
Message-ID: <87zfs74hxb.fsf@gmx.de> (raw)
In-Reply-To: <CADwFkm==_kH+uS3HEwh9UmrP2jyGGjQciqK_yA+gVQFxFkC4Hw@mail.gmail.com> (Stefan Kangas's message of "Tue, 28 May 2024 22:56:04 +0000")

Stefan Kangas <stefankangas@gmail.com> writes:

Hi Stefan,

>>> I see one tramp test fail on macOS 14.3.1.  Details below:
>>>
>>> Ran 98 tests, 82 results as expected, 1 unexpected, 15 skipped
>>> (2024-05-27 23:27:48+0200, 89.934240 sec)
>>>
>>> 1 unexpected results:
>>>    FAILED  tramp-test17-dired-with-wildcards
>>
>> Could you pls instrument the test, and run it again? See appended patch.
>
> I've sent you the logs off-list.

Thanks for this. The problem is obvious in the log:

--8<---------------cut here---------------start------------->8---
00:52:56.390327 tramp-send-command (6) # ( cd /var/folders/28/y4qn6tl11_126568wmx_6kpr0000gn/T/ && env INSIDE_EMACS\=30.0.50\,tramp\:2.7.1-pre /bin/sh -c gls\ -d\ -al\ tramp-test\*/\* </dev/null; echo tramp_exit_status $? )
00:52:56.394295 tramp-wait-for-regexp (6) # 
/bin/sh: gls: command not found
tramp_exit_status 127
///75ffbd7d44c24c99d4107a0eba33363e#$
--8<---------------cut here---------------end--------------->8---

However, Tramp hasn't decided to use gls on its own. Debugging the test
case, it looks like it comes from dired-insert-directory:

--8<---------------cut here---------------start------------->8---
    ;; Expand directory wildcards and fill file-list.
    (let ((dir-wildcard (and (null file-list) wildcard
                             (insert-directory-wildcard-in-dir-p dir))))
      (cond ((and dir-wildcard (files--use-insert-directory-program-p))
             (setq switches (concat "-d " switches))
             (let* ((default-directory (car dir-wildcard))
                    (script (format "%s %s %s"
                                    insert-directory-program
                                    switches (cdr dir-wildcard)))
                    (sh (or (and remotep "/bin/sh")
                            (executable-find shell-file-name)
                            (executable-find "sh")))
                    (switch (if remotep "-c" shell-command-switch)))
               ;; Enable globstar
               (when-let ((globstar dired-maybe-use-globstar)
                          (enable-it
                           (assoc-default
                            (file-truename sh) dired-enable-globstar-in-shell
                            (lambda (reg shell) (string-match reg shell)))))
                 (setq script (format "%s; %s" enable-it script)))
               (unless
                   (zerop
                    (process-file sh nil (current-buffer) nil switch script))
                 (user-error
                  "%s: No files matching wildcard" (cdr dir-wildcard)))
               (insert-directory-clean (point) switches)))
--8<---------------cut here---------------end--------------->8---

'script' is a formatted string, which includes
'insert-directory-program'. And that user option tells us

--8<---------------cut here---------------start------------->8---
Absolute or relative name of the ‘ls’-like program.
This is used by ‘insert-directory’ and ‘dired-insert-directory’
(thus, also by ‘dired’).  For Dired, this should ideally point to
GNU ls, or another version of ls that supports the "--dired"
flag.  See ‘dired-use-ls-dired’.

On GNU/Linux and other capable systems, the default is "ls".

On *BSD and macOS systems, the default "ls" does not support
the "--dired" flag.  Therefore, the default is to use the
"gls" executable on such machines, if it exists.  This means
that there should normally be no need to customize this when
installing GNU coreutils using something like ports or Homebrew.
--8<---------------cut here---------------end--------------->8---

So I guess 'insert-directory-program' is "gls" in your case, but Tramp
doesn't find it. Where is it installed? What does '(executable-find "gls")'
return on your machine?

Best regards, Michael.





  parent reply	other threads:[~2024-05-30 12:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-27 21:32 bug#71235: Failing test on macOS: tramp-test17-dired-with-wildcards Stefan Kangas
2024-05-28  7:44 ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-28 22:56   ` Stefan Kangas
2024-05-29  7:28     ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-29 20:51       ` Stefan Kangas
2024-05-30  8:54         ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-05-30 12:12     ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-05-31  9:22       ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-02 10:37         ` Stefan Kangas
2024-06-02 10:19       ` Stefan Kangas
2024-06-02 10:33         ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-02 11:04           ` Stefan Kangas
2024-06-02 11:07             ` Stefan Kangas
2024-06-02 13:14             ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-02 17:51               ` Stefan Kangas
2024-06-02 14:03             ` Gerd Möllmann
2024-06-02 14:23               ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-02 14:46                 ` Gerd Möllmann
2024-06-02 14:55                   ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=87zfs74hxb.fsf@gmx.de \
    --to=bug-gnu-emacs@gnu.org \
    --cc=71235@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=stefankangas@gmail.com \
    /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).