Lisp HUG Maillist Archive

Output fasl directory

Hi all,

I’d like my fasl-output directory to be kept separate to project directories, mostly for aesthetic reasons, but it can also be annoying opening files in the LW editor having filename autocomplete stumble between *.lisp and *.*fasl files.

Using an :OBJECT-PATHNAME form in each LW:DEFSYSTEM works well enough for COMPILE-SYSTEM calls.

However compilation in the editor buffer (e.g. compile-defun-command and compile-buffer-command) leaves *.*fasl droppings in the directories.

My first attempt in my .lispworks init file:

(defadvice (compile-file dont-save-fasl :around) (&rest args)
  (if (getf (cdr args) :in-memory)
    (apply #'call-next-advice args)
    (apply #'call-next-advice (car args) :output-file :temp
           (loop for (a b) on (cdr args) by #'cddr nconc (unless (eq a :output-file) (list a b))))))

appears to work well enough for buffer compilation commands, but now fails miserably for COMPILE-SYSTEM ; it can’t find the output *.*fasl files for LOAD-SYTEM (obviously enough, because my DEFADVICE puts the *.*fasl files in a temp folder).

Any suggestions on a better approach? Goal here is simply to keep *.*fasl files away from the source files.

Adam

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Output fasl directory

Okay that was a dumb question.

For posterity (in .lispworks) :

(defvar *in-compile-system* nil)

(defadvice (compile-file dont-save-fasl :around) (&rest args)
  (if (or *in-compile-system* (getf (cdr args) :in-memory))
    (apply #'call-next-advice args)
    (apply #'call-next-advice (car args) :output-file :temp
           (loop for (a b) on (cdr args) by #'cddr nconc (unless (eq a :output-file) (list a b))))))

(defadvice (compile-system treat-fasls-normally :around) (&rest args)
  (let ((*in-compile-system* t))
    (apply #'call-next-advice args)))

Adam


> On 24 Jan 2015, at 10:00 am, Adam Weaver <adam@clockworkblue.com.au> wrote:
> 
> 
> Hi all,
> 
> I’d like my fasl-output directory to be kept separate to project directories, mostly for aesthetic reasons, but it can also be annoying opening files in the LW editor having filename autocomplete stumble between *.lisp and *.*fasl files.
> 
> Using an :OBJECT-PATHNAME form in each LW:DEFSYSTEM works well enough for COMPILE-SYSTEM calls.
> 
> However compilation in the editor buffer (e.g. compile-defun-command and compile-buffer-command) leaves *.*fasl droppings in the directories.
> 
> My first attempt in my .lispworks init file:
> 
> (defadvice (compile-file dont-save-fasl :around) (&rest args)
>  (if (getf (cdr args) :in-memory)
>    (apply #'call-next-advice args)
>    (apply #'call-next-advice (car args) :output-file :temp
>           (loop for (a b) on (cdr args) by #'cddr nconc (unless (eq a :output-file) (list a b))))))
> 
> appears to work well enough for buffer compilation commands, but now fails miserably for COMPILE-SYSTEM ; it can’t find the output *.*fasl files for LOAD-SYTEM (obviously enough, because my DEFADVICE puts the *.*fasl files in a temp folder).
> 
> Any suggestions on a better approach? Goal here is simply to keep *.*fasl files away from the source files.
> 
> Adam
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users
> lisp-hug@lispworks.com
> http://www.lispworks.com/support/lisp-hug.html
> 


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Output fasl directory

Hi!

My variant takes also asdf (3) into account.

https://code.google.com/p/def-symbol-readmacro/source/browse/lispworks-ide-buddens-tools/fasl-files-in-temp-dir.lisp

Budden

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Updated at: 2020-12-10 08:33 UTC