Hi! I make a "portable file release" of my software. I want that user could just unpack archive to some "my" directory and than have the software completely independent from any other possible CL installations on this computer. I found (too) many words about output translations in asdf manual, but I was unable to find out how I will do what I need.
My solution and relevant portions in my .sbclrc (for SBCL) follow:
(require :uiop) (setf uiop::*user-cache* #P"c:/clcon/fasl-cache/asdf/") (require 'asdf) ;;; The following lines added by ql:add-to-init-file: #-quicklisp (let ((quicklisp-init "c:/clcon/quicklisp/setup.lisp" )) (when (probe-file quicklisp-init) (load quicklisp-init))) ; swank is handled separatedly (maybe irrelevant to asdf, but relevant ; to task of creating "portable file releases" (load (merge-pathnames "swank-loader.lisp" (ql:where-is-system :swank))) (setq swank-loader::*fasl-directory* "c:/clcon/fasl-cache/swank/") (swank-loader:init)
Problem with current docs is that *user-cache* is mentioned in docs, but it is not stated _when_ the default is calculated. This variable have no default value, but it has a function which calculates it. It is not evident when this function is called. So I needed an experiment. I even don't know when value I supplied will be reset back to hard-coded value.
If you find it useful, you can consider including it into asdf doc/wiki/FAQ, or address me to the appropriate place.
Thank you!
On Thu, Oct 15, 2015 at 7:12 AM, 73budden . budden73@gmail.com wrote:
Problem with current docs is that *user-cache* is mentioned in docs, but it is not stated _when_ the default is calculated. This variable have no default value, but it has a function which calculates it. It is not evident when this function is called. So I needed an experiment. I even don't know when value I supplied will be reset back to hard-coded value.
It's called when you initialize-output-translations, which happens (via ensure-output-translations) the first time that an output translation is computed by apply-output-translations.
To reset, call initialize-output-translations again.
I recommend you *do not* hack *user-cache*, but instead give a parameter to initialize-output-translations.
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org I'm trying to free your mind, Neo. But I can only show you the door. You're the one that has to walk through it. — Morpheus, in "The Matrix"
It's called when you initialize-output-translations, which happens (via ensure-output-translations) the first time that an output translation is computed by apply-output-translations.
Strange, I didn't find direct calls to compute-user-cache in the code. Maybe it is called via hooks...
I recommend you *do not* hack *user-cache*, but instead give a parameter to initialize-output-translations.
Thanks! Unfortunatly, I'm not sure I have a time for more studying and experiments. There is also a design work: how not to break other things, how to ensure default cache is disabled (documentation does not show this option), how to deal with environment variables on Windows, what would happen if some library would call configuration API after me, etc. Configuration algorithm is rather complicated and it definetely requires essential time investment to learn and experiment. So I'll keep with my solution until something would break :) Sorry for that...