Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Common Lisp compilation files (fasl) are not being used #142604

Closed
nagy opened this issue Oct 22, 2021 · 2 comments · Fixed by #170149
Closed

Common Lisp compilation files (fasl) are not being used #142604

nagy opened this issue Oct 22, 2021 · 2 comments · Fixed by #170149
Labels
0.kind: bug Something is broken 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@nagy
Copy link
Member

nagy commented Oct 22, 2021

Describe the bug

It seems that our shipped lisps are not using the package provided fasl files. I think the reason for this is a missing asdf-output translation.

Steps To Reproduce

$ HOME=$(mktemp -d); cd

$ nix-shell -p lispPackages.cl-pdf --run "common-lisp.sh --eval '(require :cl-pdf)' --quit"
This is SBCL 2.1.2.nixos, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://www.sbcl.org/>.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.

# lots of compilation output

$ ls -lah .cache/common-lisp/sbcl-2.1.2.nixos-linux-x64/nix/store/
total 0
drwxr-xr-x 6 user group 120 Oct 22 21:52 .
drwxr-xr-x 3 user group  60 Oct 22 21:52 ..
drwxr-xr-x 3 user group  60 Oct 22 21:52 hikw808j7b082z87d3rjmpz005m0bq5b-cl-wrapper-script
drwxr-xr-x 3 user group  60 Oct 22 21:52 hm0r08y0z9rz2yppi177j6qzdl3fl6sp-lisp-zpb-ttf-release-1.0.4
drwxr-xr-x 3 user group  60 Oct 22 21:52 llk9g31j4jzpmcy85vq747zwl61gwns0-lisp-iterate-20210228-git
drwxr-xr-x 3 user group  60 Oct 22 21:52 zkavzn6fh6v1bi2kmlw4382pwyfaws9z-lisp-cl-pdf-20210228-git

$

The lisp has recompiled the files into its cache in the user-directory, but the package ships with fasl files already:

$ ls /nix/store/zkavzn6fh6v1bi2kmlw4382pwyfaws9z-lisp-cl-pdf-20210228-git/lib/common-lisp/cl-pdf/*.fasl
/nix/store/zkavzn6fh6v1bi2kmlw4382pwyfaws9z-lisp-cl-pdf-20210228-git/lib/common-lisp/cl-pdf/bar-codes.fasl
/nix/store/zkavzn6fh6v1bi2kmlw4382pwyfaws9z-lisp-cl-pdf-20210228-git/lib/common-lisp/cl-pdf/chart.fasl
/nix/store/zkavzn6fh6v1bi2kmlw4382pwyfaws9z-lisp-cl-pdf-20210228-git/lib/common-lisp/cl-pdf/cl-pdf--system.fasl
# ...
$

I was able to get it somewhat to work by putting this content into ~/.sbclrc or ~/.eclrc:

(require :asdf)
(asdf:initialize-output-translations '(:output-translations ("/nix/store" t) :inherit-configuration))

The problem with this is that now all derivations inside the nix-store need to ship with fasl files, otherwise we get something like a "read-only" error because the compiler tries to write its fasl file to the nix-store, which it cant. Ideally the directory ~/.cache/common-lisp/*/nix/store should be empty or not exist at all.

I suggest that we properly setup the ASDF-output-translation to fix this, but I dont know how yet.

Expected behavior

The lisp should use the fasl files provided by the derivation.

Notify maintainers

CC @7c6f434c Do you know who else we can ping into the conversation?

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.14.12, NixOS, 21.11 (Porcupine)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.16`
 - channels(user): `"emacs-overlay, home-manager, nur, nixos-21.05-21.05.1226.f77036342e2"`
 - channels(root): `"nixos-21.11pre323790.5f0194220f2"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: lispPackages
# a list of nixos modules affected by the problem
module:
@nagy nagy added the 0.kind: bug Something is broken label Oct 22, 2021
@7c6f434c
Copy link
Member

We do set this up if you load the package lisp launcher or source the settings file (as /nix/store/:/nix/store/), and indeed this requires some care, and naively doing by putting paths into $ASDF_OUTPUT_TRANSLATIONS one by one exceeded some limits…

@stale
Copy link

stale bot commented Apr 25, 2022

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 25, 2022
@Uthar Uthar mentioned this issue Apr 27, 2022
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants