Raymond Toy pushed to branch issue-158-darwin-pathnames-utf8 at cmucl / cmucl
Commits:
-
d01f2cf9
by Raymond Toy at 2023-01-18T08:00:32-08:00
-
7c44d848
by Raymond Toy at 2023-01-19T15:30:06-08:00
-
ce202074
by Raymond Toy at 2023-02-10T08:29:32-08:00
-
9eb801f6
by Raymond Toy at 2023-02-15T13:01:43-08:00
-
4be1d90c
by Raymond Toy at 2023-02-15T21:23:15+00:00
-
aca1967b
by Raymond Toy at 2023-02-15T13:43:20-08:00
5 changed files:
- src/code/extfmts.lisp
- src/code/lispinit.lisp
- src/code/unix.lisp
- src/i18n/locale/cmucl-unix.pot
- tests/issues.lisp
Changes:
... | ... | @@ -373,7 +373,7 @@ |
373 | 373 | ;; Set filename encoding to NIL to bypass any encoding; it's not
|
374 | 374 | ;; needed to open the aliases file. NIL means the pathname string is passed as is where only the low 8 bits of the
|
375 | 375 | (let ((*package* (find-package "KEYWORD"))
|
376 | - (unix::*filename-encoding* nil))
|
|
376 | + (unix::*filename-encoding* :null))
|
|
377 | 377 | (with-open-file (stm "ext-formats:aliases" :if-does-not-exist nil
|
378 | 378 | :external-format :iso8859-1)
|
379 | 379 | (when stm
|
... | ... | @@ -493,7 +493,7 @@ |
493 | 493 | ;; encoding to NIL because we don't need any special
|
494 | 494 | ;; encoding to open the format files.
|
495 | 495 | (let* ((*print-readably* nil)
|
496 | - (unix::*filename-encoding* nil)
|
|
496 | + (unix::*filename-encoding* :null)
|
|
497 | 497 | (*package* (find-package "STREAM"))
|
498 | 498 | (lisp::*enable-package-locked-errors* nil)
|
499 | 499 | (s (open (format nil "ext-formats:~(~A~).lisp" name)
|
... | ... | @@ -1157,7 +1157,7 @@ character and illegal outputs are replaced by a question mark.") |
1157 | 1157 | (unless (find-external-format filenames)
|
1158 | 1158 | (error (intl:gettext "Can't find external-format ~S.") filenames))
|
1159 | 1159 | (setq filenames (ef-name (find-external-format filenames)))
|
1160 | - (when (and unix::*filename-encoding*
|
|
1160 | + (when (and (not (eq unix::*filename-encoding* :null))
|
|
1161 | 1161 | (not (eq unix::*filename-encoding* filenames)))
|
1162 | 1162 | (cerror (intl:gettext "Change it anyway.")
|
1163 | 1163 | (intl:gettext "The external-format for encoding filenames is already set.")))
|
... | ... | @@ -344,7 +344,7 @@ |
344 | 344 | #-gengc (setf unix::*interrupt-pending* nil)
|
345 | 345 | (setf *type-system-initialized* nil)
|
346 | 346 | (setf *break-on-signals* nil)
|
347 | - (setf unix::*filename-encoding* nil)
|
|
347 | + (setf unix::*filename-encoding* :null)
|
|
348 | 348 | (setf *enable-darwin-path-normalization* nil)
|
349 | 349 | #+gengc (setf conditions::*handler-clusters* nil)
|
350 | 350 | (setq intl::*default-domain* "cmucl")
|
... | ... | @@ -25,22 +25,22 @@ |
25 | 25 | ;; it must be set to :iso8859-1 (or left as NIL), making files with
|
26 | 26 | ;; non-Latin-1 characters "mojibake", but otherwise they'll be inaccessible.
|
27 | 27 | ;; Must be set to NIL initially to enable building Lisp!
|
28 | -(defvar *filename-encoding* nil
|
|
28 | +(defvar *filename-encoding* :null
|
|
29 | 29 | "The encoding to use for converting a namestring to a string that can
|
30 | 30 | be used by the operations system. It must be a valid
|
31 | - external-format name or NIL. NIL means the string is passed as is
|
|
32 | - to the operating system. The operating system will get the low 8
|
|
33 | - bits of each UTF-16 code unit of the string.")
|
|
31 | + external-format name or :NULL. :NULL means the string
|
|
32 | + is passed as is to the operating system. The operating system will
|
|
33 | + get the low 8 bits of each UTF-16 code unit of the string.")
|
|
34 | 34 | |
35 | 35 | (eval-when (:compile-toplevel :load-toplevel :execute)
|
36 | 36 | (defmacro %name->file (string)
|
37 | - `(if *filename-encoding*
|
|
38 | - (string-encode ,string *filename-encoding*)
|
|
39 | - ,string))
|
|
37 | + `(if (eql *filename-encoding* :null)
|
|
38 | + ,string
|
|
39 | + (string-encode ,string *filename-encoding*)))
|
|
40 | 40 | (defmacro %file->name (string)
|
41 | - `(if *filename-encoding*
|
|
42 | - (string-decode ,string *filename-encoding*)
|
|
43 | - ,string)))
|
|
41 | + `(if (eql *filename-encoding* :null)
|
|
42 | + ,string
|
|
43 | + (string-decode ,string *filename-encoding*))))
|
|
44 | 44 | |
45 | 45 | |
46 | 46 | ;;;; Common machine independent structures.
|
... | ... | @@ -15,6 +15,15 @@ msgstr "" |
15 | 15 | "Content-Type: text/plain; charset=UTF-8\n"
|
16 | 16 | "Content-Transfer-Encoding: 8bit\n"
|
17 | 17 | |
18 | +#: src/code/unix.lisp
|
|
19 | +msgid ""
|
|
20 | +"The encoding to use for converting a namestring to a string that can\n"
|
|
21 | +" be used by the operations system. It must be a valid\n"
|
|
22 | +" external-format name or :NULL. :NULL means the string\n"
|
|
23 | +" is passed as is to the operating system. The operating system will\n"
|
|
24 | +" get the low 8 bits of each UTF-16 code unit of the string."
|
|
25 | +msgstr ""
|
|
26 | + |
|
18 | 27 | #: src/code/unix.lisp
|
19 | 28 | msgid "Syscall ~A failed: ~A"
|
20 | 29 | msgstr ""
|
... | ... | @@ -416,9 +416,12 @@ |
416 | 416 | ;; running a pipeline with linux, but otherwise enable it. The
|
417 | 417 | ;; pipeline defines the envvar GITLAB_CI so check for that.
|
418 | 418 | ;;
|
419 | +;; This also fails on Darwin CI now. Let's just disable the test if
|
|
420 | +;; running on CI.
|
|
421 | +;;
|
|
419 | 422 | ;; It would be better if lisp-unit had a way of marking tests as known
|
420 | 423 | ;; failures, but it doesn't.
|
421 | -#+#.(cl:if (cl:and (ext:featurep :linux) (unix:unix-getenv "GITLAB_CI")) '(or) '(and))
|
|
424 | +#+#.(cl:if (cl:and (unix:unix-getenv "GITLAB_CI")) '(or) '(and))
|
|
422 | 425 | (define-test issue.41.1
|
423 | 426 | (:tag :issues)
|
424 | 427 | (issue-41-tester unix:sigstop))
|