guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Improve ASDF build system for Common Lisp libraries


From: Guillaume Le Vaillant
Subject: Re: Improve ASDF build system for Common Lisp libraries
Date: Sun, 13 Sep 2020 14:49:50 +0200
User-agent: mu4e 1.4.13; emacs 27.1

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

> Guillaume Le Vaillant <glv@posteo.net> writes:
>
>> I thought about having the sources, SBCL compiled files and ECL compiled
>> files respectively in the 'out', 'sbcl' and 'ecl' packages outputs;
>> however I thought there could be issues in some cases.
>>
>> For example, if a profile contained cl-xyz and cl-xyz:sbcl, and if the
>> user tried to load this xyz system in ECL, then I think ECL would try
>> to compile the system and write the compiled files to cl-xyz:sbcl and
>> fail because it is read-only. That's because cl-xyz:sbcl contains the
>> ASDF configuration indicating "the compiled files for cl-xyz are in
>> cl-xyz:sbcl", and ECL is going to read that configuration.
>>
>> It might be possible to have smarter ASDF configuration files behaving
>> differently depending on the lisp implementation running, but I have not
>> investigated this for the moment.
>
> There is probably a way to tell where to load the libraries from, and
> where to compile them.
>
> By default, each compiler compiles to
> ~/.cache/common-lisp/$compiler_name-$compiler_version.
>
> This is what ECL should do here.  The ASDF configuration should be so
> that it does not change this  behaviour.

The ':implementation-type' or ':function' keywords of ASDF
configuration files described in [1] and [2] could be useful to do that.

Now, let's suppose that we put the sources in cl-xyz, the SBCL
pre-compiled files in cl-xyz:sbcl and the ECL pre-compiled files in
cl-xyz:ecl.
If a user installs only cl-xyz (the sources) and loads the system using
SBCL or ECL, I think he would expect the lisp implementation to compile
the thing and store the compiled files in the default
'$HOME/.cache/common-lisp/...' location, because he didn't install the
pre-compiled files.
So we would need the ASDF output-translation configuration to be able to
say something like: "if the pre-compiled files for the running lisp
implementation exist in '/gnu/store/...' and if the Guix package for
these pre-compiled files is installed in the current profile or
environment, then use them, else use the default
$HOME/.cache/common-lisp/...' directory".

I guess cl-xyz:sbcl and cl-xyz:ecl would also need to have links to the
ASDF configuration and to the sources in cl-xyz, in case the user
installs only cl-xyz:sbcl or only cl-xyz:ecl.

[1] https://common-lisp.net/project/asdf/asdf/Configuration-DSL.html
[2] https://common-lisp.net/project/asdf/asdf/Output-Configuration-DSL.html

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]