Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#476 closed defect (fixed)

Wrong file type returned by COMPILE-FILE-PATHNAME

Reported by: Mark Evenson Owned by: Mark Evenson
Priority: minor Milestone: 1.9.0
Component: compiler Version: 1.7.2-dev
Keywords: Cc:
Parent Tickets:

Description (last modified by Mark Evenson)

<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):

Change History (8)

comment:1 Changed 4 years ago by Mark Evenson

Owner: set to Mark Evenson
Status: newaccepted

This should be easy.

comment:2 Changed 4 years ago by Mark Evenson

Version: 1.7.1-dev1.7.2-dev

comment:3 Changed 4 years ago by Mark Evenson

Milestone: 1.8.01.8.1

Ticket retargeted after milestone closed

comment:5 Changed 4 years ago by Mark Evenson

Description: modified (diff)

comment:6 Changed 4 years ago by Mark Evenson

Resolution: fixed
Status: acceptedclosed

comment:7 Changed 4 years ago by Mark Evenson

comment:8 Changed 3 years ago by Mark Evenson

Milestone: 1.8.11.9.0
Note: See TracTickets for help on using tickets.