Bind package to cl user

Bind the value of *package* to common-lisp-user package when compiling or loading lisp code. This binding can be overridden, but avoids anomalies that happen when ASDF is executed in an odd *package* context. See #124

Edited by Robert Goldman

Merge request reports

Loading
+2 −4
Changes for test/poor-package-control.script: 2 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -17,12 +17,10 @@
(setf asdf:*compile-file-warnings-behaviour* :error
      asdf:*compile-file-failure-behaviour* :error)

(with-expected-failure ("Value of *PACKAGE* not controlled")
(let ((*package* (find-package :foobar))
      (asdf:*compile-file-warnings-behaviour* :error))
      (asdf:compile-system "test-bad-package-discipline" :force t)))
  (asdf:compile-system "test-bad-package-discipline" :force t))

(with-expected-failure ("Value of *PACKAGE* not controlled")
(in-package :foobar)
(cl:let ((asdf:*compile-file-warnings-behaviour* :error))
    (asdf:compile-system "test-bad-package-discipline" :force cl:t)))
  (asdf:compile-system "test-bad-package-discipline" :force cl:t))
+4 −2
Changes for lisp-action.lisp: 4 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@ Note that it will NOT be called around the performing of LOAD-OP."))
            (when warnings-file
              (unless (equal (pathname-type warnings-file) (warnings-file-type))
                (setf warnings-file nil)))
            (let ((*package* (find-package* '#:common-lisp-user)))
             (call-with-around-compile-hook
              c #'(lambda (&rest flags)
                    (apply 'compile-file* input-file
@@ -119,7 +120,7 @@ Note that it will NOT be called around the performing of LOAD-OP."))
                           (append
                            #+clisp (list :lib-file lib-file)
                            #+(or clasp ecl mkcl) (list :object-file object-file)
                           flags)))))
                            flags))))))
        (check-lisp-compile-results output warnings-p failure-p
                                    "~/asdf-action::format-action/" (list (cons o c))))))
  (defun report-file-p (f)
@@ -203,7 +204,8 @@ an OPERATION and a COMPONENT."
    "Perform the loading of a FASL associated to specified action (O . C),
an OPERATION and a COMPONENT."
    (if-let (fasl (first (input-files o c)))
      (load* fasl)))
            (let ((*package* (find-package '#:common-lisp-user)))
              (load* fasl))))
  (defmethod perform ((o load-op) (c cl-source-file))
    (perform-lisp-load-fasl o c))
  (defmethod perform ((o load-op) (c static-file))
Loading