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

Tests are failing #8

Closed
Ambrevar opened this issue Aug 23, 2018 · 16 comments
Closed

Tests are failing #8

Ambrevar opened this issue Aug 23, 2018 · 16 comments

Comments

@Ambrevar
Copy link

Unhandled UIOP/UTILITY:PARAMETER-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING
                                                    {10005585B3}>:
  :FORCE and :FORCE-NOT arguments not allowed in a nested call to ASDF/OPERATE:OPERATE unless identically to toplevel

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {10005585B3}>
0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<UIOP/UTILITY:PARAMETER-ERROR {10024CC1F3}> #<unused argument> :QUIT T)
1: (SB-DEBUG::RUN-HOOK *INVOKE-DEBUGGER-HOOK* #<UIOP/UTILITY:PARAMETER-ERROR {10024CC1F3}>)
2: (INVOKE-DEBUGGER #<UIOP/UTILITY:PARAMETER-ERROR {10024CC1F3}>)
3: (ERROR UIOP/UTILITY:PARAMETER-ERROR :FUNCTIONALITY ASDF/OPERATE:OPERATE :FORMAT-CONTROL "~*~S and ~S arguments not allowed in a nested call to ~3:*~S ~
unless identically to toplevel" :FORMAT-ARGUMENTS (:FORCE :FORCE-NOT))
4: (UIOP/UTILITY:PARAMETER-ERROR "~*~S and ~S arguments not allowed in a nested call to ~3:*~S ~
unless identically to toplevel" ASDF/OPERATE:OPERATE :FORCE :FORCE-NOT)
5: (ASDF/FORCING:MAKE-FORCING :PERFORMABLE-P T :SYSTEM "split-sequence/tests" :FORCE (:SPLIT-SEQUENCE/TESTS) :FORCE-NOT NIL)
6: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
7: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP :SPLIT-SEQUENCE/TESTS :FORCE (:SPLIT-SEQUENCE/TESTS)) [fast-method]
8: (ASDF/OPERATE:LOAD-SYSTEM :SPLIT-SEQUENCE/TESTS :FORCE (:SPLIT-SEQUENCE/TESTS))
9: ((:METHOD ASDF/ACTION:PERFORM (ASDF/LISP-ACTION:TEST-OP (EQL (ASDF/SYSTEM:FIND-SYSTEM :SPLIT-SEQUENCE)))) #<unused argument> #<unused argument>) [fast-method]
10: ((SB-PCL::EMF ASDF/ACTION:PERFORM) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:TEST-OP > #<ASDF/SYSTEM:SYSTEM "split-sequence">)
11: ((LAMBDA NIL :IN ASDF/ACTION:CALL-WHILE-VISITING-ACTION))
12: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS :AROUND (T T)) #<ASDF/LISP-ACTION:TEST-OP > #<ASDF/SYSTEM:SYSTEM "split-sequence">) [fast-method]
13: ((:METHOD ASDF/PLAN:PERFORM-PLAN (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {10021EA4E3}>) [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 {10021EA4E3}>) [fast-method]
16: ((:METHOD ASDF/OPERATE:OPERATE (ASDF/OPERATION:OPERATION ASDF/COMPONENT:COMPONENT)) #<ASDF/LISP-ACTION:TEST-OP > #<ASDF/SYSTEM:SYSTEM "split-sequence"> :PLAN-CLASS NIL :PLAN-OPTIONS NIL) [fast-method]
17: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:TEST-OP > #<ASDF/SYSTEM:SYSTEM "split-sequence">)
18: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
19: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) #<ASDF/LISP-ACTION:TEST-OP > #<ASDF/SYSTEM:SYSTEM "split-sequence">) [fast-method]
20: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> ASDF/LISP-ACTION:TEST-OP "split-sequence")
21: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
22: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:TEST-OP "split-sequence") [fast-method]
23: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<CLOSURE (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {1002171FEB}> :OVERRIDE T :KEY NIL :OVERRIDE-CACHE T :OVERRIDE-FORCING NIL)
24: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
25: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<CLOSURE (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {100215470B}> :OVERRIDE NIL :KEY NIL :OVERRIDE-CACHE NIL :OVERRIDE-FORCING NIL)
26: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:TEST-OP "split-sequence") [fast-method]
27: (ASDF/OPERATE:TEST-SYSTEM "split-sequence")
28: (SB-INT:SIMPLE-EVAL-IN-LEXENV (ASDF/OPERATE:TEST-SYSTEM "split-sequence") #<NULL-LEXENV>)
29: (EVAL (ASDF/OPERATE:TEST-SYSTEM "split-sequence"))
30: (SB-IMPL::PROCESS-EVAL/LOAD-OPTIONS ((:EVAL . "(require :asdf)") (:EVAL . #<(SIMPLE-ARRAY CHARACTER (475)) (let ((*package* (find-package :asdf))) (load "/gnu/store/1g2nh46nf1rygx5yd8y4sqmiqb6zlmf5-sbcl-split-sequence-1.4.1/share/common-lisp/sbcl-source/split-sequence/split-sequence.asd") (when (uiop:file-... {100197839F}>) (:EVAL . "(asdf:test-system \"split-sequence\")") (:QUIT)))
31: (SB-IMPL::TOPLEVEL-INIT)
32: ((FLET SB-UNIX::BODY :IN SAVE-LISP-AND-DIE))
33: ((FLET "WITHOUT-INTERRUPTS-BODY-27" :IN SAVE-LISP-AND-DIE))
34: ((LABELS SB-IMPL::RESTART-LISP :IN SAVE-LISP-AND-DIE))
@sionescu
Copy link
Member

I cannot reproduce this. What versions of ASDF and UIOP are you using ?

@Ambrevar
Copy link
Author

  • SBCL: 1.4.4
  • ASDF: 3.3.1

How do I get UIOP's version number?

@sionescu
Copy link
Member

sionescu commented Sep 25, 2018

The special variable uiop:*uiop-version* [edited markdown syntax --@luismbo 2018-09-25]

@Ambrevar
Copy link
Author

Sorry, I'm still fairly new to Common Lisp. How do I retrieve this value?
From the sbcl REPL:

* uiop:uiop-version

debugger invoked on a SB-INT:SIMPLE-READER-PACKAGE-ERROR in thread
#<THREAD "main thread" RUNNING {10005585B3}>:
  Symbol "UIOP-VERSION" not found in the UIOP/DRIVER package.

@luismbo
Copy link
Member

luismbo commented Sep 25, 2018

@Ambrevar it's uiop:*uiop-version*. The asterisks were interpreted as Markdown syntax in @sionescu's message.

@Ambrevar
Copy link
Author

Ha! :p OK, uiop version is "3.3.1".

@sionescu
Copy link
Member

sionescu commented Oct 2, 2018

How are you invoking the test suite ?

@Ambrevar
Copy link
Author

Ambrevar commented Oct 3, 2018

Sorry, I forgot to tell the full story. I'm trying to package this for Guix.
Guix features an automated ASDF builder which has proved to be quite reliable so far.

Here is the Scheme code that runs the test suite:

(define (test-system system asd-file test-asd-file)
  "Use a lisp implementation to test SYSTEM using asdf.  Load ASD-FILE first.
Also load TEST-ASD-FILE if necessary."
  (lisp-eval-program
   `((require :asdf)
     (let ((*package* (find-package :asdf)))
       (load ,asd-file)
       ,@(if test-asd-file
             `((load ,test-asd-file))
             ;; Try some likely files.
             (map (lambda (file)
                    `(when (uiop:file-exists-p ,file)
                       (load ,file)))
                  (list
                   (string-append system "-tests.asd")
                   (string-append system "-test.asd")
                   "tests.asd"
                   "test.asd"))))
     (asdf:test-system ,system))))

@sionescu
Copy link
Member

sionescu commented Oct 4, 2018

@fare IIRC you use Guix ? The function above is wrong in so many ways. It should probably just set the search path and call TEST-SYSTEM, and ASDF will figure the rest.

@fare
Copy link

fare commented Oct 4, 2018

I currently use NixOS. Is Guix a viable alternative these days?

@fare
Copy link

fare commented Oct 4, 2018

There's no point in loading the (string-append system "-test.asd") or any such thing: If a test-op operation is defined for the system, it will automatically load any such dependency if available.

@Ambrevar
Copy link
Author

Ambrevar commented Oct 4, 2018

Thanks for the feedback, I will let the author know about this.

@fare: I've been using Guix for the past 6 months and it's been a "never look back" experience. I believe it's very mature already and 1.0 is looming at the horizon.
Lots of packages in there, lots of services, and some awesome Guix-specific features like guix package --relocatable (https://guix.info/blog/2018/tarballs-the-ultimate-container-image-format/).
Guix and Nix are extremely similar, but I think Guix is superior because everything is Lisp, which means the whole system is hackable in a very homogeneous way with a most powerful language.
Interesting paper of how Scheme proved to be invaluable: https://arxiv.org/abs/1709.00833.

@sionescu
Copy link
Member

sionescu commented Oct 4, 2018

@fare oops, I confused NixOS with Guix :)

@Ambrevar the loading function is not guaranteed to work, especially using cl:load to evaluate a .asd file. The following should work:

(define (test-system system asd-file test-asd-file)
  "Use a lisp implementation to test SYSTEM using asdf."
  (lisp-eval-program
   `((require :asdf)
     (flet ((add-path (file)
              (let* ((dir (uiop:pathname-directory-pathname file))
                     (registry (uiop:find-symbol* "*CENTRAL-REGISTRY*" :asdf)))
                (set registry (adjoin dir (symbol-value registry) :test 'equalp)))))
       (mapc (function add-path) '(,asd-file ,test-asd-file))
       (asdf:test-system ,system)))))

@Ambrevar
Copy link
Author

Ambrevar commented Oct 17, 2018

Sorry for the delay.

@sionescu: I've tried your suggestion, but now all tests fail with the following output:

...
starting phase `check'
Invoking sbcl: "/gnu/store/a26268cn6bcsgvi07v00pwab6r7p77jw-sbcl-1.4.4/bin/sbcl" "--non-interactive" "--eval" "(require :asdf)" "--eval" "(flet ((add-path (file) (let* ((dir (uiop:pathname-directory-pathname file)) (registry (uiop:find-symbol* \"*CENTRAL-REGISTRY*\" :asdf))) (set registry (adjoin dir (symbol-value registry) :test (quote equalp)))))) (mapc (function add-path) (quote (\"/gnu/store/7gzdq89ix4a1zg42v6vi75ajv8nzd3r4-sbcl-split-sequence-1.4.1/share/common-lisp/sbcl-source/split-sequence/split-sequence.asd\" #f))) (asdf:test-system \"split-sequence\"))"
This is SBCL 1.4.4, 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.
Unhandled SB-INT:SIMPLE-READER-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING
                                                  {10005585B3}>:
  no dispatch function defined for #\F

    Line: 1, Column: 383, File-Position: 383

    Stream: #<SB-IMPL::STRING-INPUT-STREAM {10030D37E3}>

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {10005585B3}>
0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<SB-INT:SIMPLE-READER-ERROR "no dispatch function defined for ~S" {10030D4753}> #<unused argument> :QUIT T)
1: (SB-DEBUG::RUN-HOOK *INVOKE-DEBUGGER-HOOK* #<SB-INT:SIMPLE-READER-ERROR "no dispatch function defined for ~S" {10030D4753}>)
2: (INVOKE-DEBUGGER #<SB-INT:SIMPLE-READER-ERROR "no dispatch function defined for ~S" {10030D4753}>)
3: (ERROR SB-INT:SIMPLE-READER-ERROR :STREAM #<SB-IMPL::STRING-INPUT-STREAM {10030D37E3}> :FORMAT-CONTROL "no dispatch function defined for ~S" :FORMAT-ARGUMENTS (#\F))
4: (SB-IMPL::READ-MAYBE-NOTHING #<SB-IMPL::STRING-INPUT-STREAM {10030D37E3}> #\#)
5: (SB-IMPL::READ-LIST #<SB-IMPL::STRING-INPUT-STREAM {10030D37E3}> #<unused argument>)
6: (SB-IMPL::READ-MAYBE-NOTHING #<SB-IMPL::STRING-INPUT-STREAM {10030D37E3}> #\()
7: (SB-IMPL::READ-LIST #<SB-IMPL::STRING-INPUT-STREAM {10030D37E3}> #<unused argument>)
8: (SB-IMPL::READ-MAYBE-NOTHING #<SB-IMPL::STRING-INPUT-STREAM {10030D37E3}> #\()
9: (SB-IMPL::READ-LIST #<SB-IMPL::STRING-INPUT-STREAM {10030D37E3}> #<unused argument>)
10: (SB-IMPL::READ-MAYBE-NOTHING #<SB-IMPL::STRING-INPUT-STREAM {10030D37E3}> #\()
11: (SB-IMPL::READ-LIST #<SB-IMPL::STRING-INPUT-STREAM {10030D37E3}> #<unused argument>)
12: (SB-IMPL::READ-MAYBE-NOTHING #<SB-IMPL::STRING-INPUT-STREAM {10030D37E3}> #\()
13: (SB-IMPL::%READ-PRESERVING-WHITESPACE #<SB-IMPL::STRING-INPUT-STREAM {10030D37E3}> T (NIL) T)
14: (SB-IMPL::%READ-PRESERVING-WHITESPACE #<SB-IMPL::STRING-INPUT-STREAM {10030D37E3}> T (NIL) NIL)
15: (READ #<SB-IMPL::STRING-INPUT-STREAM {10030D37E3}> T NIL NIL)
16: (SB-IMPL::%READ-FROM-STRING #<(SIMPLE-ARRAY CHARACTER (424)) (flet ((add-path (file) (let* ((dir (uiop:pathname-directory-pathname file)) (registry (uiop:find-symbol* "*CENTRAL-REGISTRY*" :asdf))) (set registry (adjoin dir (symbol-value registry) :test (quote e... {100197839F}> T NIL 0 NIL NIL)
17: (SB-IMPL::PROCESS-EVAL/LOAD-OPTIONS ((:EVAL . "(require :asdf)") (:EVAL . #<(SIMPLE-ARRAY CHARACTER (424)) (flet ((add-path (file) (let* ((dir (uiop:pathname-directory-pathname file)) (registry (uiop:find-symbol* "*CENTRAL-REGISTRY*" :asdf))) (set registry (adjoin dir (symbol-value registry) :test (quote e... {100197839F}>) (:QUIT)))
18: (SB-IMPL::TOPLEVEL-INIT)
19: ((FLET SB-UNIX::BODY :IN SAVE-LISP-AND-DIE))
20: ((FLET "WITHOUT-INTERRUPTS-BODY-27" :IN SAVE-LISP-AND-DIE))
21: ((LABELS SB-IMPL::RESTART-LISP :IN SAVE-LISP-AND-DIE))

In the meantime, Andy Patterson has updated the test function to the following, but it yields the same issue as I reported in the original post:

(define (test-system system asd-file test-asd-file)
  "Use a lisp implementation to test SYSTEM using asdf.  Load ASD-FILE first.
Also load TEST-ASD-FILE if necessary."
  (lisp-eval-program
   `((require :asdf)
     (asdf:load-asd (truename ,asd-file) :name ,(normalize-string system))
     ,@(if test-asd-file
           `((asdf:load-asd (truename ,test-asd-file)))
           ;; Try some likely files.
           (map (lambda (file)
                  `(when (uiop:file-exists-p ,file)
                     (asdf:load-asd (truename ,file))))
                (list
                 (string-append system "-tests.asd")
                 (string-append system "-test.asd")
                 "tests.asd"
                 "test.asd")))
     (asdf:test-system ,system))))

@sionescu
Copy link
Member

sionescu commented May 2, 2019

I'm closing this because I don't think it's an issue caused by split-sequence.

@sionescu sionescu closed this as completed May 2, 2019
@hraban
Copy link

hraban commented Jun 2, 2023

Since we're on the topic of Nix and lisp tests: I've been working on my own copy of a CL-in-Nix builder, https://github.com/hraban/cl-nix-lite , and it handles spilt-sequence unit tests OK. It relies as much as possible on ASDFv3 conventions, doesn't modify any .asd files or create any convoluted lisp code, just issues (asdf:test-system :split-sequence).

Could be useful to anyone who wants to play around with Nix & CL :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants