Subject: Re: bug#42537: 28.0.50; wdired-test-bug34915 test failing on macOS

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 04 Aug 2020 14:32:13 +0200

Philipp <[email-masked]> writes:

>       :form
>       (equal "bar@" "wbar@")
>       :value nil :explanation
>       (arrays-of-different-length 4 5 "bar@" "wbar@" first-mismatch-at 0)))
>    FAILED  3/5  wdired-test-bug34915 (0.353864 sec)
>
> (Crystal ball says this might be related to macOS filename
> normalization/case-insensitivity.)

There's something very odd going on here.

If I create a file /tmp/bar and then say

(make-symbolic-link "bar" "foo")

I get, as expected

  -rw-r--r--  1 larsi  wheel    0 Aug  4 14:09 bar
  lrwxr-xr-x  1 larsi  wheel    3 Aug  4 14:09 foo -> bar

However, if I do something similar in the test director, dired insists
on adding a "@" to the end of the file name, which messes up everything:
 
  /var/folders/l6/0kf2px5j7tz_wbp9lf_hgfwm0000gn/T/test-dir-iRvcaN:

  -rw-r--r--  1 larsi  staff   1 Aug  4 14:12 zot
  lrwxr-xr-x  1 larsi  staff   3 Aug  4 14:14 zotlink@ -> zot

Uhm...  Oh, that's the entire point of the test.  :-)  "ls -F" adds the
"@".

So the error is a real bug, because

 (dired-get-filename 'no-dir t)
 => "zotlink@"

And that's because dired-ls-F-marks-symlinks is nil...

;; 1. For dired to work on a host which marks symlinks with a trailing @ in
;;    an ls -alF listing, you need to (setq dired-ls-F-marks-symlinks t).
;;    Most UNIX systems do not do this, but ULTRIX does.

And Macos is another:

larsi@space /tmp % ls -alF /tmp/
total 0
drwxrwxrwt  8 root   wheel  256 Aug  4 14:12 ./
drwxr-xr-x  6 root   wheel  192 Aug  2 18:53 ../
-rw-r--r--  1 larsi  wheel    0 Aug  4 14:09 bar
lrwxr-xr-x  1 larsi  wheel    3 Aug  4 14:09 foo@ -> bar
lrwxr-xr-x  1 larsi  wheel    3 Aug  4 14:10 foo3@ -> bar
lrwxr-xr-x  1 larsi  wheel    3 Aug  4 14:12 foo4@ -> bar

OK, I've now adjusted the test and fixed the doc string to
dired-ls-F-marks-symlinks in Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no