Bug report: COMPILE-FILE, COMPILE-FILE-PATHNAME disagree on output dir

Robert Munyer 2433647181 at munyer.com
Wed Oct 28 02:15:16 UTC 2020


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



More information about the armedbear-devel mailing list