IRC channel logs


back to list of logs

***Raimondii is now known as Raimondi
***Raimondii is now known as Raimondi
<chris3>I've checked manual and don't think I've seen it - anyone knows if it's possible to retrieve the full path+filename for an imported module source code?
<chris3>e.g (use-modules (srfi srfi-1)) - wish to retrieve path to srfi-1.scm
<chris3>alternatively how to find the exact filename containing code for an exported definition
<chris3>because I'm doing coverage analysis and need to (add-to-load-path "/my/home/computer/modules") which is not elegant
<chris3>so ideally something like (set! filepath (and (defined? 'my-function) (source-location 'my-function))) would store "/home/mycomputer/guilecode/module.scm" in filepath
<mwette> maybe dig into the Guile module tree and chase down the implementation of `reload-module'
<mwette>it's in boot-9.scm
<mwette>haha: (module-filename (resolve-module '(srfi srfi-1))) => "srfi/srfi-1.scm"
<mwette>"haha" meaning "not super useful"
<mwette>I meant "ice-9.scm"
<mwette>er ice-9/boot-9.scm
<mwette>it looks like you may need to search %load-path in order
<chris3>mwette thank you, looks like need to hard-code unfortunately
<daviid>chris3: (dirname (search-path %load-path "srfi/"))
<dadinn>hi all
<dadinn>question: how do I call a subprocess with system/system* interactively so I can respond to prompts? it seems by default it just ignores any prompts, therefore the calls fail
<dadinn>another problem I have encountered is that `use-modules` doesn't work according to docs.
<dadinn>I cannot use keys #:prefix and #:select consecutively. E.g. (use-modules ((local utils) #:select (println) #:prefix utils:)) would be invalid. I have to use (use-modules ((local utils) #:select (println)) ((local utils) #:prefix utils:))
<dadinn>Honestly, quite shocking to see such bugs in such core infrastructure :/
<mwette>dadinn: I can't duplicate your behavior. What version of guile are you using?
<mwette>for example, `(use-modules ((ice-9 pretty-print) #:select (pretty-print) #:prefix pp:))' seems to work fine
<mwette>It provides `pp:pretty-print' as expected.
<dadinn>mwette: the version is 2.0.13+1-4
<dadinn>mwette: also, I thought #:select imports the symbol without applying the prefix, while everything else is through using the prefix... no?
<dadinn>mwette: otherwise #:select doesn't make sense
<mwette>dadinn: no: select chooses what you import; prefix sets a prefix for all those imported identifiers
<mwette>dadinn: if you want to selectively add a prefix use #:renamer
<ArneBab>dadinn: select limits the symbols you get to just the ones you select. Think of it as "select only".
<mwette>daddinn: I always do (use-modules ((sxml xpath) #:renamer (lambda (s) (if (eq? s 'filter) 'node-filter s))))
<ArneBab>I nowadays mostly use (import (only (ice-9 pretty-print) pretty-print)), but without renaming or prefixing.
<ArneBab>(so this is not quite the same)
<manumanumanu>dadinn: I also can't duplicate that, neither on guile 2.0 nor 2.2. How does your module look?
<dadinn>manumanumanu: (use-modules
<dadinn> ((local utils) #:prefix utils:)
<dadinn> ((local utils) #:select (println process->string))
<dadinn> (ice-9 hash-table)
<dadinn> (ice-9 readline)
<dadinn> (ice-9 regex)
<dadinn> (ice-9 popen))
<manumanumanu>no, I meant the local utils
<manumanumanu>how is the module defined?
<dadinn>manumanumanu: shit, you are right, println is not in the exports :P
<manumanumanu>haha! :D I have done that kind of error sooooo many times
<dadinn>yeah, it seems to be working fine :)
<dadinn>manumanumanu: testing it more, it seems I won't get any relevant error message in case utils fails to compile for some reason
<manumanumanu>for the repl or for scripts?
<dadinn>manumanumanu: is there a way to separately compile a single file?
<manumanumanu>I have had some problems with modules that (load ...) other files
<manumanumanu>but for modules, i do a ,reload (local utils)
<dadinn>`guile -l utils.scm` jumps to repl, so it is not good for just compiling a module to see if it has errors
<manumanumanu>import the module from the repl instea
<mwette>To compile a module you can run "guile -c '(use-modules (local utils))' to get errors.
<mwette>guild compile local/utils.scm also works but does not catch all errors
<shymega>Hi, I've been having trouble compiling GNUCash on my Gentoo system. The issue seems to be Guile misreading the target instruction set, which causes the build to fail. The log from Portage is here:
<shymega>I'm not sure how to proceed, Guile works fine on my AMD processor, but on my laptop, which uses an Ivy Bridge processor (Intel), it fails.
<ArneBab>shymega: is this a new Gentoo install?
<ArneBab>shymega: how did you install Guile?
<ArneBab>what is guile --version
<shymega>ArneBab: Its a fairly new install, not that old, and I can't remember if I installed Guile myself, or if it got pulled in as a dep.
<shymega>Version is: guile (GNU Guile) 2.2.3
<ArneBab>so it’s fairly up to date
<shymega>it doesn't have the issue, with the same Guile version on my AMD machine though.
<shymega>which makes it particularly weird, but it does tie in with the machine instruction set error.
<ArneBab>can you try to run it with MAKEOPTS="-j1" emerge … to ensure that we can be sure of the real first error?
<shymega>sure :) that is, to compile GNUcash right?
<shymega>just trying that now with GNUCash.
<ArneBab>I’m on Gentoo myself, but my setup has been more or less broken for the past year, so I can’t give you up to date info
<shymega>Same result, crashed with "illegal instruction".
<ArneBab>that was when trying t create guild, right?
<shymega>with MAKEOPTS="-j1"
<ArneBab>(guild is the Guile module compiler)
<shymega>can't see it in the logs..
<shymega>oh, derp
<ArneBab>;;; compiling /usr/bin/guild
<ArneBab>;;; WARNING: compilation of /usr/bin/guild failed:
<ArneBab>;;; failed to create path for auto-compiled file "/usr/bin/guild"
<shymega>i did it with my Git checkout
<shymega>no, i don't get that error
<shymega>i get a warning about GUILE_AUTO_COMPILE
<ArneBab>it’s in the log you linked to
<ArneBab>directly before the illegal instruction
<shymega>sorry, i'm a bit tired today and not with it :P
<ArneBab>no probs … I know that feeling all too well
<shymega>i did my compilation with the git checkout, and not through portage... .. >_<, so gimme a few minutes, i'll just wait for Portage to do its thing
<shymega>sorry! :P
<shymega>again, not with it
<ArneBab>ok, thanks for checking again!