[asdf-devel] compile-with-nicknames

Gábor Balázs gabalz at gmail.com
Tue Oct 18 05:20:38 UTC 2011


This is how I would do the renaming (see attachment).
So I wouldn't use around-compile as I want the renaming to be effective on
cl-source-file.
I also have to admit that there might be a more efficient way which would do
this on the top level if there is any compilation in the plan. But I don't
know how to implement that way.

If you like it, I can finish the implementation...

`bg`


2011/10/17 Gábor Balázs <gabalz at gmail.com>

>
> I don't see how can you manipulate things by defining subclasses of
> cl-source-file.
>
> I have to admit that I don't understand how components are created in asdf.
> My best guess (by looking at the class-for-type function) is that everything
> defined in the defsystem by :file and having .lisp extension becomes
> *default-component-class* which is cl-source-file.
>
> And I neither want to introduce a new syntax next to :file, nor change my
> lisp file extensions to something else.
> So I don't see how your components can become subclasses of cl-source-file
> at all.
>
> `bg`
>
>
>
> 2011/10/17 Faré <fahree at gmail.com>
>
>> NB: I committed this :around-compile feature with some minimal
>> documentation as 2.017.18.
>>
>> —♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics•
>> http://fare.tunes.org
>> Foreign aid might be defined as a transfer from poor people in rich
>> countries
>> to rich people in poor countries. — Douglas Casey
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/asdf-devel/attachments/20111017/26aa7c11/attachment.html>
-------------- next part --------------
diff --git a/asdf.lisp b/asdf.lisp
index c328d72..0e9a2f1 100755
--- a/asdf.lisp
+++ b/asdf.lisp
@@ -1351,6 +1351,7 @@ make sure we clear them thoroughly."
             :accessor system-license :initarg :license)
    (source-file :reader system-source-file :initarg :source-file
                 :writer %set-system-source-file)
+   (compilation-nicknames :reader compilation-nicknames :initarg :compile-with-nicknames)
    (defsystem-depends-on :reader system-defsystem-depends-on :initarg :defsystem-depends-on)))
 
 
@@ -2220,6 +2221,17 @@ recursive calls to traverse.")
           (class-of operation) component))
 
 ;;;; -------------------------------------------------------------------------
+;;;; package nickname handling for compile-op
+
+(defun set-package-nicknames (compilation-nicknames)
+  ;; TODO implement this!
+  'set-nicknames)
+
+(defun unset-package-nicknames (set-nicknames)
+  ;; TODO implement this!
+  t)
+
+;;;; -------------------------------------------------------------------------
 ;;;; compile-op
 
 (defclass compile-op (operation)
@@ -2274,6 +2286,7 @@ recursive calls to traverse.")
 (defmethod perform ((operation compile-op) (c cl-source-file))
   #-:broken-fasl-loader
   (let ((source-file (component-pathname c))
+        (system (component-system c))
         ;; on some implementations, there are more than one output-file,
         ;; but the first one should always be the primary fasl that gets loaded.
         (output-file (first (output-files operation c)))
@@ -2282,8 +2295,12 @@ recursive calls to traverse.")
     (multiple-value-bind (output warnings-p failure-p)
         (call-with-around-compile-hook
          c (lambda ()
-             (apply *compile-op-compile-file-function* source-file
-                    :output-file output-file (compile-op-flags operation))))
+             (let ((set-nicknames (set-package-nicknames
+                                   (compilation-nicknames system))))
+               (unwind-protect
+                    (apply *compile-op-compile-file-function* source-file
+                           :output-file output-file (compile-op-flags operation))
+                 (unset-package-nicknames set-nicknames)))))
       (unless output
         (error 'compile-error :component c :operation operation))
       (when failure-p


More information about the asdf-devel mailing list