[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

WARNING: redefining UIOP/PACKAGE:FIND-PACKAGE* in DEFUN

Jim Newton

4/20/2016 12:23:00 PM

I'm loading an asdf system which depends on another system and that one
depends on yet another. They all seem to indeed load, but I get a several
pages of warnings like the following.

WARNING: redefining UIOP/PACKAGE:FIND-PACKAGE* in DEFUN
WARNING: redefining UIOP/PACKAGE:FIND-SYMBOL* in DEFUN
WARNING: redefining UIOP/PACKAGE:SYMBOL-CALL in DEFUN
WARNING: redefining UIOP/PACKAGE:INTERN* in DEFUN
WARNING: redefining UIOP/PACKAGE:EXPORT* in DEFUN
WARNING: redefining UIOP/PACKAGE:IMPORT* in DEFUN
WARNING: redefining UIOP/PACKAGE:SHADOWING-IMPORT* in DEFUN
WARNING: redefining UIOP/PACKAGE:SHADOW* in DEFUN
WARNING: redefining UIOP/PACKAGE:MAKE-SYMBOL* in DEFUN
WARNING: redefining UIOP/PACKAGE:UNINTERN* in DEFUN

It looks like something :depends-on :cffi, which in-turn depends on :uiop

Could it be that slime has already load uiop, but not using asdf?

Can I ask asdf, which systems it has already loaded to help me debug this problem?
5 Answers

rpw3

4/20/2016 2:10:00 PM

0

Jim Newton <jimka.issy@gmail.com> wrote:
+---------------
| Can I ask asdf, which systems it has already loaded
| to help me debug this problem?
+---------------

I don't know about current versions, but in ASDF 1.75
there is a variable ASDF::*DEFINED-SYSTEMS* that contains
a hash table of registered systems -- keys are a string
[the system name] and values are (CONS time system)
[the universal time the system was registered and an
instance of the ASDF:SYSTEM class].

You'll need to write a small utility function to get
at the keys, maybe something like this:

(defun asdf-defined-systems ()
(loop for key being each hash-key in asdf::*defined-systems*
collect key))


-Rob

-----
Rob Warnock <rpw3@rpw3.org>
627 26th Avenue <http://rpw...
San Mateo, CA 94403

Jim Newton

4/20/2016 2:41:00 PM

0

Great, that helps a lot.

So after I start lisp, (after slime, quicklisp, and asdf have been loaded),
I see that uiop has already been loaded by asdf.

("uiop" (3643351224 . #<ASDF/PACKAGE-INFERRED-SYSTEM:PACKAGE-SYSTEM "uiop">)
#P"/Users/jnewton/sw/asdf/uiop/uiop.asd")

But then if I call (asdf:load-system :uiop), it seems to load again, but apparently from the same place.
But an addition call to (asdf:load-system :uiop) seems to load nothing extra.

Can anyone suggest what might be causing this?


CL-USER> (loop for key being each hash-key in asdf::*defined-systems*
collect (list key
(gethash key asdf::*defined-systems*)
(asdf:system-source-file (cdr (gethash key asdf::*defined-systems*)))))
(("asdf/prelude" (3655465341 . #<ASDF/SYSTEM:SYSTEM "asdf/prelude">)
#P"/Users/jnewton/sw/asdf/asdf.asd")
("asdf/driver" (3655465341 . #<ASDF/SYSTEM:SYSTEM "asdf/driver">)
#P"/Users/jnewton/sw/asdf/asdf.asd")
("asdf/defsystem" (3655465341 . #<ASDF/SYSTEM:SYSTEM "asdf/defsystem">)
#P"/Users/jnewton/sw/asdf/asdf.asd")
("asdf"
(3655465341 . #<ASDF/PACKAGE-INFERRED-SYSTEM:PACKAGE-INFERRED-SYSTEM "asdf">)
#P"/Users/jnewton/sw/asdf/asdf.asd")
("uiop" (3643351224 . #<ASDF/PACKAGE-INFERRED-SYSTEM:PACKAGE-SYSTEM "uiop">)
#P"/Users/jnewton/sw/asdf/uiop/uiop.asd")
("quicklisp" (3643100518 . #<ASDF/SYSTEM:SYSTEM "quicklisp">)
#P"/Users/jnewton/sw/quicklisp/quicklisp/quicklisp.asd")
("sb-posix" (3659770252 . #<ASDF/OPERATE:REQUIRE-SYSTEM "sb-posix">)
#P"/usr/local/lib/sbcl/contrib/sb-posix.asd")
("sb-bsd-sockets"
(3659770252 . #<ASDF/OPERATE:REQUIRE-SYSTEM "sb-bsd-sockets">)
#P"/usr/local/lib/sbcl/contrib/sb-bsd-sockets.asd")
("sb-introspect" (3659770252 . #<ASDF/OPERATE:REQUIRE-SYSTEM "sb-introspect">)
#P"/usr/local/lib/sbcl/contrib/sb-introspect.asd")
("sb-cltl2" (3659770252 . #<ASDF/OPERATE:REQUIRE-SYSTEM "sb-cltl2">)
#P"/usr/local/lib/sbcl/contrib/sb-cltl2.asd")
("sb-sprof" (3659770252 . #<ASDF/OPERATE:REQUIRE-SYSTEM "sb-sprof">)
#P"/usr/local/lib/sbcl/contrib/sb-sprof.asd"))
CL-USER> (asdf:load-system :uiop)
WARNING: redefining UIOP/PACKAGE:FIND-PACKAGE* in DEFUN
WARNING: redefining UIOP/PACKAGE:FIND-SYMBOL* in DEFUN
WARNING: redefining UIOP/PACKAGE:SYMBOL-CALL in DEFUN
WARNING: redefining UIOP/PACKAGE:INTERN* in DEFUN
WARNING: redefining UIOP/PACKAGE:EXPORT* in DEFUN

.... 100s of lines deleted .......

WARNING: redefining UIOP/CONFIGURATION:IN-FIRST-DIRECTORY in DEFUN
WARNING: redefining UIOP/CONFIGURATION:IN-USER-CONFIGURATION-DIRECTORY in DEFUN
WARNING:
redefining UIOP/CONFIGURATION:IN-SYSTEM-CONFIGURATION-DIRECTORY in DEFUN
T
CL-USER> (loop for key being each hash-key in asdf::*defined-systems*
collect (list key
(gethash key asdf::*defined-systems*)
(asdf:system-source-file (cdr (gethash key asdf::*defined-systems*)))))))
(("asdf/prelude" (3655465341 . #<ASDF/SYSTEM:SYSTEM "asdf/prelude">)
#P"/Users/jnewton/sw/asdf/asdf.asd")
("asdf/driver" (3655465341 . #<ASDF/SYSTEM:SYSTEM "asdf/driver">)
#P"/Users/jnewton/sw/asdf/asdf.asd")
("asdf/defsystem" (3655465341 . #<ASDF/SYSTEM:SYSTEM "asdf/defsystem">)
#P"/Users/jnewton/sw/asdf/asdf.asd")
("asdf"
(3655465341 . #<ASDF/PACKAGE-INFERRED-SYSTEM:PACKAGE-INFERRED-SYSTEM "asdf">)
#P"/Users/jnewton/sw/asdf/asdf.asd")
("uiop" (3643351224 . #<ASDF/PACKAGE-INFERRED-SYSTEM:PACKAGE-SYSTEM "uiop">)
#P"/Users/jnewton/sw/asdf/uiop/uiop.asd")
("quicklisp" (3643100518 . #<ASDF/SYSTEM:SYSTEM "quicklisp">)
#P"/Users/jnewton/sw/quicklisp/quicklisp/quicklisp.asd")
("sb-posix" (3659770252 . #<ASDF/OPERATE:REQUIRE-SYSTEM "sb-posix">)
#P"/usr/local/lib/sbcl/contrib/sb-posix.asd")
("sb-bsd-sockets"
(3659770252 . #<ASDF/OPERATE:REQUIRE-SYSTEM "sb-bsd-sockets">)
#P"/usr/local/lib/sbcl/contrib/sb-bsd-sockets.asd")
("sb-introspect" (3659770252 . #<ASDF/OPERATE:REQUIRE-SYSTEM "sb-introspect">)
#P"/usr/local/lib/sbcl/contrib/sb-introspect.asd")
("sb-cltl2" (3659770252 . #<ASDF/OPERATE:REQUIRE-SYSTEM "sb-cltl2">)
#P"/usr/local/lib/sbcl/contrib/sb-cltl2.asd")
("sb-sprof" (3659770252 . #<ASDF/OPERATE:REQUIRE-SYSTEM "sb-sprof">)
#P"/usr/local/lib/sbcl/contrib/sb-sprof.asd"))
CL-USER> (asdf:load-system :uiop)
T
CL-USER>

Jim Newton

4/22/2016 9:14:00 AM

0

A little more information.

I see that the function UIOP/CONFIGURATION:IN-SYSTEM-CONFIGURATION-DIRECTORY
is defined, and the asdf system "uiop" is known, but not yet loaded. So it looks like
something in my startup is loading uiop, but not loading it via asdf.


CL-USER> (loop for system-name being each hash-key in asdf::*defined-systems*
collect (list system-name
(if (asdf::component-loaded-p system-name) :loaded :not-yet-loaded)
(asdf:system-source-file (cdr (gethash system-name asdf::*defined-systems*)))))
(("asdf/prelude" :NOT-YET-LOADED #P"/Users/jnewton/sw/asdf/asdf.asd")
("asdf/driver" :NOT-YET-LOADED #P"/Users/jnewton/sw/asdf/asdf.asd")
("asdf/defsystem" :NOT-YET-LOADED #P"/Users/jnewton/sw/asdf/asdf.asd")
("asdf" :LOADED #P"/Users/jnewton/sw/asdf/asdf.asd")
("uiop" :NOT-YET-LOADED #P"/Users/jnewton/sw/asdf/uiop/uiop.asd")
("quicklisp" :LOADED #P"/Users/jnewton/sw/quicklisp/quicklisp/quicklisp.asd")
("sb-posix" :LOADED #P"/usr/local/lib/sbcl/contrib/sb-posix.asd")
("sb-bsd-sockets" :LOADED #P"/usr/local/lib/sbcl/contrib/sb-bsd-sockets.asd")
("sb-introspect" :LOADED #P"/usr/local/lib/sbcl/contrib/sb-introspect.asd")
("sb-cltl2" :LOADED #P"/usr/local/lib/sbcl/contrib/sb-cltl2.asd")
("sb-sprof" :LOADED #P"/usr/local/lib/sbcl/contrib/sb-sprof.asd"))
CL-USER> (fboundp 'UIOP/CONFIGURATION:IN-SYSTEM-CONFIGURATION-DIRECTORY)
T
CL-USER> (asdf::already-loaded-systems)
("asdf" "quicklisp" "sb-posix" "sb-bsd-sockets" "sb-introspect" "sb-cltl2"
"sb-sprof")
CL-USER>

Jim Newton

4/22/2016 9:19:00 AM

0

Yet another clue. When I use slime meta-. to find the source of UIOP/CONFIGURATION:IN-SYSTEM-CONFIGURATION-DIRECTORY
I see that it is defined by asdf/build, rather than by uiop.
In fact, it and several other uiop functions are all marked as deprecated.
And then there is code in the the same file which re-exports the uiop interface.


;; Backward compatibility for ASDF 2.27 to 3.1.4
(defun user-configuration-directories ()
"Return the current user's list of user configuration directories
for configuring common-lisp.
DEPRECATED. Use uiop:xdg-config-pathnames instead."
(xdg-config-pathnames "common-lisp"))
(defun system-configuration-directories ()
"Return the list of system configuration directories for common-lisp.
DEPRECATED. Use uiop:config-system-pathnames instead."
(system-config-pathnames "common-lisp"))
(defun in-first-directory (dirs x &key (direction :input))
"Finds the first appropriate file named X in the list of DIRS for I/O
in DIRECTION \(which may be :INPUT, :OUTPUT, :IO, or :PROBE).
If direction is :INPUT or :PROBE, will return the first extant file named
X in one of the DIRS.
If direction is :OUTPUT or :IO, will simply return the file named X in the
first element of DIRS that exists. DEPRECATED."
(find-preferred-file
(mapcar #'(lambda (dir) (subpathname (ensure-directory-pathname dir) x)) dirs)
:direction direction))
(defun in-user-configuration-directory (x &key (direction :input))
"Return the file named X in the user configuration directory for common-lisp.
DEPRECATED."
(xdg-config-pathname `("common-lisp" ,x) direction))
(defun in-system-configuration-directory (x &key (direction :input))
"Return the pathname for the file named X under the system configuration directory
for common-lisp. DEPRECATED."
(find-preferred-file (system-config-pathnames "common-lisp" x) :direction direction)))
;;;; ---------------------------------------------------------------------------
;;;; Re-export all the functionality in UIOP

Jim Newton

4/22/2016 9:48:00 AM

0

I found this line in cffi.asd:
:depends-on ( :uiop :alexandria :trivial-features :babel)

I changed it to the following, and the 100s of redefinition messages vanish, and my program seems to work fine.

:depends-on ( ;; :uiop
:alexandria :trivial-features :babel)

Perhaps, the cffi.asd file needs to have some implementation dependent depends-on items?