stumpwm / mahogany

A stumpwm like Wayland compositor
GNU General Public License v2.0
241 stars 14 forks source link

Issue Building in Guix #36

Closed KarlJoad closed 1 year ago

KarlJoad commented 1 year ago

I am attempting to package Mahogany for Guix and am running into a compilation issue.

I have put all of my work so far on a personal branch of Guix: https://github.com/KarlJoad/guix/tree/mahogany

Invoking sbcl: "/gnu/store/kdv3jw3byj4zh7q8hihk2czaj59yii49-sbcl-2.3.7/bin/sbcl" "--non-interactive" "--eval" "(require :asdf)" "--eval" "(asdf:initialize-source-registry (list :source-registry (list :tree (uiop:ensure-pathname \"/gnu/store/3k6y3hmgi56mckmaxnlrkdmnx2dk6c9f-mahogany-0.0.0-0.e2c03d2-lib/share/common-lisp/sbcl/mahogany\" :truenamize t :ensure-directory t)) :inherit-configuration))" "--eval" "(asdf:load-system \"mahogany\")"
This is SBCL 2.3.7, 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.
; compiling file "/gnu/store/3k6y3hmgi56mckmaxnlrkdmnx2dk6c9f-mahogany-0.0.0-0.e2c03d2-lib/share/common-lisp/sbcl/mahogany/lisp/log.lisp" (written 01 JAN 1970 12:00:00 AM):

; file: /gnu/store/3k6y3hmgi56mckmaxnlrkdmnx2dk6c9f-mahogany-0.0.0-0.e2c03d2-lib/share/common-lisp/sbcl/mahogany/lisp/log.lisp
; in: DEFUN LOG-INIT
;     (MAHOGANY/LOG:LOG-STRING :DEBUG
;                              "Mahogany Log settings set to:~%~2TColor:~10T~:[FALSE~;TRUE~]~%~2TOutput:~10T~A~%~2TLevel:~10T~S"
;                              CL-ANSI-TEXT:*ENABLED*
;                              MAHOGANY/LOG:*LOG-OUTPUT-FILE*
;                              (MAHOGANY/LOG:LOG-LEVEL))
; ==>
;   (MAHOGANY/LOG::%LOG-STREAM 5 :CYAN
;    (LAMBDA (MAHOGANY/LOG::S)
;      (DECLARE (TYPE STREAM MAHOGANY/LOG::S))
;      (FORMAT MAHOGANY/LOG::S
;              "Mahogany Log settings set to:~%~2TColor:~10T~:[FALSE~;TRUE~]~%~2TOutput:~10T~A~%~2TLevel:~10T~S"
;              CL-ANSI-TEXT:*ENABLED* MAHOGANY/LOG:*LOG-OUTPUT-FILE*
;              (MAHOGANY/LOG:LOG-LEVEL))
;      (FORMAT MAHOGANY/LOG::S "~%")))
;
; caught WARNING:
;   Derived type of (LAMBDA (MAHOGANY/LOG::S) :IN MAHOGANY/LOG:LOG-INIT) is
;     (FUNCTION (STREAM) (VALUES NULL &OPTIONAL)),
;   conflicting with its asserted type
;     (FUNCTION (STREAM) (VALUES &OPTIONAL)).
;   See also:
;     The SBCL Manual, Node "Handling of Types"

; wrote /gnu/store/3k6y3hmgi56mckmaxnlrkdmnx2dk6c9f-mahogany-0.0.0-0.e2c03d2-lib/lib/common-lisp/sbcl/mahogany/lisp/log-tmpGHU3ALSV.fasl
; compilation finished in 0:00:00.024
Unhandled UIOP/LISP-BUILD:COMPILE-FILE-ERROR in thread #<SB-THREAD:THREAD tid=28 "main thread" RUNNING
                                                          {100AF70113}>:
  COMPILE-FILE-ERROR while compiling #<CL-SOURCE-FILE "mahogany" "log">

