On Fri, Feb 21, 2025 at 9:05 AM Konrad Hinsen
<konrad.hin...@fastmail.net> wrote:
>
> Hi everyone,
>
> Overall I have been happily using SBCL from Guix for Common Lisp
> development. But from time to time I run into a weird problem, and today
> it has hit a package I definitely need.
>
> The problem is documented in https://issues.guix.gnu.org/68764 for
> sbcl-clx-truetype, but it can happen for other packages, in a seemingly
> random fashion. The symptoms: when I load a package (via
> asdf:load-system), ASDF tries to recompile a file of the package and
> write the FASL file to the store, which fails with "permission denied".
>
> After today's "guix pull", it's sbcl-lisp-stat that I cannot load any
> more for this reason, and that means I am stuck.
>
> I learned from the issue discussion that removing ~/common-lisp/ makes
> the error go away. I can confirm this. But... ~/common-lisp/ is where I
> keep the packages I actively work on. How am I supposed to develop
> Common Lisp code without having some writable directory on ASDF's search
> path for systems?

Hi Konrad,

I also develop for SBCL on Guix however I haven't fully adopted guix
for managing my dependencies as I develop; I still use quicklisp. With
that caveat,  I /am/ interested in trying the Guix workflow and
needing to delete ~/common-lisp does sound extreme. Here are some
speculative thoughts on things to try in order of increasing effort
(as I imagine it).

1. Is the package you are developing for using the internals of the
package that is managed by guix that is making ASDF think it needs to
recompile it too? That part is the first surprise to me. If it's true,
I wonder if adding that project to your ~/common-lisp would help. I
believe ASDF would prefer it first and would cache the FASL files in
$XDG_CACHE_HOME

2. If ASDF isn't preferring your ~/common-lisp files over the store's,
it might be worthwhile to investigate ASDF's configuration options at
https://asdf.common-lisp.dev/asdf/Configuring-ASDF.html . I notice
that if I use guix shell for some dependencies, I can see them
configured in $GUIX_ENVIRONMENT/etc/common-lisp/source-registry.conf.d/
and it appears ASDF allows creating a user-level environment variable
/ directory for this too
$XDG_CONFIG_HOME/common-lisp/source-registry.conf.d/ ...

3. Fully adopting guix as a build tool by having a local package
definition / manifest for your project which you can use something
like `guix shell my-lisp-project` and it would compile and put into
the guix store as needed. Writing about it feels like it would hurt
the interactivity of redefining functions and re-evaluating whole
files like I do in SBCL -- but maybe there's something I'm missing
that would make it easier than I fear.

Again, I haven't tried any of these yet to conclusively speak to their
efficacy, these are the first things I'd probably try given my
experience with ASDF and Guix so far.


Charlie

Reply via email to