IRC channel logs

2022-06-02.log

back to list of logs

<lechner>Hi, what's the option to 'git format-patch' that includes the commit hash, please? (or was it --full-index) I saw it mentioned somewhere but can no longer find it in the docs. https://guix.gnu.org/manual/en/html_node/Submitting-Patches.html
<rekado>lechner: do you mean “--base=auto”?
<lechner>rekado: Hi, yes! Although i ended up using --base=master. In view of your email about -mentors I wonder if you know anyone who might help with this proposed patch, please http://ix.io/3Z9E
<lechner>Hi, that one was for Linux PAM. For anyone wishing to help, why wait for -mentors? Here is another upgrade, for nyacc http://ix.io/3Z9K
<lechner>Hi, I created 'handle' via 'scm_from-pointer()' in C. How can I use that value in Guile with a foreign-library-function that expects a POINTER_P, please? I also tried (scm->pointer ...) http://ix.io/3Z9X
<lechner>Hi, I used the seemingly somewhat internal 'scm_mkfromstrs' to create an SCM list of SCM strings from the standard C combination of (int argc, char **argc). Is there a function that can do the reverse?
<rekado>lechner: have you sent these to guix-patches yet?
<stis>Hello guilers!
***Sauvin is now known as Furor
<lechner>rekado: thanks! i did now. they are #55762 and #55763, respectively
<lechner>Hi, is this a way to construct and argv-type array of null-terminated strings for consumption by a foreign library function? (argv (scm->pointer (list->array 1 (map string->pointer options))))
<lloda>idk what argv is there you probably want (scm->pointer (array-ref (list->array 1 ...) 0))
<lloda>ie pointer to the first element of the array
<lloda>(scm->pointer array) will give you a pointer to the array struct which is a bunch of stuff you don't want
<lloda>also it'd be easier to use a vector here
<lechner>lloda: thanks!
<lloda>yw
***chris is now known as Guest5860
<lechner>Hi, why does this give ice-9/eval.scm:159:9: Wrong type to apply: "bingo", please? (map string->pointer ("bingo" "bongo"))
<singpolyma>("bingo" "bongo") means to call the string "bingo" as a function with argument "bongo"
<singpolyma>You probably want (list "bingo" "bongo") or the similar '("bingo" "bongo")
<lechner>singpolyma: thanks so much! i am still struggling with the basics
<lechner>Hi, is "literal" in the Guile docs a synonym for "quoted"?
<lechner>Hi, this segfaults for argc > 0, presumably because argv points to an unacceptable place (or to unacceptable pointers). What am I doing wrong, please? http://ix.io/3Zc0
***Guest5860 is now known as chrislck
<lloda>maybe your vector is being collected, not sure
<mwette>lechner: wrt http://ix.io/3Zc0, I think you need to collect the string->pointers into a bytevector (based on the size of your machine) and then pass from bytevector->pointer
<lechner>mwette: thanks!
<lechner>mwette: also, thanks again for the quick fix for linux-pam! now compile-ffi warns for pamc (in the compile phase) ;;; <unknown-location>: warning: possibly unbound variable `pamc_handle_t*' the typedef in C is somewhat unusual in that it includes the asterisk. is that something to worry about?
<lechner>Hi, does Guile provide a helper functionality for build systems to determine the location of the local site directory?
<lechner>mwette: would that involve pointer->bytevector from here? https://www.gnu.org/software/guile/manual/html_node/Void-Pointers-and-Byte-Access.html
<lechner>mwette: or can i directly use bytevector functionality to sidestep any thoughts about endianness? https://www.gnu.org/software/guile/manual/html_node/SRFI_002d4-and-Bytevectors.html
<daviid>lechner: mwette is right, you should look at what guile-gi and g-golf do for those situation - also, you need to keep a reference to the bytevector pointer for the lifetime of the calle
<lechner>daviid: thanks!
<daviid>*for the lifetime of the callee
<lechner>Hi, how may i use the "interface" returned by resolve-interface, please? I get Unbound variable: service:identify (with a prefix)
<daviid>lechner: module-use!
<lechner>daviid: thanks!
<lechner>daviid: my code does not fork. what is the lifetime of a dlopen'ed, shared object, please? I do not think it stores any state
<daviid>lechner: i don't know, my advice is, first, make it work, if it needs to survive thelifetime of the caller, store the pointer in a global, a hash table for example ... out of curioisity, what is the lib you are binding?
<rekado>(PAM?)
<daviid>lechner: here is what g-golf does https://git.savannah.gnu.org/cgit/g-golf.git/tree/g-golf/gi/utils.scm?h=devel#n340
<lechner>daviid: PAM modules. i'll circulate a draft once i have basic functionality
<lechner>Hi, module-use! provokes this error. How to read? Thanks! http://ix.io/3Zeo
<lechner>daviid: thanks for that definition of %gi-pointer-size !
<daviid>lechner: why would service-interface be #f, and in the if, it should be (if service-interface ...), not (if (service-interface
<daviid>*not (if (service-interface) ...)
<daviid>lechner: you also need this https://git.savannah.gnu.org/cgit/g-golf.git/tree/g-golf/support/bytevector.scm?h=devel - snarfed from guile itself ...
<daviid>i have little time to help, sorry
<cwebber>ok, this isn't quite a guile question, it's an autotools question, but it's for a guile project and I'm not sure where's better to ask
<cwebber>I'd like to add something to my .scm file that's like
<cwebber>if this field is true according to autoconf, expand this section of code in the .scm.in
<cwebber>else the other one
<daviid>lechner: you need to use emacs and indent your code better, use geiser will also grseatly help you developing, finally, please use a paste service that renders scheme code and has line numbers
<cwebber>and I'm not quite sure where to figure out how to do this, even though I know it's probablyb very basic m4 stuff
<daviid>lechner: https://paste.debian.net/ or https://paste.centos.org/ would be better for those of us willing to help you ...
<lechner>daviid: "Find the module named name as with resolve-module and return its interface." "When it can’t be found that way either, create an empty module if ensure is true, otherwise return #f." https://www.gnu.org/software/guile/manual/html_node/Module-System-Reflection.html
<cwebber>specifically, the configure.ac already has:
<cwebber>AC_CHECK_FUNC([inotify_init], [AM_CONDITIONAL(HAVE_INOTIFY, true)], [AM_CONDITIONAL(HAVE_INOTIFY, false)])
<cwebber>so i'd like to see if I can expand conditionally in the .scm.in depending on what the value of HAVE_INOTIFY is
<lechner>cwebber: maybe AC_SUBST ? https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/Setting-Output-Variables.html
<lechner>cwebber: make sure the .in is in AC_CONFIG_FILES
<cwebber>lechner: thanks, I'll give it a shot...
<lechner>daviid: thanks! now i get "In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): #<procedure current-module ()>" http://paste.debian.net/1242870
<lechner>daviid: i do use emacs, just in my own way
<daviid>lechner: i don't have time further help now, hope others will shimm in ... good luck
<daviid>mwette: I wonder how difficult it would be, maybe you didthink about that, writing a GObject Introspection 'nyacc/ffi-gi-helper' tool/app that would use your tremendous C skills, nyacc, the ffi-helper ... and write GObject Introspectable typelib, from a C lib/API? they are not here anymore, but str1ng did a minimal typelib for Qt, that they could use using g-golf ... just a thought
<lechner>daviid: thanks for your help today!
<daviid>cwebber: i would (let ((have-inotify @HAVE_INOTIFY@)) ... in your scm.in file, but if the user removes the lib ... you know i guess
<cwebber>daviid: the problem is that it's either importing or not importing things depending on @HAVE_INOTIFY@
<daviid>cwebber: but at autotool expansion, have-notify will be bound to the value 'true' or 'false', which youcn use to condition your runtime scheme code, did i miss something maybe?
<daviid>*will be binded
<lechner>binded?
<daviid>what it right to write 'will be bound'? i wasn't sure...
<daviid>*was it right to write... damn, my kb-fu is fuzzy today :)
<apteryx>is it possible to rename an autoloaded symbol?
<apteryx>also, is there a way to mask autoload warnings (when the library is not found?)
<mwette>daviid: haha, been thinking of cleaning up ffi=helper to generated other back ends. That would need to happen first. (then the FH could generate C api code also.
<daviid>mwette: not sure how difficult it would be, to acheive good practical/working results i mean, but surely not an easy thing, the GI team itself never wrote a complete GI typelib for cairo for example, not sure why ...
<daviid>mwette: fwiw - https://gi.readthedocs.io/en/latest/index.html