armedbear / abcl

Armed Bear Common Lisp <git+https://github.com/armedbear/abcl/> <--> <svn+https://abcl.org/svn> Bridge
https://abcl.org#rdfs:seeAlso<https://gitlab.common-lisp.net/abcl/abcl>
Other
288 stars 29 forks source link

Two directory issues #660

Open alanruttenberg opened 7 months ago

alanruttenberg commented 7 months ago

1) (make-pathname :type 'foo) yields a stacktrace for assertion failure in the repl . Should validate fields as strings. See top of trace below. 2) directory appears to be case sensitive (directory (merge-pathnames (make-pathname :type (string r) :name :wild) fromdir)) fails unless type is (downcase (string r)) for a directory full of files with type ".r5" where r was 'r5.

Cut off bottom of trace below the uid-named function, which is mine.

ABCL Debug.assertTrue() assertion failed!
java.lang.Error: ABCL Debug.assertTrue() assertion failed!
    at org.armedbear.lisp.Debug.assertTrue(Debug.java:48)
    at org.armedbear.lisp.Pathname.getNamestring(Pathname.java:584)
    at org.armedbear.lisp.Pathname$pf_namestring.execute(Pathname.java:982)
    at org.armedbear.lisp.Symbol.execute(Symbol.java:805)
    at org.armedbear.lisp.LispThread.execute(LispThread.java:910)
    at org.armedbear.lisp.directory_6.execute(directory.lisp:101)
    at org.armedbear.lisp.CompiledClosure.execute(CompiledClosure.java:98)
    at org.armedbear.lisp.Symbol.execute(Symbol.java:805)
    at org.armedbear.lisp.LispThread.execute(LispThread.java:910)
    at abcl_ae91aec9_63af_46ea_a9c6_effa15ed9003.execute(Unknown Source)

(lisp-implementation-version)
"1.9.2-dev"
"OpenJDK_64-Bit_Server_VM-Homebrew-17.0.1+1"
"x86_64-Mac_OS_X-10.15.7"
easye commented 7 months ago

As for 2., I don't understand the problem: DIRECTORY should be case sensitive, shouldn't it?

easye commented 7 months ago

https://github.com/armedbear/abcl/pull/661 fixes your first problem.

alanruttenberg commented 7 months ago

Where does it say directory is case sensitive? I'd expect it to be case sensitive on a case-sensitive file system, but MacOS isn't. Probe-file isn't case sensitive. Open isn't either.

easye commented 7 months ago

Where does it say directory is case sensitive? I'd expect it to be case sensitive on a case-sensitive file system, but MacOS isn't. Probe-file isn't case sensitive. Open isn't either.

After reading through the hyperspec's section on case in pathnames https://novaspec.org/cl/19_2_Pathnames#sec_19_2_2_1_2, I grant that you are more correct than I am. Technically, what matters is what argument is passed via the :case keyword when the pathname is constructed. I need to read through the ABCL code a bit more with this behavior in mind to see how conforming our behavior could possibly be. I have the feeling that we were never doing the right thing here, but could be surprised.