Re: Help Packaging Incudine (Common Lisp)

2023-10-24 Thread Théo Tyburn
That's interesting. I was also suspicious about this function and mentioned it 
upstream but they said it is normal to do it like this so I just ignored it. 
Also I remember having tried out a dummy package, so I really believed it was 
ok.

Thanks for your help!

On October 23, 2023 10:44:57 AM GMT+02:00, Guillaume Le Vaillant 
 wrote:
>Hi.
>
>It looks like there's a bug in "contrib/cl-sndfile/cffi-sndfile.lisp".
>The 'make-sndinfo' function definition tries to get the size of the
>'info' foreign structure before this foreign structure is defined.
>
>After moving the definition of 'make-sndinfo' at the end of the file,
>compilation works.
>
>I think you can report this issue upstream.



Re: Help Packaging Incudine (Common Lisp)

2023-10-23 Thread Guillaume Le Vaillant
Hi.

It looks like there's a bug in "contrib/cl-sndfile/cffi-sndfile.lisp".
The 'make-sndinfo' function definition tries to get the size of the
'info' foreign structure before this foreign structure is defined.

After moving the definition of 'make-sndinfo' at the end of the file,
compilation works.

I think you can report this issue upstream.


signature.asc
Description: PGP signature


Re: Help Packaging Incudine (Common Lisp)

2023-10-22 Thread Théo Tyburn
Hi, sure. Note that here the installation is narrowed to the asd system
"cl-sndfile". But you could add or replace it by "incudine".

