[clfswm-devel] clfswm in different environments

Philippe Brochard pbrochard at common-lisp.net
Sat Mar 5 23:32:36 UTC 2011


Desmond O. Chang writes:

> On Sat, Feb 26, 2011 at 00:02, Philippe Brochard
> <pbrochard at common-lisp.net> wrote:
>> Desmond O. Chang writes:
>>
>>> On Tue, Feb 22, 2011 at 20:11, Philippe Brochard
>>> <pbrochard at common-lisp.net> wrote:
>>>> Maybe you have to clear all .fas and .lib files built with the old
>>>> clisp. You may have to do the same with the directory ~/.cache/common-lisp/...
>>>> before building clx and clfswm.
>>>> In all cases, when something goes wrong with CLX, start with a fresh
>>>> source directory and clear your cache.
>>>
>>> I think I know why.  The fas files compiled with new clx cannot be
>>> used with portable clx and vice versa.  Is it a bug?
>>>
>> Yes that's right. And it's even worse with a mix between ecl and clisp
>> because they share the same .fas extension but the file format is
>> completely different.
>> And I don't think it's a bug. More a lose of feature. It's just that
>> asdf can't know when you've changed your implementation. We can't even
>> know which clx we are using while clisp is running. So clear your cache
>> each time you change your clx.
>
> That means if new-clx not loaded before loading clfswm, the portable
> one will be loaded.  Then if the fas files was compiled with new-clx,
> clfswm fails to start.  I have to choose the version of clx before I
> load clfswm.
>
Yes that's right. And you have to be sure to recompile *all* files when
you switch your CLX. A mix of different CLX version in a compiled code
can makes some very ugly bugs (if the compilation doesn't failed).

> I can put (REQUIRE "clx") in .clisprc.lisp but this causes clisp loads
> clx every time even I don't need it.  A bad solution.
>
Yes bad solution as CLX is not always needed.

> Finally I decide to configure ASDF.  I put the function
> SYSDEF-FIND-CLX in my config.lisp (I symlink .sbclrc, .clisprc.lisp,
> etc. to ~/.config/common-lisp/config.lisp).  This function also works
> in cmucl.
>
> #+(or clisp cmu)
> (progn
>   (defun sysdef-find-clx (name)
>     (let* ((x #+clisp (asdf::find-symbol*
> '#:*module-provider-functions* :custom)
>               #+cmu 'ext:*module-provider-functions*)
>            (syms (and x (list x)))
>            (vals (and x (list (remove 'asdf::module-provide-asdf
> (symbol-value x))))))
>       (progv syms vals
>         (require #+clisp "clx" #+cmu :clx)))
>     (asdf::find-system-fallback name "clx"))
>   (pushnew 'sysdef-find-clx asdf:*system-definition-search-functions*))
>
> Maybe ASDF could provide a better mechanism for it.  I'll ask the
> author on ASDF's maillist.
>
Feel free to share your results here. I can adapt the load.lisp code in
the CLFSWM tree.

> ------
>
> Another question here.  Could you tell me why does the source code
> work with either new or portable clx, but the compiled files not?  Is
> it repairable?
>
Hum, what do you mean by source code and compiled files?
If you compile CLFSWM, the code of the CLX used is compiled inside the
.fas file. If you switch your CLX and don't recompile all your files
some files have the old CLX compiled in when others have the new one.
This fails most of the time but when the compilation is ok the result is
unpredictable.




More information about the clfswm-devel mailing list