Uthar / nix-cl

Utilities for packaging ASDF systems using Nix
BSD 2-Clause "Simplified" License
15 stars 6 forks source link

Slynk-mrepl and others fail to build #7

Closed nagy closed 2 years ago

nagy commented 2 years ago

I attempt to start a slynk server from nix-configuration only. For this I need the slynk-mrepl packages and others. When attempting to build them, I get the following. Is there any way I can help with this? Thank you.

$ nix-build https://github.com/Uthar/nix-cl/archive/master.tar.gz -A sbclPackages.slynk_slash_mrepl

this derivation will be built:
  /nix/store/ypbnbsw51vp25wz160647wnjkf91sp52-slynk_mrepl-20220707-git.drv
building '/nix/store/ypbnbsw51vp25wz160647wnjkf91sp52-slynk_mrepl-20220707-git.drv'...
unpacking sources
unpacking source archive /nix/store/bn2hyl4659b8rj24i9xp1jscnv7mcn0f-source
source root is source
patching sources
configuring
no configure script, doing nothing
building
SLYNK's ASDF loader finished.
Unhandled SB-INT:SIMPLE-FILE-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING
                                                {1004C181B3}>:
  Error opening #P"/nix/store/wxcdkva1kp8isnadn5rvgp6rvlaayg55-slynk-20220707-git/contrib/slynk-mrepl-tmpGHU3ALSV.fasl":

    Permission denied

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1004C181B3}>
0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<SB-INT:SIMPLE-FILE-ERROR "Error opening ~S" {10033A7E33}> #<unused argument> :QUIT T)
1: (SB-DEBUG::RUN-HOOK *INVOKE-DEBUGGER-HOOK* #<SB-INT:SIMPLE-FILE-ERROR "Error opening ~S" {10033A7E33}>)
2: (INVOKE-DEBUGGER #<SB-INT:SIMPLE-FILE-ERROR "Error opening ~S" {10033A7E33}>)
3: (ERROR SB-INT:SIMPLE-FILE-ERROR :PATHNAME #P"/nix/store/wxcdkva1kp8isnadn5rvgp6rvlaayg55-slynk-20220707-git/contrib/slynk-mrepl-tmpGHU3ALSV.fasl" :MESSAGE "Permission denied" :FORMAT-CONTROL "Error opening ~S" :FORMAT-ARGUMENTS (#P"/nix/store/wxcdkva1kp8isnadn5rvgp6rvlaayg55-slynk-20220707-git/contrib/slynk-mrepl-tmpGHU3ALSV.fasl"))
4: (SB-IMPL::FILE-PERROR #P"/nix/store/wxcdkva1kp8isnadn5rvgp6rvlaayg55-slynk-20220707-git/contrib/slynk-mrepl-tmpGHU3ALSV.fasl" 13 "Error opening ~S" #P"/nix/store/wxcdkva1kp8isnadn5rvgp6rvlaayg55-slynk-20220707-git/contrib/slynk-mrepl-tmpGHU3ALSV.fasl")
5: (SB-IMPL::%OPEN-ERROR #P"/nix/store/wxcdkva1kp8isnadn5rvgp6rvlaayg55-slynk-20220707-git/contrib/slynk-mrepl-tmpGHU3ALSV.fasl" 13 NIL :CREATE)
6: (OPEN #P"/nix/store/wxcdkva1kp8isnadn5rvgp6rvlaayg55-slynk-20220707-git/contrib/slynk-mrepl-tmpGHU3ALSV.fasl" :DIRECTION :IO :ELEMENT-TYPE :DEFAULT :IF-EXISTS NIL :IF-DOES-NOT-EXIST :CREATE :EXTERNAL-FORMAT :UTF-8 :CLASS SB-SYS:FD-STREAM)
7: (UIOP/STREAM:CALL-WITH-TEMPORARY-FILE #<FUNCTION (FLET "BEFORE234" :IN UIOP/STREAM::GET-TEMPORARY-FILE) {5346555B}> :WANT-STREAM-P NIL :WANT-PATHNAME-P T :DIRECTION :IO :KEEP T :AFTER NIL :DIRECTORY #P"/nix/store/wxcdkva1kp8isnadn5rvgp6rvlaayg55-slynk-20220707-git/contrib/" :TYPE "fasl" :PREFIX "slynk-mrepl-tmp" :SUFFIX NIL :ELEMENT-TYPE NIL :EXTERNAL-FORMAT NIL)
8: (UIOP/LISP-BUILD:COMPILE-FILE* #P"/nix/store/wxcdkva1kp8isnadn5rvgp6rvlaayg55-slynk-20220707-git/contrib/slynk-mrepl.lisp" :OUTPUT-FILE #P"/nix/store/wxcdkva1kp8isnadn5rvgp6rvlaayg55-slynk-20220707-git/contrib/slynk-mrepl.fasl" :EXTERNAL-FORMAT :UTF-8 :WARNINGS-FILE NIL)
9: (ASDF/LISP-ACTION:PERFORM-LISP-COMPILATION #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "slynk/mrepl" "../contrib/slynk-mrepl">)
10: ((SB-PCL::EMF ASDF/ACTION:PERFORM) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "slynk/mrepl" "../contrib/slynk-mrepl">)
11: ((LAMBDA NIL :IN ASDF/ACTION:CALL-WHILE-VISITING-ACTION))
12: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS :AROUND (T T)) #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "slynk/mrepl" "../contrib/slynk-mrepl">) [fast-method]
13: ((:METHOD ASDF/PLAN:PERFORM-PLAN (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {1002516553}>) [fast-method]
14: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT))
15: ((:METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {1002516553}>) [fast-method]
16: ((:METHOD ASDF/OPERATE:OPERATE (ASDF/OPERATION:OPERATION ASDF/COMPONENT:COMPONENT)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "slynk/mrepl"> :PLAN-CLASS NIL :PLAN-OPTIONS NIL) [fast-method]
17: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "slynk/mrepl">)
18: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
19: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "slynk/mrepl">) [fast-method]
20: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> ASDF/LISP-ACTION:LOAD-OP SLYNK/MREPL)
21: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
22: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP SLYNK/MREPL) [fast-method]
23: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<FUNCTION (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {10017A464B}> :OVERRIDE T :KEY NIL :OVERRIDE-CACHE T :OVERRIDE-FORCING NIL)
24: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
25: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<FUNCTION (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {10030E0D6B}> :OVERRIDE NIL :KEY NIL :OVERRIDE-CACHE NIL :OVERRIDE-FORCING NIL)
26: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP SLYNK/MREPL) [fast-method]
27: (ASDF/OPERATE:LOAD-SYSTEM SLYNK/MREPL)
28: ((LAMBDA NIL :IN "/nix/store/15ywyl8x06j5xmi9c51pchhhnm160mlv-build-slynk_mrepl.lisp"))
29: (SB-INT:SIMPLE-EVAL-IN-LEXENV (DOLIST (S (QUOTE (SLYNK/MREPL))) (ASDF/OPERATE:LOAD-SYSTEM S)) #<NULL-LEXENV>)
30: (EVAL-TLF (DOLIST (S (QUOTE (SLYNK/MREPL))) (ASDF/OPERATE:LOAD-SYSTEM S)) 1 NIL)
31: ((LABELS SB-FASL::EVAL-FORM :IN SB-INT:LOAD-AS-SOURCE) (DOLIST (S (QUOTE (SLYNK/MREPL))) (ASDF/OPERATE:LOAD-SYSTEM S)) 1)
32: ((LAMBDA (SB-KERNEL:FORM &KEY :CURRENT-INDEX &ALLOW-OTHER-KEYS) :IN SB-INT:LOAD-AS-SOURCE) (DOLIST (S (QUOTE (SLYNK/MREPL))) (ASDF/OPERATE:LOAD-SYSTEM S)) :CURRENT-INDEX 1)
33: (SB-C::%DO-FORMS-FROM-INFO #<FUNCTION (LAMBDA (SB-KERNEL:FORM &KEY :CURRENT-INDEX &ALLOW-OTHER-KEYS) :IN SB-INT:LOAD-AS-SOURCE) {10016567DB}> #<SB-C::SOURCE-INFO {10016567A3}> SB-C::INPUT-ERROR-IN-LOAD)
34: (SB-INT:LOAD-AS-SOURCE #<SB-SYS:FD-STREAM for "file /nix/store/15ywyl8x06j5xmi9c51pchhhnm160mlv-build-slynk_mrepl.lisp" {1001650E73}> :VERBOSE NIL :PRINT NIL :CONTEXT "loading")
35: ((LABELS SB-FASL::LOAD-STREAM-1 :IN LOAD) #<SB-SYS:FD-STREAM for "file /nix/store/15ywyl8x06j5xmi9c51pchhhnm160mlv-build-slynk_mrepl.lisp" {1001650E73}> NIL)
36: (SB-FASL::CALL-WITH-LOAD-BINDINGS #<FUNCTION (LABELS SB-FASL::LOAD-STREAM-1 :IN LOAD) {7FFFF784F80B}> #<SB-SYS:FD-STREAM for "file /nix/store/15ywyl8x06j5xmi9c51pchhhnm160mlv-build-slynk_mrepl.lisp" {1001650E73}> NIL #<SB-SYS:FD-STREAM for "file /nix/store/15ywyl8x06j5xmi9c51pchhhnm160mlv-build-slynk_mrepl.lisp" {1001650E73}>)
37: (LOAD #<SB-SYS:FD-STREAM for "file /nix/store/15ywyl8x06j5xmi9c51pchhhnm160mlv-build-slynk_mrepl.lisp" {1001650E73}> :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST :ERROR :EXTERNAL-FORMAT :DEFAULT)
38: ((FLET SB-IMPL::LOAD-SCRIPT :IN SB-IMPL::PROCESS-SCRIPT) #<SB-SYS:FD-STREAM for "file /nix/store/15ywyl8x06j5xmi9c51pchhhnm160mlv-build-slynk_mrepl.lisp" {1001650E73}>)
39: ((FLET SB-UNIX::BODY :IN SB-IMPL::PROCESS-SCRIPT))
40: ((FLET "WITHOUT-INTERRUPTS-BODY-11" :IN SB-IMPL::PROCESS-SCRIPT))
41: (SB-IMPL::PROCESS-SCRIPT "/nix/store/15ywyl8x06j5xmi9c51pchhhnm160mlv-build-slynk_mrepl.lisp")
42: (SB-IMPL::TOPLEVEL-INIT)
43: ((FLET SB-UNIX::BODY :IN SB-IMPL::START-LISP))
44: ((FLET "WITHOUT-INTERRUPTS-BODY-3" :IN SB-IMPL::START-LISP))
45: (SB-IMPL::%START-LISP)

unhandled condition in --disable-debugger mode, quitting
;
; compilation unit aborted
;   caught 1 fatal ERROR condition
error: builder for '/nix/store/ypbnbsw51vp25wz160647wnjkf91sp52-slynk_mrepl-20220707-git.drv' failed with exit code 1;
       last 10 log lines:
       > 41: (SB-IMPL::PROCESS-SCRIPT "/nix/store/15ywyl8x06j5xmi9c51pchhhnm160mlv-build-slynk_mrepl.lisp")
       > 42: (SB-IMPL::TOPLEVEL-INIT)
       > 43: ((FLET SB-UNIX::BODY :IN SB-IMPL::START-LISP))
       > 44: ((FLET "WITHOUT-INTERRUPTS-BODY-3" :IN SB-IMPL::START-LISP))
       > 45: (SB-IMPL::%START-LISP)
       >
       > unhandled condition in --disable-debugger mode, quitting
       > ;
       > ; compilation unit aborted
       > ;   caught 1 fatal ERROR condition
       For full logs, run 'nix log /nix/store/ypbnbsw51vp25wz160647wnjkf91sp52-slynk_mrepl-20220707-git.drv'.
paulvictor commented 2 years ago

Firstly a big thanks to @Uthar for this wonderful work he has put in to make common lisp nix friendly, it definitely looks better than the current lispPackages implementation in nixpkgs. I am very new to lisp, but have been using nix fairly long, so kindly bear with me if I am missing out somewhere. I'm also facing a similar issue, while building nyxt from lispPackages_new from nixpkgs/master. I have applied the patch https://github.com/NixOS/nixpkgs/pull/191961 which updates the quicklisppackages to 2022/07/08 and on top of that have changes nyxt tohe latest master. The overlay goes like this

final: prev:

let
  src = final.fetchFromGitHub {
    owner = "atlas-engineer";
    repo = "nyxt";
    rev = "aef5118a7c30c48583b464e2e0c27d4b0060999b";
    sha256 = "e83KmC9APjiYeK9ti+eejW4VZImZ36r4mVHf1RVe5aw=";
  };
  inherit (final.lispPackages_new) build-asdf-system sbcl sbclPackages;
  nyxt_tests = build-asdf-system {
    lisp = sbcl;
    pname = "nyxt-tests";
    version = "2022-09-22";

    asds = [ "nyxt" ];
    systems = [ "nyxt/tests" ];

    inherit src;
    lispLibs = with sbclPackages; [ nyxt nyxt-asdf prove ];
  };
in
{
  nyxt-3 = build-asdf-system {
    lisp = sbcl;
    pname = "nyxt";
    version = "2022-09-22";

    inherit (sbclPackages.nyxt) nativeBuildInputs buildInputs buildScript installPhase;

    asds = [ "nyxt" ];
    systems = [ "nyxt" ];

    lispLibs =
      sbclPackages.nyxt.lispLibs ++ [ nyxt_tests ] ++
      (with sbclPackages; [ cl-cffi-gtk cl-webkit2 mk-string-metrics nyxt-asdf ]);

    inherit src;
  };
}

While building nyxt_tests(as definedbove), I end up with a similar error

*> nix build -L .\#nixosConfigurations.sarge.pkgs.nyxt-3
warning: Git tree '/home/viktor/dotfiles' is dirty
nyxt-tests> unpacking sources
nyxt-tests> unpacking source archive /nix/store/nngm016mh9yvsxzg952khgcld0z039cb-source
nyxt-tests> source root is source
nyxt-tests> patching sources
nyxt-tests> configuring
nyxt-tests> no configure script, doing nothing
nyxt-tests> building
nyxt-tests> WARNING: System definition file #P"/nix/store/prdiw2rkkbs4scqpq2zs9vci4ihmhaxr-calispel-20170830-git/calispel.asd" contains definition for system "calispel-test". Please only define "calispel" and secondary systems with a name starting with "calispel/" (e.g. "calispel/test") in that file.
nyxt-tests> WARNING: System definition file #P"/nix/store/7m5sykl2j7v7rnracx7iw8h7v3nb3iw0-s-xml-20150608-git/s-xml.asd" contains definition for system "s-xml.test". Please only define "s-xml" and secondary systems with a name starting with "s-xml/" (e.g. "s-xml/test") in that file.
nyxt-tests> WARNING: System definition file #P"/nix/store/7m5sykl2j7v7rnracx7iw8h7v3nb3iw0-s-xml-20150608-git/s-xml.asd" contains definition for system "s-xml.examples". Please only define "s-xml" and secondary systems with a name starting with "s-xml/" (e.g. "s-xml/test") in that file.
nyxt-tests> WARNING: System definition file #P"/nix/store/0fh29q25wlibk205hh6y83rw98xhln9q-cl-colors-20180328-git/cl-colors.asd" contains definition for system "cl-colors-tests". Please only define "cl-colors" and secondary systems with a name starting with "cl-colors/" (e.g. "cl-colors/test") in that file.
nyxt-tests> ;;; Computing Hangul syllable namesUnhandled SB-INT:SIMPLE-FILE-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING
nyxt-tests>                                                 {1001C78073}>:
nyxt-tests>   Error opening #P"/nix/store/9109c3lk98spkgbsy4a8dwm0ghakm4kn-nyxt-2.2.4/tests/package-tmpAAURSO1.fasl":
nyxt-tests>     Permission denied
nyxt-tests> Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1001C78073}>
nyxt-tests> 0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<SB-INT:SIMPLE-FILE-ERROR "Error opening ~S" {1008234423}> #<unused argument> :QUIT T)
nyxt-tests> 1: (SB-DEBUG::RUN-HOOK *INVOKE-DEBUGGER-HOOK* #<SB-INT:SIMPLE-FILE-ERROR "Error opening ~S" {1008234423}>)
nyxt-tests> 2: (INVOKE-DEBUGGER #<SB-INT:SIMPLE-FILE-ERROR "Error opening ~S" {1008234423}>)
nyxt-tests> 3: (ERROR SB-INT:SIMPLE-FILE-ERROR :PATHNAME #P"/nix/store/9109c3lk98spkgbsy4a8dwm0ghakm4kn-nyxt-2.2.4/tests/package-tmpAAURSO1.fasl" :MESSAGE "Permission denied" :FORMAT-CONTROL "Error opening ~S" :FORMAT-ARGUMENTS (#P"/nix/store/9109c3lk98spkgbsy4a8dwm0ghakm4kn-nyxt-2.2.4/tests/package-tmpAAURSO1.fasl"))
nyxt-tests> 4: (SB-IMPL::FILE-PERROR #P"/nix/store/9109c3lk98spkgbsy4a8dwm0ghakm4kn-nyxt-2.2.4/tests/package-tmpAAURSO1.fasl" 13 "Error opening ~S" #P"/nix/store/9109c3lk98spkgbsy4a8dwm0ghakm4kn-nyxt-2.2.4/tests/package-tmpAAURSO1.fasl")
nyxt-tests> 5: (SB-IMPL::%OPEN-ERROR #P"/nix/store/9109c3lk98spkgbsy4a8dwm0ghakm4kn-nyxt-2.2.4/tests/package-tmpAAURSO1.fasl" 13 NIL :CREATE)
nyxt-tests> 6: (OPEN #P"/nix/store/9109c3lk98spkgbsy4a8dwm0ghakm4kn-nyxt-2.2.4/tests/package-tmpAAURSO1.fasl" :DIRECTION :IO :ELEMENT-TYPE :DEFAULT :IF-EXISTS NIL :IF-DOES-NOT-EXIST :CREATE :EXTERNAL-FORMAT :UTF-8 :CLASS SB-SYS:FD-STREAM)
nyxt-tests> 7: (UIOP/STREAM:CALL-WITH-TEMPORARY-FILE #<FUNCTION (FLET "BEFORE234" :IN UIOP/STREAM::GET-TEMPORARY-FILE) {53504A2B}> :WANT-STREAM-P NIL :WANT-PATHNAME-P T :DIRECTION :IO :KEEP T :AFTER NIL :DIRECTORY #P"/nix/store/9109c3lk98spkgbsy4a8dwm0ghakm4kn-nyxt-2.2.4/tests/" :TYPE "fasl" :PREFIX "package-tmp" :SUFFIX NIL :ELEMENT-TYPE NIL :EXTERNAL-FORMAT NIL)
nyxt-tests> 8: (UIOP/LISP-BUILD:COMPILE-FILE* #P"/nix/store/9109c3lk98spkgbsy4a8dwm0ghakm4kn-nyxt-2.2.4/tests/package.lisp" :OUTPUT-FILE #P"/nix/store/9109c3lk98spkgbsy4a8dwm0ghakm4kn-nyxt-2.2.4/tests/package.fasl" :EXTERNAL-FORMAT :UTF-8 :WARNINGS-FILE NIL)
nyxt-tests> 9: (ASDF/LISP-ACTION:PERFORM-LISP-COMPILATION #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "nyxt/tests" "tests/package">)
nyxt-tests> 10: ((SB-PCL::EMF ASDF/ACTION:PERFORM) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "nyxt/tests" "tests/package">)
nyxt-tests> 11: ((LAMBDA NIL :IN ASDF/ACTION:CALL-WHILE-VISITING-ACTION))
nyxt-tests> 12: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS :AROUND (T T)) #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "nyxt/tests" "tests/package">) [fast-method]
nyxt-tests> 13: ((:METHOD ASDF/PLAN:PERFORM-PLAN (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {100490D8A3}>) [fast-method]
nyxt-tests> 14: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT))
nyxt-tests> 15: ((:METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {100490D8A3}>) [fast-method]
nyxt-tests> 16: ((:METHOD ASDF/OPERATE:OPERATE (ASDF/OPERATION:OPERATION ASDF/COMPONENT:COMPONENT)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "nyxt/tests"> :PLAN-CLASS NIL :PLAN-OPTIONS NIL) [fast-method]
nyxt-tests> 17: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "nyxt/tests">)
nyxt-tests> 18: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
nyxt-tests> 19: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "nyxt/tests">) [fast-method]
nyxt-tests> 20: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> ASDF/LISP-ACTION:LOAD-OP NYXT/TESTS)
nyxt-tests> 21: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
nyxt-tests> 22: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP NYXT/TESTS) [fast-method]
nyxt-tests> 23: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<FUNCTION (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {10032F985B}> :OVERRIDE T :KEY NIL :OVERRIDE-CACHE T :OVERRIDE-FORCING NIL)
nyxt-tests> 24: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
nyxt-tests> 25: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<FUNCTION (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {10030D8ABB}> :OVERRIDE NIL :KEY NIL :OVERRIDE-CACHE NIL :OVERRIDE-FORCING NIL)
nyxt-tests> 26: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP NYXT/TESTS) [fast-method]
nyxt-tests> 27: (ASDF/OPERATE:LOAD-SYSTEM NYXT/TESTS)
nyxt-tests> 28: ((LAMBDA NIL :IN "/nix/store/q499b6bcqpdbbwjizli57am4b1raw403-build-nyxt-tests.lisp"))
nyxt-tests> 29: (SB-INT:SIMPLE-EVAL-IN-LEXENV (DOLIST (S (QUOTE (NYXT/TESTS))) (ASDF/OPERATE:LOAD-SYSTEM S)) #<NULL-LEXENV>)
nyxt-tests> 30: (EVAL-TLF (DOLIST (S (QUOTE (NYXT/TESTS))) (ASDF/OPERATE:LOAD-SYSTEM S)) 1 NIL)
nyxt-tests> 31: ((LABELS SB-FASL::EVAL-FORM :IN SB-INT:LOAD-AS-SOURCE) (DOLIST (S (QUOTE (NYXT/TESTS))) (ASDF/OPERATE:LOAD-SYSTEM S)) 1)
nyxt-tests> 32: ((LAMBDA (SB-KERNEL:FORM &KEY :CURRENT-INDEX &ALLOW-OTHER-KEYS) :IN SB-INT:LOAD-AS-SOURCE) (DOLIST (S (QUOTE (NYXT/TESTS))) (ASDF/OPERATE:LOAD-SYSTEM S)) :CURRENT-INDEX 1)
nyxt-tests> 33: (SB-C::%DO-FORMS-FROM-INFO #<FUNCTION (LAMBDA (SB-KERNEL:FORM &KEY :CURRENT-INDEX &ALLOW-OTHER-KEYS) :IN SB-INT:LOAD-AS-SOURCE) {10016567DB}> #<SB-C::SOURCE-INFO {10016567A3}> SB-C::INPUT-ERROR-IN-LOAD)
nyxt-tests> 34: (SB-INT:LOAD-AS-SOURCE #<SB-SYS:FD-STREAM for "file /nix/store/q499b6bcqpdbbwjizli57am4b1raw403-build-nyxt-tests.lisp" {1001650E73}> :VERBOSE NIL :PRINT NIL :CONTEXT "loading")
nyxt-tests> 35: ((LABELS SB-FASL::LOAD-STREAM-1 :IN LOAD) #<SB-SYS:FD-STREAM for "file /nix/store/q499b6bcqpdbbwjizli57am4b1raw403-build-nyxt-tests.lisp" {1001650E73}> NIL)
nyxt-tests> 36: (SB-FASL::CALL-WITH-LOAD-BINDINGS #<FUNCTION (LABELS SB-FASL::LOAD-STREAM-1 :IN LOAD) {7FFFF784780B}> #<SB-SYS:FD-STREAM for "file /nix/store/q499b6bcqpdbbwjizli57am4b1raw403-build-nyxt-tests.lisp" {1001650E73}> NIL #<SB-SYS:FD-STREAM for "file /nix/store/q499b6bcqpdbbwjizli57am4b1raw403-build-nyxt-tests.lisp" {1001650E73}>)
nyxt-tests> 37: (LOAD #<SB-SYS:FD-STREAM for "file /nix/store/q499b6bcqpdbbwjizli57am4b1raw403-build-nyxt-tests.lisp" {1001650E73}> :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST :ERROR :EXTERNAL-FORMAT :DEFAULT)
nyxt-tests> 38: ((FLET SB-IMPL::LOAD-SCRIPT :IN SB-IMPL::PROCESS-SCRIPT) #<SB-SYS:FD-STREAM for "file /nix/store/q499b6bcqpdbbwjizli57am4b1raw403-build-nyxt-tests.lisp" {1001650E73}>)
nyxt-tests> 39: ((FLET SB-UNIX::BODY :IN SB-IMPL::PROCESS-SCRIPT))
nyxt-tests> 40: ((FLET "WITHOUT-INTERRUPTS-BODY-11" :IN SB-IMPL::PROCESS-SCRIPT))
nyxt-tests> 41: (SB-IMPL::PROCESS-SCRIPT "/nix/store/q499b6bcqpdbbwjizli57am4b1raw403-build-nyxt-tests.lisp")
nyxt-tests> 42: (SB-IMPL::TOPLEVEL-INIT)
nyxt-tests> 43: ((FLET SB-UNIX::BODY :IN SB-IMPL::START-LISP))
nyxt-tests> 44: ((FLET "WITHOUT-INTERRUPTS-BODY-3" :IN SB-IMPL::START-LISP))
nyxt-tests> 45: (SB-IMPL::%START-LISP)
nyxt-tests> unhandled condition in --disable-debugger mode, quitting
nyxt-tests> ;
nyxt-tests> ; compilation unit aborted
nyxt-tests> ;   caught 1 fatal ERROR condition
error: builder for '/nix/store/khjb0bpvn8kd06ra8sykdz1hmqqczk4b-nyxt-tests-2022-09-22.drv' failed with exit code 1;
       last 10 log lines:
       > 41: (SB-IMPL::PROCESS-SCRIPT "/nix/store/q499b6bcqpdbbwjizli57am4b1raw403-build-nyxt-tests.lisp")
       > 42: (SB-IMPL::TOPLEVEL-INIT)
       > 43: ((FLET SB-UNIX::BODY :IN SB-IMPL::START-LISP))
       > 44: ((FLET "WITHOUT-INTERRUPTS-BODY-3" :IN SB-IMPL::START-LISP))
       > 45: (SB-IMPL::%START-LISP)
       >
       > unhandled condition in --disable-debugger mode, quitting
       > ;
       > ; compilation unit aborted
       > ;   caught 1 fatal ERROR condition
       For full logs, run 'nix log /nix/store/khjb0bpvn8kd06ra8sykdz1hmqqczk4b-nyxt-tests-2022-09-22.drv'.
error: 1 dependencies of derivation '/nix/store/dvzla13aylli8vbx6vbdf13ks6kwirjs-nyxt-2022-09-22.drv' failed to build

I am just starting out with lisp, but from the messages, looks like the fast files are getting generated in the src directory(which has no write permissions) which is the cause of error. Was looking though to see if there are workarounds, looks like there is a target-directory/output-file option in compile-file http://www.lispworks.com/documentation/lw71/LW/html/lw-794.htm#marker-1419068 and http://www.lispworks.com/documentation/lw70/LW/html/lw-362.htm could any of these be used to specify an alternate writable path(I am thinking somewhere in $out in the build sandbox).

Any pointers will definitely help.

Uthar commented 2 years ago

For this I need the slynk-mrepl packages and others

Hi nagy. Sorry for not responding, I had a lot of stuff IRL.

Slashy systems are broken right now - they share the sources with their parent systems which causes all sorts of problems, like this one trying to compile into another, immutable directory in the nix store.

A quick workaround, if you need just slynk/mrepl might be:

sbclPackages.slynk.overrideLispAttrs (o: { systems = o.systems ++ [ "slynk/mrepl" ]; })
Uthar commented 2 years ago

I'm also facing a similar issue, while building nyxt

Hi paulvictor, thanks for stopping by

I see you are trying to build nyxt and nyxt/tests as separate packages. This won't work, because asdf thinks that nyxt/tests source is in nyxt directory and tries to compile in an immutable store dir, instead of pwd.

You could try to build one nyxt package with systems = [ "nyxt", "nyxt/tests" ], that way both will build using the same source directory.

Uthar commented 2 years ago

(nyxt has a unique build command, which just builds nyxt/gtk-application, so it doesn't use the systems attribute:) https://github.com/Uthar/nix-cl/blob/dd06b67a3c2f347c433f9b0701cf8dd5e538f784/packages.nix#L280-L324

paulvictor commented 2 years ago

I tried that with

    asds = [ "nyxt" "nyxt-asdf" ];
    systems = [ "nyxt" "nyxt/tests" ];

    lispLibs =
      sbclPackages.nyxt.lispLibs ++
      (with sbclPackages; [ cl-cffi-gtk cl-webkit2 mk-string-metrics ]);

, but encountered the error

While evaluating the form starting at line 229, column 0
  of #P"/nix/store/nngm016mh9yvsxzg952khgcld0z039cb-source/nyxt.asd":
Unhandled LOAD-SYSTEM-DEFINITION-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING {1004BF0073}>: Error while trying to load definition for system nyxt from pathname /nix/store/nngm016mh9yvsxzg952khgcld0z039cb-source/nyxt.asd: don't recognize component type :NYXT-TEST-SYSTEM in the context of no parent

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1004BF0073}>
0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<LOAD-SYSTEM-DEFINITION-ERROR {1003DA58C3}> #<unused argument> :QUIT T)
1: (SB-DEBUG::RUN-HOOK SB-EXT:*INVOKE-DEBUGGER-HOOK* #<LOAD-SYSTEM-DEFINITION-ERROR {1003DA58C3}>)
2: (INVOKE-DEBUGGER #<LOAD-SYSTEM-DEFINITION-ERROR {1003DA58C3}>)
3: (ERROR LOAD-SYSTEM-DEFINITION-ERROR :NAME "nyxt" :PATHNAME #P"/nix/store/nngm016mh9yvsxzg952khgcld0z039cb-source/nyxt.asd" :CONDITION #<ASDF/SESSION:FORMATTED-SYSTEM-DEFINITION-ERROR {1003DA4D13}>)

That's why I thought I'll have tests as a separate package

Any help further ?

Uthar commented 2 years ago

Interesting, looks like they recently moved out the helper functions from nyxt.asd into a nyxt-asdf library: https://github.com/atlas-engineer/nyxt/commit/aa4e77525facf822f90848c24755ebc0cdd9c3b0

Which added this line: https://github.com/atlas-engineer/nyxt/blob/aef5118a7c30c48583b464e2e0c27d4b0060999b/nyxt.asd#L230

With that I can recreate the problem, but don't know yet how to fix it

Uthar commented 2 years ago

I think the problem was that the version from latest git was using nyxt-asdf from the old source, the solution was to build nyxt-asdf from the new sources instead.

here's how I got (asdf:test-system 'nyxt) to pass:

let
  nix-cl = (builtins.getFlake "github:uthar/nix-cl").lib;
  pkgs = (builtins.getFlake "nixpkgs").legacyPackages.x86_64-linux;
  sbcl = nix-cl.sbcl';

  nyxt-src = pkgs.fetchFromGitHub {
    owner = "atlas-engineer";
    repo = "nyxt";
    rev = "aef5118a7c30c48583b464e2e0c27d4b0060999b";
    sha256 = "1b75bqaxbpsik7wampwri5j1avldkvkqnvdgg2c3hgj05yccmkbv";
  };

  nyxt-asdf = nix-cl.build-asdf-system {
    pname = "nyxt-asdf";
    version = "2022";
    src = nyxt-src;
    systems = [ "nyxt-asdf" ];
    lisp = sbcl;
  };

  ndebug = nix-cl.build-asdf-system {
    src = pkgs.fetchzip {
      url = "https://github.com/atlas-engineer/ndebug/archive/d9488f82489de42a2b9bbf32120a003a3aced5c6.tar.gz";
      sha256 = "0j52kn9vqadhq2n0nnw7q3440fsvl21p30i6nn75pbmnq2xgdshz";
    };
    pname = "ndebug";
    version = "0.0.2";
    lisp = sbcl;
    lispLibs = with nix-cl.sbclPackages; [
      dissect
      trivial-custom-debugger
      trivial-gray-streams
      bordeaux-threads
    ];
  };

  lisp-unit2 = nix-cl.sbclPackages.lisp-unit2.overrideLispAttrs(_: {
    src = pkgs.fetchFromGitHub {
      owner = "AccelerationNet";
      repo = "lisp-unit2";
      rev = "db50c8ce5806b3c46713a62bae362951b32c1829";
      sha256 = "0dnq0qvbsn7ciknvmwzfjnimlzq1gdkv5xd87agmhxm1cpm1ksz0";
    };
    version = "0.9.4";
  });

  hu_dot_dwim_dot_defclass-star = nix-cl.sbclPackages.hu_dot_dwim_dot_defclass-star.overrideLispAttrs (_: {
    src = pkgs.fetchFromGitHub {
      owner = "hu-dwim";
      repo = "hu.dwim.defclass-star";
      rev = "2698bd93073f9ba27583351221a3a087fb595626";
      sha256 = "0v6bj3xbcpz98bkv3a2skz2dh0p50mqaflgkfbrzx1dzbkl1630y";
    };
  });

  ospm = nix-cl.build-asdf-system {
    src = pkgs.fetchzip {
      url = "https://github.com/atlas-engineer/ospm/archive/df261dedaa2e98f00b4b9ef6c41c08d231558682.tar.gz";
      sha256 = "0ixx6y20q4kcvm60lp3wca5q1nhnpakdw5avz4mlj6mm8m4z526g";
    };
    pname = "ospm";
    version = "0.0.2";
    lisp = sbcl;
    lispLibs = with nix-cl.sbclPackages; [
      alexandria
      calispel
      local-time
      moptilities
      named-readtables
      osicat
      serapeum
      trivia
    ] ++ [ hu_dot_dwim_dot_defclass-star ];
  };

  nyxt = nix-cl.build-asdf-system {
    pname = "nyxt";
    version = "2022";
    src = nyxt-src;
    lisp = sbcl;
    systems = [
      "nyxt"
      "nyxt/history-tree"
      "nyxt/class-star"
      "nyxt/prompter"
      "nyxt/tests"
      "nyxt/history-tree/tests"
      "nyxt/class-star/tests"
      "nyxt/prompter/tests"
    ];
    lispLibs = with nix-cl.sbclPackages; [
      alexandria
      bordeaux-threads
      calispel
      cl-base64
      cl-containers
      cl-css
      cl-custom-hash-table
      enchant
      cl-gopher
      cl-html-diff
      cl-json
      cl-ppcre
      cl-ppcre-unicode
      cl-prevalence
      cl-qrencode
      str
      cl-tld
      closer-mop
      clss
      cluffer
      dexador
      flexi-streams
      iolib
      local-time
      log4cl
      lparallel
      moptilities
      named-readtables
      nfiles
      nhooks
      nkeymaps
      parenscript
      phos
      plump
      quri
      serapeum
      swank
      spinneret
      trivia
      trivial-clipboard
      trivial-features
      trivial-garbage
      trivial-package-local-nicknames
      trivial-types
      uiop
      unix-opts
      cl-cffi-gtk
      cl-webkit2
      mk-string-metrics
      dissect
      py-configparser
      slynk
    ]
    ++ [
      hu_dot_dwim_dot_defclass-star
      nyxt-asdf
      ndebug
      ospm
      lisp-unit2
    ];
  };

in [
  nyxt
  (nix-cl.sbclWithPackages (_: [ nyxt ]))
]

Wow, thats a bunch of dependencies for nyxt (-:

nagy commented 2 years ago

A quick workaround, if you need just slynk/mrepl might be:

sbclPackages.slynk.overrideLispAttrs (o: { systems = o.systems ++ [ "slynk/mrepl" ]; })

Thank you very much, this has worked. I ended up with:

slynk.overrideLispAttrs (o: {
    systems = o.systems ++ ["slynk/mrepl" "slynk/indentation" "slynk/stickers" "slynk/trace-dialog" "slynk/package-fu" "slynk/fancy-inspector" "slynk/arglists" "slynk/profiler" "slynk/retro"];
  })

Slashy systems are broken right now

Would it make sense to set meta.broken = true in those slashy packages to codify our acknowledgement that it is broken?

Uthar commented 2 years ago

Would it make sense to set meta.broken = true in those slashy packages to codify our acknowledgement that it is broken?

We can do that, a meta attribute could be added to the generated nix code, if a slash occurs in the name. Then re-generating imported.nix would include the changes.

I'm thinking about a clean solution to the problem, leaning towards something like the last sentence here

lukego commented 2 years ago

Firstly a big thanks to @Uthar

Seriously!

I stumbled on the new Lisp packages infrastructure recently and I am amazed at how well it works. Thank you so much for doing this great work!

Uthar commented 2 years ago

Thanks @lukego for the kind words, it's not perfect, but mostly works That gives me some more motivation to fix the remaining issues (-:

Uthar commented 2 years ago

marked slashy systems as broken 53477c37194d204e9f35ee8322287bc36c766753