> (define-public sbcl-incudine
>   (let ((commit "21c99e4fe1b152c125a1bc6df915759b46cdab78")
> (revision "1"))
> (package
>  (name "sbcl-incudine")
>  (version (git-version "0.0.0" revision commit))
>  (source
>   (origin
>(method git-fetch)
>(uri (git-reference
>  (url "https://git.code.sf.net/p/incudine/incudine;)
>  (commit commit)))
>(file-name (git-file-name "incudine" version))
>(sha256
> (base32 "1zh17ifb6l8cpj5lzjz218h02c7rhf9khnh0lra3qmxd8dlwhqpa"
>  (build-system asdf-build-system/sbcl)
>(arguments
>   `(#:asd-systems '("cl-sndfile")
>   #:phases
>   (modify-phases
>%standard-phases
>(add-after 'unpack 'fix-paths
>   (lambda* (#:key inputs 
> #:allow-other-keys)
> ;; contrib
> (map (lambda (system-name)
>(substitute* 
> (string-append "contrib/cl-"
>   
>  system-name
>   
>  "/cffi-"
>   
>  system-name
>   
>  ".lisp") 
>   
>   (((string-append "lib" system-name "\\.so"))
>   
>(search-input-file inputs
>   
>   (string-append "/lib/lib"
>   
>  
> system-name
>   
>  
> ".so")
>  '("sndfile" "portmidi"))
> ;; foreign
> (map (lambda (system-name)
>(substitute* 
> (string-append "src/foreign.lisp") 
>   
>   (((string-append "lib" system-name "\\.so"))
>   
>(search-input-file inputs
>   
>   (string-append "/lib/lib"
>   
>  
> system-name
>   
>  
> ".so")
>  '("fftw3" "gslcblas" "gsl" 
> ""))
> )
>  (inputs
>   (list sbcl-alexandria sbcl-bordeaux-threads sbcl-cffi sbcl-swap-bytes
>   sbcl-trivial-garbage
>   ;; pthread
>   ;; jack
>   portmidi
>   libsndfile
>   ;; fftw
>   gsl
>   ;; fluidsynth
>   ;; lilv
>   ))
>  (home-page "https://incudine.sourceforge.net;)
>  (synopsis "Music/DSP programming environment for Common Lisp")
>  (description
>   "Incudine is useful to design software synthesizers or sound plugins 
> from scratch, exploiting the expressive power of Common Lisp, without the 
> constraint to use pre-built unit generators. It is also a compositional tool 
> that allows to produce high quality sounds controllable at the sample level, 
> defining and redefining the digital signal processors and the musical 
> structures on-the-fly. ")
>  (license license:bsd-2

Guillaume Le Vaillant  writes:

> [[PGP Signed Part:Undecided]]
> Hi.
> Could you send the package definition you made for Incudine?
> I could take a look at it and try to find where the issue comes from.
>
> [[End of PGP Signed Part]]




Re: Help Packaging Incudine (Common Lisp)

2023-10-22 Thread Guillaume Le Vaillant
Hi.
Could you send the package definition you made for Incudine?
I could take a look at it and try to find where the issue comes from.


signature.asc
Description: PGP signature


Re: Help Packaging Incudine (Common Lisp)

2023-09-30 Thread Théo Tyburn


Liliana Marie Prikler  writes:

> Am Donnerstag, dem 28.09.2023 um 12:23 + schrieb Théo Tyburn:
>> Oh, it seems I took the WARNING message for an ERROR message.
>> 
>> The error message seems to just be:
>> > Unhandled UIOP/LISP-BUILD:COMPILE-FILE-ERROR in thread #> > THREAD:THREAD tid=21 "main thread" RUNNING
>> > 
>> > {100AFE8113}>:
>> >  COMPILE-FILE-ERROR while
>> >  compiling #
>> 
>> No sure what can be done with this.
> Note that this error doesn't tell you where CL would have written the
> compiled file to.
>
> Am Donnerstag, dem 28.09.2023 um 14:21 + schrieb Théo Tyburn:
>> Not sure in what retrying a compilation on the interactive debugger
>> is different from compiling normally. But I need to understand why
>> the retrying of compilation does in order to replicate it without the
>> need of an interactive session.
> I'd hazard a guess that your $HOME is writable in the interactive case
> and not so much during guix build :)
> Well, that still doesn't explain why the compilation fails normally in
> the interactive case, does it?  I think for that you'd have to look up
> uiop/lisp-build:compile-file and see when it raises errors.  Enter
> rubber ducky.

Yes, that's probably the right place to look for hints. Need to find out
where and how compiled files are written.

Thanks



Re: Help Packaging Incudine (Common Lisp)

2023-09-28 Thread Liliana Marie Prikler
Am Donnerstag, dem 28.09.2023 um 12:23 + schrieb Théo Tyburn:
> Oh, it seems I took the WARNING message for an ERROR message.
> 
> The error message seems to just be:
> > Unhandled UIOP/LISP-BUILD:COMPILE-FILE-ERROR in thread # > THREAD:THREAD tid=21 "main thread" RUNNING
> > 
> > {100AFE8113}>:
> >  COMPILE-FILE-ERROR while
> >  compiling #
> 
> No sure what can be done with this.
Note that this error doesn't tell you where CL would have written the
compiled file to.

Am Donnerstag, dem 28.09.2023 um 14:21 + schrieb Théo Tyburn:
> Not sure in what retrying a compilation on the interactive debugger
> is different from compiling normally. But I need to understand why
> the retrying of compilation does in order to replicate it without the
> need of an interactive session.
I'd hazard a guess that your $HOME is writable in the interactive case
and not so much during guix build :)
Well, that still doesn't explain why the compilation fails normally in
the interactive case, does it?  I think for that you'd have to look up
uiop/lisp-build:compile-file and see when it raises errors.  Enter
rubber ducky.

Cheers



Re: Help Packaging Incudine (Common Lisp)

2023-09-28 Thread Théo Tyburn
For some weird reasons I manage to compile this reluctant file in an
interactive session by accepting the error in the debugger and retrying
compilation later on when the compiled file is required.

Not sure in what retrying a compilation on the interactive debugger is
different from compiling normally. But I need to understand why the
retrying of compilation does in order to replicate it without the need
of an interactive session.

Here are the logs:
This is the first error where where I accept:

> ASDF could not load incudine because
> COMPILE-FILE-ERROR while
> compiling # "cffi-sndfile">.
> While evaluating the form starting at line 3, column 0
>   of #P"/home/teddd/src/music/incudine/require.lisp":

> debugger invoked on a UIOP/LISP-BUILD:COMPILE-FILE-ERROR in thread
> #:
>   COMPILE-FILE-ERROR while
>   compiling # "cffi-sndfile">

> Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

> restarts (invokable by number or by possibly-abbreviated name):
>   0: [RETRY] Retry
>  compiling # "incudine" "contrib/cl-sndfile" "cffi-sndfile">.
>   1: [ACCEPT   ] Continue, treating
>  compiling # "incudine" "contrib/cl-sndfile" "cffi-sndfile">
>  as having been successful.
>   2: Retry ASDF operation.
>   3: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the
>  configuration.
>   4: Retry ASDF operation.
>   5: Retry ASDF operation after resetting the
>  configuration.
>   6: [RETRY] Retry EVAL of current toplevel form.
>   7: [CONTINUE ] Ignore error and continue loading file 
> "/home/teddd/src/music/incudine/require.lisp".
>   8: [ABORT] Abort loading file 
> "/home/teddd/src/music/incudine/require.lisp".
>   9: Ignore runtime option --load 
> "require.lisp".
>  10: Skip rest of --eval and --load options.
>  11: Skip to toplevel READ/EVAL/PRINT loop.
>  12: [EXIT ] Exit SBCL (calling #'EXIT, killing the 
> process).

> (UIOP/LISP-BUILD:CHECK-LISP-COMPILE-RESULTS NIL T T 
> "~/asdf-action::format-action/" ((# . 
> # "cffi-sndfile">)))
> ; File has been modified since compilation:
> ;   SYS:CONTRIB;ASDF;ASDF.LISP.NEWEST
> ; Using form offset instead of character position.

>source: (ERROR 'COMPILE-FILE-ERROR :CONTEXT-FORMAT CONTEXT-FORMAT
>   :CONTEXT-ARGUMENTS CONTEXT-ARGUMENTS)
> 0] 1

Then comes the second error where I retry compilation:

> ASDF could not load incudine because
> Couldn't load
> #P"/home/teddd/.cache/common-lisp/sbcl-2.3.5-linux-x64/home/teddd/src/music/incudine/contrib/cl-sndfile/cffi-sndfile.fasl":
> file does not exist..
> While evaluating the form starting at line 3, column 0
>   of #P"/home/teddd/src/music/incudine/require.lisp":

> debugger invoked on a SB-INT:SIMPLE-FILE-ERROR in thread
> #:
>   Couldn't load
>   
> #P"/home/teddd/.cache/common-lisp/sbcl-2.3.5-linux-x64/home/teddd/src/music/incudine/contrib/cl-sndfile/cffi-sndfile.fasl":
>   file does not exist.

> Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

> restarts (invokable by number or by possibly-abbreviated name):
>   0: [TRY-RECOMPILING  ] Recompile cffi-sndfile and try loading 
> it again
>   1: [RETRY] Retry loading FASL for
>#.
>   2: [ACCEPT   ] Continue, treating loading FASL for
>#
>  as having been successful.
>   3: Retry ASDF operation.
>   4: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the
>  configuration.
>   5: Retry ASDF operation.
>   6: Retry ASDF operation after resetting the
>  configuration.
>   7: [RETRY] Retry EVAL of current toplevel form.
>   8: [CONTINUE ] Ignore error and continue loading file 
> "/home/teddd/src/music/incudine/require.lisp".
>   9: [ABORT] Abort loading file 
> "/home/teddd/src/music/incudine/require.lisp".
>  10: Ignore runtime option --load 
> "require.lisp".
>  11: Skip rest of --eval and --load options.
>  12: Skip to toplevel READ/EVAL/PRINT loop.
>  13: [EXIT ] Exit SBCL (calling #'EXIT, killing the 
> process).

> (LOAD 
> 

Re: Help Packaging Incudine (Common Lisp)

2023-09-28 Thread Théo Tyburn
Oh, it seems I took the WARNING message for an ERROR message.

The error message seems to just be:
> Unhandled UIOP/LISP-BUILD:COMPILE-FILE-ERROR in thread # tid=21 "main thread" RUNNING
>  {100AFE8113}>:
>  COMPILE-FILE-ERROR while
>  compiling #

No sure what can be done with this.

I include the whole backlog, maybe this helps:

> Invoking sbcl:
> "/gnu/store/pp8pa2gl73gdn7vazjih16px7r28hqv0-sbcl-2.3.5/bin/sbcl"
> "--non-interactive" "--eval" "(require :asdf)" "--eval"
> "(asdf:initialize-source-registry (list :source-registry (list :tree
> (uiop:ensure-pathname
> \"/gnu/store/g8g7v4dvdylv2n6kjixgyxxsmgaqa5ka-sbcl-incudine-0.0.0-1.21c99e4/share/common-lisp/sbcl/incudine\"
> :truenamize t :ensure-directory t)) :inherit-configuration))"
> "--eval" "(asdf:load-system \"cl-sndfile\")"
> This is SBCL 2.3.5, an implementation of ANSI Common Lisp.
> More information about SBCL is available at .

> 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/g8g7v4dvdylv2n6kjixgyxxsmgaqa5ka-sbcl-incudine-0.0.0-1.21c99e4/share/common-lisp/sbcl/incudine/contrib/cl-sndfile/package.lisp"
> (written 01 JAN 1970 12:00:00 AM):

> ; wrote
> /gnu/store/g8g7v4dvdylv2n6kjixgyxxsmgaqa5ka-sbcl-incudine-0.0.0-1.21c99e4/lib/common-lisp/sbcl/incudine/contrib/cl-sndfile/package-tmpGHU3ALSV.fasl
> ; compilation finished in 0:00:00.004
> ; compiling file
> "/gnu/store/g8g7v4dvdylv2n6kjixgyxxsmgaqa5ka-sbcl-incudine-0.0.0-1.21c99e4/share/common-lisp/sbcl/incudine/contrib/cl-sndfile/error.lisp"
> (written 01 JAN 1970 12:00:00 AM):

> ; wrote
> /gnu/store/g8g7v4dvdylv2n6kjixgyxxsmgaqa5ka-sbcl-incudine-0.0.0-1.21c99e4/lib/common-lisp/sbcl/incudine/contrib/cl-sndfile/error-tmpAAURSO1.fasl
> ; compilation finished in 0:00:00.008
> ; compiling file
> "/gnu/store/g8g7v4dvdylv2n6kjixgyxxsmgaqa5ka-sbcl-incudine-0.0.0-1.21c99e4/share/common-lisp/sbcl/incudine/contrib/cl-sndfile/cffi-sndfile.lisp"
> (written 01 JAN 1970 12:00:00 AM):

> ; file:
> /gnu/store/g8g7v4dvdylv2n6kjixgyxxsmgaqa5ka-sbcl-incudine-0.0.0-1.21c99e4/share/common-lisp/sbcl/incudine/contrib/cl-sndfile/cffi-sndfile.lisp
> ; in: DEFUN MAKE-SNDINFO
> ; (CFFI:FOREIGN-TYPE-SIZE '(:STRUCT SNDFILE:INFO))
> ; 
> ; caught WARNING:
> ;   Error during compiler-macroexpansion of
> ;   (CFFI:FOREIGN-TYPE-SIZE '(:STRUCT INFO)). Use *BREAK-ON-SIGNALS* to 
> intercept.
> ;   
> ;Unknown CFFI type (:STRUCT INFO)


> ; wrote 
> /gnu/store/g8g7v4dvdylv2n6kjixgyxxsmgaqa5ka-sbcl-incudine-0.0.0-1.21c99e4/lib/common-lisp/sbcl/incudine/contrib/cl-sndfile/cffi-sndfile-tmp5GEXGEG5.fasl
> ; compilation finished in 0:00:00.152
> Unhandled UIOP/LISP-BUILD:COMPILE-FILE-ERROR in thread # tid=21 "main thread" RUNNING
>   {100AFE8113}>:
>   COMPILE-FILE-ERROR while
>   compiling #

> Backtrace for: #
> 0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK # {10056B7423}> # :QUIT T)1: (SB-DEBUG::RUN-HOOK 
> *INVOKE-DEBUGGER-HOOK* #)
> 2: (INVOKE-DEBUGGER #)
> 3: (ERROR UIOP/LISP-BUILD:COMPILE-FILE-ERROR :CONTEXT-FORMAT 
> "~/asdf-action::format-action/" :CONTEXT-ARGUMENTS 
> ((# . # "cl-sndfile" "cffi-sndfile">)))
> 4: (UIOP/LISP-BUILD:CHECK-LISP-COMPILE-RESULTS NIL T T 
> "~/asdf-action::format-action/" ((# . 
> #)))
> 5: ((SB-PCL::EMF ASDF/ACTION:PERFORM) # # 
> # # "cl-sndfile" "cffi-sndfile">)
> 6: ((LAMBDA NIL :IN ASDF/ACTION:CALL-WHILE-VISITING-ACTION))
> 7: ((:METHOD ASDF/ACTION:PERFORM-WITH-RESTARTS :AROUND (T T)) 
> # # "cl-sndfile" "cffi-sndfile">) [fast-method]
> 8: ((:METHOD ASDF/PLAN:PERFORM-PLAN (T)) # {1004CC5AC3}>) [fast-method]
> 9: ((FLET SB-C::WITH-IT :IN SB-C::%WITH-COMPILATION-UNIT))
> 10: ((:METHOD ASDF/PLAN:PERFORM-PLAN :AROUND (T)) # {1004CC5AC3}>) [fast-method]
> 11: ((:METHOD ASDF/OPERATE:OPERATE (ASDF/OPERATION:OPERATION 
> ASDF/COMPONENT:COMPONENT)) # # "cl-sndfile"> :PLAN-CLASS NIL :PLAN-OPTIONS NIL) [fast-method]
> 12: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) # # 
> # #)
> 13: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
> 14: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) # > #) [fast-method]
> 15: ((SB-PCL::EMF ASDF/OPERATE:OPERATE) # # 
> ASDF/LISP-ACTION:LOAD-OP "cl-sndfile")
> 16: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
> 17: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP 
> "cl-sndfile") [fast-method]
> 18: (ASDF/SESSION:CALL-WITH-ASDF-SESSION # ASDF/OPERATE:OPERATE) {100454AFAB}> :OVERRIDE T :KEY NIL :OVERRIDE-CACHE T 
> :OVERRIDE-FORCING NIL)
> 19: ((LAMBDA NIL :IN ASDF/OPERATE:OPERATE))
> 20: (ASDF/SESSION:CALL-WITH-ASDF-SESSION # ASDF/OPERATE:OPERATE) {10034DA56B}> :OVERRIDE NIL :KEY NIL :OVERRIDE-CACHE 
> NIL :OVERRIDE-FORCING NIL)
> 21: ((:METHOD ASDF/OPERATE:OPERATE :AROUND (T T)) ASDF/LISP-ACTION:LOAD-OP 
> "cl-sndfile") 

Help Packaging Incudine (Common Lisp)

2023-09-26 Thread Théo Tyburn
Hi there,

I'm trying to package Incudine, a Music/DSP programming environment for
Common Lisp. I'm stuck with the binding of libsndfile. First
libsndfile.so could not be found, but I fixed the paths like it is
commonly done in other CL packages. Next problem is that somehow the
bindings are not working. The error I get:

> file: 
> /gnu/store/s2657snmavhsnqyr0hf6f8a2v1lvrln2-sbcl-incudine-0.0.0-1.21c99e4/share/common-lisp/sbcl/incudine/contrib/cl-sndfile/cffi-sndfile.lisp
> in: DEFUN MAKE-SNDINFO
> (CFFI:FOREIGN-TYPE-SIZE '(:STRUCT SNDFILE:INFO))
> 
> caught WARNING:
>   Error during compiler-macroexpansion of
>   (CFFI:FOREIGN-TYPE-SIZE '(:STRUCT INFO)). Use *BREAK-ON-SIGNALS* to 
> intercept.
>   
>Unknown CFFI type (:STRUCT INFO)

Now in the source file `cffi-sndfile.lisp`, there is:

> (declaim (inline make-sndinfo))
> (defun make-sndinfo ( pointer)
>   (%make-sndinfo
> :pointer (or pointer
>  (cffi:foreign-alloc :int8
>:count (cffi:foreign-type-size '(:struct info))
>:initial-element 0
> 
> [...]
> 
> (cffi:defcstruct info
>   (frames sf-count)
>   (sample-rate :int)
>   (channels :int)
>   (format :int)
>   (sections :int)
>   (seekable :int))

If I look at the source `sndfile.h` (which is present in source/.cl-union)
there is:

> struct SF_INFO
> { sf_count_t  frames ;/* Used to be called samples.  
> Changed to avoid confusion. */
>   int samplerate ;
>   int channels ;
>   int format ;
>   int sections ;
>   int seekable ;
> } ;

So things look like they should match. Is there something I'm missing
here? I have 0 experience with CFFI bindings, so there might be
something obvious I'm missing.

Cheers

Théo