Backtrace for: #<SB-THREAD:THREAD tid=28 "main thread" RUNNING {100AF70113}>
0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<UIOP/LISP-BUILD:COMPILE-FILE-ERROR {10065612A3}> #<unused argument> :QUIT T)
1: (SB-DEBUG::RUN-HOOK *INVOKE-DEBUGGER-HOOK* #<UIOP/LISP-BUILD:COMPILE-FILE-ERROR {10065612A3}>)
2: (INVOKE-DEBUGGER #<UIOP/LISP-BUILD:COMPILE-FILE-ERROR {10065612A3}>)
3: (ERROR UIOP/LISP-BUILD:COMPILE-FILE-ERROR :CONTEXT-FORMAT "~/asdf-action::format-action/" :CONTEXT-ARGUMENTS ((#<ASDF/LISP-ACTION:COMPILE-OP > . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "mahogany" "log">)))
4: (UIOP/LISP-BUILD:CHECK-LISP-COMPILE-RESULTS NIL T T "~/asdf-action::format-action/" ((#<ASDF/LISP-ACTION:COMPILE-OP > . #<ASDF/LISP-ACTION:CL-SOURCE-FILE "mahogany" "log">)))
5: ((SB-PCL::EMF ASDF/ACTION:PERFORM) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "mahogany" "log">)
6: ((LAMBDA NIL :IN ASDF/ACTION:CALL-WHILE-VISITING-ACTION))
7: ((:METHOD ASDF/ACTION:PERFORM :AROUND (ASDF/LISP-ACTION:COMPILE-OP ASDF/LISP-ACTION:CL-SOURCE-FILE)) #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "mahogany" "log">) [fast-method]
8: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS :AROUND (T T)) #<ASDF/LISP-ACTION:COMPILE-OP > #<ASDF/LISP-ACTION:CL-SOURCE-FILE "mahogany" "log">) [fast-method]
9: ((:METHOD ASDF/PLAN:PERFORM-PLAN (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {100538F253}>) [fast-method]
10: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT))
11: ((:METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)) #<ASDF/PLAN:SEQUENTIAL-PLAN {100538F253}>) [fast-method]
12: ((:METHOD ASDF/OPERATE:OPERATE (ASDF/OPERATION:OPERATION ASDF/COMPONENT:COMPONENT)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "mahogany"> :PLAN-CLASS NIL :PLAN-OPTIONS NIL) [fast-method]
13: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "mahogany">)
14: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
15: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) #<ASDF/LISP-ACTION:LOAD-OP > #<ASDF/SYSTEM:SYSTEM "mahogany">) [fast-method]
16: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) #<unused argument> #<unused argument> ASDF/LISP-ACTION:LOAD-OP "mahogany")
17: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
18: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP "mahogany") [fast-method]
19: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<FUNCTION (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {10046EA7DB}> :OVERRIDE T :KEY NIL :OVERRIDE-CACHE T :OVERRIDE-FORCING NIL)
20: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
21: (ASDF/SESSION:CALL-WITH-ASDF-SESSION #<FUNCTION (LAMBDA NIL :IN ASDF/OPERATE:OPERATE) {100366DB0B}> :OVERRIDE NIL :KEY NIL :OVERRIDE-CACHE NIL :OVERRIDE-FORCING NIL)
22: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP "mahogany") [fast-method]
23: (ASDF/OPERATE:LOAD-SYSTEM "mahogany")
24: (SB-INT:SIMPLE-EVAL-IN-LEXENV (ASDF/OPERATE:LOAD-SYSTEM "mahogany") #<NULL-LEXENV>)
25: (EVAL (ASDF/OPERATE:LOAD-SYSTEM "mahogany"))
26: (SB-IMPL::PROCESS-EVAL/LOAD-OPTIONS ((:EVAL . "(require :asdf)") (:EVAL . #<(SIMPLE-ARRAY CHARACTER (257)) (asdf:initialize-source-registry (list :source-registry (list :tree (uiop:ensure-pathname "/gnu/store/3k6y3hmgi56mckmaxnlrkdmnx2dk6c9f-mahogany-0.0.0-0.e2c03d2-lib/share/common-lisp/sbcl/mahogany" :tr... {100B09D5CF}>) (:EVAL . "(asdf:load-system \"mahogany\")") (:QUIT)))
27: (SB-IMPL::TOPLEVEL-INIT)
28: ((FLET SB-UNIX::BODY :IN SB-IMPL::START-LISP))
29: ((FLET "WITHOUT-INTERRUPTS-BODY-3" :IN SB-IMPL::START-LISP))
30: (SB-IMPL::%START-LISP)

unhandled condition in --disable-debugger mode, quitting
;
; compilation unit aborted
;   caught 1 fatal ERROR condition
;   caught 1 WARNING condition

The full log is available as a GitHub Gist here

sdilts commented 1 year ago

Well, that's an interesting error. I guess we need to explicitly return (values) to denote a function that returns nothing? I'll admit this is part of the CL type system I know little about, but I would have guessed that a function that always returns nil was the same as a function that returns nothing.

That looks to be a newer version of SBCL than is used in the pipeline, which is why it passed the last time it ran, but failed to build this time.

PuercoPop commented 1 year ago

Afaiu nil and (values) are distinct. The problem is that in LOG-STRING the coee passes stream-fn a function that returns nil but the type of that function is declared as (function (stream) (values &optional))

One could either add (values) after the format call or update the ftype to have null as its return type

KarlJoad commented 1 year ago

To help catch things like this earlier, I can add a package definition for Mahogany so people can do cd mahogany && guix build -f ./guix.scm. That could be run in CI too (I'm not sure how, but I feel it should be possible.)

sdilts commented 1 year ago

@KarlJoad, that would be appreciated! It looks like there are a couple of ways to get Guix working in a CI environment.