[armedbear] #476: Wrong file type returned by COMPILE-FILE-PATHNAME

armedbear armedbear-devel at common-lisp.net
Tue Nov 3 07:10:43 UTC 2020


#476: Wrong file type returned by COMPILE-FILE-PATHNAME
-------------------------------+--------------------------
      Reporter:  Mark Evenson  |      Owner:  Mark Evenson
          Type:  defect        |     Status:  accepted
      Priority:  minor         |  Milestone:  1.8.1
     Component:  compiler      |    Version:  1.7.2-dev
    Resolution:                |   Keywords:
Parent Tickets:                |
-------------------------------+--------------------------
Description changed by Mark Evenson:

Old description:

> <https://mailman.common-lisp.net/pipermail/armedbear-
> devel/2020-October/004147.html>
>
> {{{
> The code below returns
>  "lx64fsl" in CCL,
>  "fas"     in CLISP, and
>  "fasl"    in SBCL,
> but returns
>  "lisp"    in ABCL.
>
> I think it should return
>  "abcl"    in ABCL.
>
> $ java -jar abcl-1.7.1.jar
> Armed Bear Common Lisp 1.7.1
> Java 1.8.0_272 Oracle Corporation
> OpenJDK 64-Bit Server VM
> Low-level initialization completed in 0.586 seconds.
> Startup completed in 1.336 seconds.
> Type ":help" for a list of available commands.
> CL-USER(1): (pathname-type
>              (compile-file-pathname
>                (make-pathname :name "foo" :type "lisp")
>                :output-file (make-pathname :name "bar")))
> "lisp"
> CL-USER(2):
> }}}

New description:

 <https://mailman.common-lisp.net/pipermail/armedbear-
 devel/2020-October/004147.html>

 {{{
 The code below returns
  "lx64fsl" in CCL,
  "fas"     in CLISP, and
  "fasl"    in SBCL,
 but returns
  "lisp"    in ABCL.

 I think it should return
  "abcl"    in ABCL.

 $ java -jar abcl-1.7.1.jar
 Armed Bear Common Lisp 1.7.1
 Java 1.8.0_272 Oracle Corporation
 OpenJDK 64-Bit Server VM
 Low-level initialization completed in 0.586 seconds.
 Startup completed in 1.336 seconds.
 Type ":help" for a list of available commands.
 CL-USER(1): (pathname-type
              (compile-file-pathname
                (make-pathname :name "foo" :type "lisp")
                :output-file (make-pathname :name "bar")))
 "lisp"
 CL-USER(2):
 }}}

 COMPILE-FILE, COMPILE-FILE-PATHNAME disagree on output dir
 <https://mailman.common-lisp.net/pipermail/armedbear-
 devel/2020-October/004151.html>

 {{{
 COMPILE-FILE-PATHNAME is supposed to return "the pathname that
 COMPILE-FILE would write into, if given the same arguments" but in
 the example below, COMPILE-FILE-PATHNAME returns "src/obj/foo.abcl"
 while the file that is actually written into is "obj/foo.abcl".

 Looking at the spec, my opinion is that COMPILE-FILE is doing the
 right thing, and COMPILE-FILE-PATHNAME should be changed to match it.

 I suppose some might disagree with me about which behavior is correct,
 but no one can disagree that the two functions' behavior should match.

 $ mkdir src obj
 $ echo '(format t "~&Hello, world!~%")' > src/foo.lisp
 $ java -jar abcl-1.7.1.jar
 Armed Bear Common Lisp 1.7.1
 Java 1.8.0_272 Oracle Corporation
 OpenJDK 64-Bit Server VM
 Low-level initialization completed in 0.179 seconds.
 Startup completed in 0.828 seconds.
 Type ":help" for a list of available commands.
 CL-USER(1): (defvar *infile*
                     (make-pathname :directory '(:relative "src")
                                    :name "foo"
                                    :type "lisp"))
 *INFILE*
 CL-USER(2): (defvar *outfile*
                     (make-pathname :directory '(:relative "obj")
                                    :type "abcl"
                                    :defaults *infile*))
 *OUTFILE*
 CL-USER(3): (compile-file *infile* :output-file *outfile*)
 ; Compiling /tmp/foo/src/foo.lisp ...
 ; (FORMAT T ...)
 ; Wrote /tmp/foo/obj/foo.abcl (0.014 seconds)
 #P"/tmp/foo/obj/foo.abcl"
 NIL
 NIL
 CL-USER(4): (compile-file-pathname *infile* :output-file *outfile*)
 #P"/tmp/foo/src/obj/foo.abcl"
 CL-USER(5):
 }}}

--

-- 
Ticket URL: <https://abcl.org/trac/ticket/476#comment:5>
armedbear <https://abcl.org>
armedbear


More information about the armedbear-ticket mailing list