[Ecls-list] Problem with compiled asdf.
Pascal J. Bourguignon
pjb at informatimago.com
Tue Jun 29 14:12:38 UTC 2010
Juan Jose Garcia-Ripoll <juanjose.garciaripoll at googlemail.com> writes:
> On Mon, Jun 28, 2010 at 6:52 AM, Pascal J. Bourguignon <pjb at informatimago.com> wrote:
>
> With ecl 10.4.2, for some ASDF systems, I get this error:
> In function CAR, the value of the only argument is
> #<The BUILT-IN-CLASS SYMBOL>
> which is not of the expected type LIST
>
> There was a problem with one function proclamation causing this --
> the compiler generated a type check that was erroneous and thus not
> satisfied.
>
> The backtrace is rather uninformative, there's no call to CAR in the lambda of asdf-load:
>
> Yes, this is very unfortunate but the problem is that backtraces are
> only produced when ECL inserts the appropriate code in all functions
> that must appear in the backtrace. Since that is rather expensive,
> we currently have no backtrace for compiled functions with default
> debug settings.
Sure, it's the same in clisp. Is there an easy way to declare the
optimizations to compile the contribs?
Otherwise, I'm afraid I'm still bumping against this problem.
I removed asdf-binary-location and slime caches, and recompiled
everything, with cvs from today.
What does it mean in slime when it shows a local variable without a value, such as:
ASDF::OPTIONS#1 =
?
I'm guessing it means it's unbound, but how could that be, for a parameter?
To get the following backtrace, I used:
(require :asdf)
(load (merge-pathnames
(make-pathname :name "ASDF" :type "LISP"
:directory '(:relative "ECL-REQUIRES")
:case :common)
*load-pathname*
nil)
:verbose t)
that is, I loaded the source of asdf.lisp.
I seem to have reduced the problem to the situation where asdf-install
is loaded. See test.lisp below.
#<SIMPLE-TYPE-ERROR 60613040>
--------------------
Class: #<The STANDARD-CLASS SIMPLE-TYPE-ERROR>
--------------------
Group slots by inheritance [ ]
Sort slots alphabetically [X]
All Slots:
[ ] DATUM = #<The BUILT-IN-CLASS SYMBOL>
[ ] EXPECTED-TYPE = LIST
[ ] FORMAT-ARGUMENTS = (CAR #<The BUILT-IN-CLASS SYMBOL> LIST)
[ ] FORMAT-CONTROL = "In ~:[an anonymous function~;~:*function ~A~], the value of the only argum..
[set value] [make unbound]
Error while trying to load definition for system
com.informatimago.common-lisp from pathname
PACKAGES:COM;INFORMATIMAGO;COMMON-LISP;SYSTEM.ASD:
In function CAR, the value of the only argument is
#<The BUILT-IN-CLASS SYMBOL>
which is not of the expected type LIST
[Condition of type ASDF:LOAD-SYSTEM-DEFINITION-ERROR]
Restarts:
0: [RETRY] Retry SLIME REPL evaluation request.
1: [*PROCESS-INPUT] Continue reading input.
2: [ABORT] Return to SLIME's top level.
3: [CLOSE-CONNECTION] Close SLIME connection.
4: [RESTART-TOPLEVEL] Go back to Top-Level REPL.
Backtrace:
0: DEBUG-IN-EMACS
1: INVOKE-SLIME-DEBUGGER
2: G826
3: CALL-WITH-DEBUGGER-HOOK
4: SWANK-DEBUGGER-HOOK
5: #<bytecompiled-function 0000000002ad2640>
Locals:
ASDF::NAME = :COM.INFORMATIMAGO.COMMON-LISP
ASDF::ERROR-P#1 = T
ASDF::NAME#2 = "com.informatimago.common-lisp"
ASDF::IN-MEMORY#3 = NIL
ASDF::ON-DISK#4 = #P"PACKAGES:COM;INFORMATIMAGO;COMMON-LISP;SYSTEM.ASD"
PACKAGE#5 = #<"ASDF0" package>
CONDITION#6 = #<a SIMPLE-TYPE-ERROR>
6: CAR
[No Locals]
7: #<bytecompiled-function PARSE-COMPONENT-FORM>
Locals:
ASDF::PARENT = NIL
ASDF::OPTIONS#1 =
#:G1062#2 =
TYPE#3 = :MODULE
ASDF::NAME#4 = "com.informatimago.common-lisp"
REST#5 =
#:G1063#6 =
#:G1064#7 =
ASDF::COMPONENTS#8 =
#:G1065#9 = #P"/home/pjb/firms/medicalis/src/mdi/subprojects/dependencies/lisp/packages..
PATHNAME#10 = #P"/home/pjb/firms/medicalis/src/mdi/subprojects/dependencies/lisp/packages..
#:G1066#11 = NIL
ASDF::DEFAULT-COMPONENT-CLASS#12 = NIL
#:G1067#13 = NIL
ASDF:PERFORM#14 = NIL
#:G1068#15 = NIL
ASDF:EXPLAIN#16 = NIL
#:G1069#17 = NIL
ASDF:OUTPUT-FILES#18 = NIL
#:G1070#19 = NIL
ASDF:OPERATION-DONE-P#20 = NIL
#:G1071#21 = NIL
ASDF::WEAKLY-DEPENDS-ON#22 = NIL
#:G1072#23 = NIL
ASDF::DEPENDS-ON#24 = NIL
#:G1073#25 = NIL
ASDF::SERIAL#26 = NIL
#:G1074#27 = NIL
ASDF::IN-ORDER-TO#28 = NIL
ASDF::OTHER-ARGS#29 =
8: #<bytecompiled-function BYTECODES> ;;;;;;;;;; this is cl:load
[No Locals]
9: LOAD ;;;;;;;;;; this is a wraper to load.
Locals:
"COMMON-LISP-USER::FILESPEC" = #P"PACKAGES:COM;INFORMATIMAGO;COMMON-LISP;SYSTEM.ASD"
"COMMON-LISP-USER::PATH"#1 = #P"/home/pjb/firms/medicalis/src/mdi/subprojects/dependencies/lisp/packages..
"#:G3"#2 = #<frame 0 000000000068b0e8>
10: #<bytecompiled-function FIND-SYSTEM>
Locals:
ASDF::NAME = :COM.INFORMATIMAGO.COMMON-LISP
ASDF::ERROR-P#1 = T
ASDF::NAME#2 = "com.informatimago.common-lisp"
ASDF::IN-MEMORY#3 = NIL
ASDF::ON-DISK#4 = #P"PACKAGES:COM;INFORMATIMAGO;COMMON-LISP;SYSTEM.ASD"
PACKAGE#5 = #<"ASDF0" package>
11: #<bytecompiled-function OPERATE>
Locals:
ASDF::OPERATION-CLASS = ASDF:LOAD-OP
ASDF:SYSTEM#1 = :COM.INFORMATIMAGO.COMMON-LISP
ASDF::ARGS#2 = NIL
ASDF:VERSION#3 = NIL
ASDF::FORCE#4 = NIL
ASDF::OP#5 = #<ASDF:LOAD-OP NIL 60373152>
12: #<bytecompiled-function 00000000027f66e0>
Locals:
SYSTEMS = (:COM.INFORMATIMAGO.COMMON-LISP)
SYSTEM#1 = :COM.INFORMATIMAGO.COMMON-LISP
13: #<bytecompiled-function ASDF-LOAD>
Locals:
SYSTEMS = (:COM.INFORMATIMAGO.COMMON-LISP)
14: #<bytecompiled-function BYTECODES>
[No Locals]
15: #<bytecompiled-function BYTECODES>
[No Locals]
16: EVAL-REGION
17: G769
18: TRACK-PACKAGE
19: G768
20: CALL-WITH-RETRY-RESTART
21: G767
22: CALL-WITH-BUFFER-SYNTAX
23: REPL-EVAL
24: LISTENER-EVAL
25: #<bytecompiled-function BYTECODES>
26: EVAL-FOR-EMACS
27: PROCESS-REQUESTS
28: G291
29: HANDLE-REQUESTS
30: G486
31: CALL-WITH-BINDINGS
32: REPL-INPUT-STREAM-READ
33: G478
34: G82
35: CALL-WITH-LOCK-HELD
36: STREAM-READ-CHAR
37: SIMPLE-REPL
38: G440
39: G433
40: CALL-WITH-USER-BREAK-HANDLER
41: G430
42: CALL-WITH-DEBUGGER-HOOK
43: G466
--more--
(defun parse-component-form (parent options)
(destructuring-bind
(type name &rest rest &key
;; the following list of keywords is reproduced below in the
;; remove-keys form. important to keep them in sync
components pathname default-component-class
perform explain output-files operation-done-p
weakly-depends-on
depends-on serial in-order-to
;; list ends
&allow-other-keys) options
(declare (ignorable perform explain output-files operation-done-p))
(check-component-input type name weakly-depends-on depends-on components in-order-to)
(when (and parent
(find-component parent name)
;; ignore the same object when rereading the defsystem
(not
(typep (find-component parent name)
(class-for-type parent type))))
(error 'duplicate-names :name name))
(let* ((other-args (remove-keys
'(components pathname default-component-class
perform explain output-files operation-done-p
weakly-depends-on
depends-on serial in-order-to)
rest))
(ret
(or (find-component parent name)
(make-instance (class-for-type parent type)))))
(when weakly-depends-on
(appendf depends-on (remove-if (complement #'find-system) weakly-depends-on)))
(when *serial-depends-on*
(push *serial-depends-on* depends-on))
(apply #'reinitialize-instance ret
:name (coerce-name name)
:pathname pathname
:parent parent
other-args)
(component-pathname ret) ; eagerly compute the absolute pathname
(when (typep ret 'module)
(setf (module-default-component-class ret)
(or default-component-class
(and (typep parent 'module)
(module-default-component-class parent))))
(let ((*serial-depends-on* nil))
(setf (module-components ret)
(loop
:for c-form :in components
:for c = (parse-component-form ret c-form)
:for name = (component-name c)
:collect c
:when serial :do (setf *serial-depends-on* name))))
(compute-module-components-by-name ret))
(setf (component-load-dependencies ret) depends-on) ;; Used by POIU
(setf (component-in-order-to ret)
(union-of-dependencies
in-order-to
`((compile-op (compile-op , at depends-on))
(load-op (load-op , at depends-on)))))
(setf (component-do-first ret) `((compile-op (load-op , at depends-on))))
(%refresh-component-inline-methods ret rest)
ret)))
Here is a minimal file showing the problem:
----(test.lisp)-------------------------------------------------------------
(declaim (OPTIMIZE (SAFETY 3) (SPACE 0) (SPEED 0) (DEBUG 3)))
(require :asdf)
(push #P"/home/pjb/lisp/packages/net/common-lisp/asdf-install/asdf-install/" asdf:*central-registry*)
(asdf:operate 'asdf:load-op :asdf-install)
;; Extracted from com.informatimago.common-lisp.package:
(DEFUN PACKAGE-PATHNAME (PACKAGE)
"
RETURN: The logical pathname to the given package.
NOTE: If a nickname is given, then a nickname pathname is returned.
"
(COND
((SIMPLE-STRING-P PACKAGE)
(#+allegro (lambda (designator)
;; Allegro logical pathnames must be written in lowcase
;; to produce lowcase physical pathnames.
;; TODO: Copy the files to an implementation specific LFS.
(if (stringp designator)
(let ((colon (position #\: designator)))
(format nil "~:@(~A~)~(~A~)"
(subseq designator 0 colon)
(subseq designator colon)))
designator))
#-allegro identity
(CONCATENATE 'STRING
"PACKAGES:"
(SUBSTITUTE (CHARACTER ";") (CHARACTER ".") PACKAGE)
".LISP")))
((STRINGP PACKAGE) (PACKAGE-PATHNAME (COPY-SEQ PACKAGE)))
((SYMBOLP PACKAGE) (PACKAGE-PATHNAME (STRING PACKAGE)))
((PACKAGEP PACKAGE) (PACKAGE-PATHNAME (PACKAGE-NAME PACKAGE)))
(T (ERROR "~S is not a package designator." package))))
(defun package-system-definition (system)
"
This is a system definition search function for ASDF.
It will map a system such as :com.informatimago.common-lisp
to the package path: PACKAGE:COM;INFORMATIMAGO;COMMON-LISP;SYSTEM.ASD
"
(let ((name (typecase system
(symbol (string-downcase (symbol-name system)))
(string system)
(t nil))))
(when (and name (position (character ".") name))
;; otherwise process with the normal functions
(let ((file (make-pathname
:type "asd"
;; :case :common ;; strange stuff in allegro...
:defaults (PACKAGE-PATHNAME
(concatenate 'string name ".system")))))
(values (when (probe-file file) file) file)))))
(push (function PACKAGE-SYSTEM-DEFINITION)
ASDF:*SYSTEM-DEFINITION-SEARCH-FUNCTIONS*)
(setf (logical-pathname-translations "PACKAGES") nil)
(setf (logical-pathname-translations "PACKAGES")
'((#P"PACKAGES:**;*.*" #P"/tmp/packages/**/*.*")
(#P"PACKAGES:**;*" #P"/tmp/packages/**/*.lisp")))
;; create minimal files for com/informatimago/common-lisp/:
(let ((asdpath "/tmp/packages/com/informatimago/common-lisp/system.asd")
(srcpath "/tmp/packages/com/informatimago/common-lisp/package.lisp"))
(ensure-directories-exist asdpath)
(with-open-file (asd asdpath :direction :output :if-does-not-exist :create :if-exists :supersede)
(print '(asdf:defsystem :com.informatimago.common-lisp :description
"This ASDF system gathers all the COM.INFORMATIMAGO.COMMON-LISP packages."
:version "1.1.367"
:author "<PJB> Pascal J. Bourguignon <pjb at informatimago.com>"
:licence "GPL"
:depends-on nil
:components ((:cl-source-file "package")))
asd))
(with-open-file (src srcpath :direction :output :if-does-not-exist :create :if-exists :supersede)
(print '(defpackage :com.informatimago.common-lisp.package
(:use :cl))
src))
(values))
(defun asdf-load (&rest systems)
(mapcar (lambda (system) (asdf:operate 'asdf:load-op system)) systems))
(asdf-load :COM.INFORMATIMAGO.COMMON-LISP)
------------------------------------------------------------------------
--
__Pascal Bourguignon__ http://www.informatimago.com/
More information about the ecl-devel
mailing list