***X-Scale` is now known as X-Scale
***janneke_ is now known as janneke
<sgssgene>Hey, I'm trying to contribute to libfive-studio which uses guile. It takes a user input (script) and runs it in an sandbox. <sgssgene> auto result = scm_call_1(scm_eval_sandboxed, <sgssgene> scm_from_locale_string(script.toLocal8Bit().data())); <sgssgene>Now it can (obviously) happen that `script` is malformed, not a valid scheme program. This causes basically causes that a function `sandbox-backtrace stack` is being called where `(define stack (make-stack #t))`. <sgssgene>What I would like to do is to get the line number of the individual parts of the stack that involve my error. I have already sliced out the frames of the stack concerning my script. But it is unclear to me <sgssgene>how I can retrieve the line number from the stack (retrieving filename seems easy with `frame-source`, but I can't figure out how to get the fileline. Can someone give me anyhints? <tohoyn>are there any plans to fix statprof so that "cumulative seconds" works correctly for recursive functions, too? <wingo>tohoyn: what would that mean? :) <wingo>kcachegrind for example has the same behavior as guile <tohoyn>wingo: if we have a procedure PROC the cumulative time is the total time spent in PROC and all the procedures it calls <tohoyn>wingo: perhaps we could have both ***apteryx_ is now known as apteryx
<tohoyn>wingo: I mean both kinds of cumulative times <wingo>it is certainly possible to do; the analysis happens after the profile <tohoyn>wingo: can you give some hints how that could be done? <wingo>i would suggest opening module/statprof.scm and reading from top to bottom. statprof enables a signal that is fired by the OS after a bit of time has elapsed. when it fires, statprof takes a sample of the entire stack. <wingo>when statprof stops, it analyzes those samples to map the stack frames to function names and locations <tohoyn>wingo: so basically we should check if different stack frames belong to the same procedure? ***X-Scale` is now known as X-Scale
***leoprikler_ is now known as leoprikler
***edcragg0 is now known as edcragg
<apteryx>does someone know how to specify an exact error condition with (srfi srfi-64) and Guile? <apteryx>I want to catch such codition: &store-protocol-error message: "build of `/gnu/store/n9a8lqx0gaxkd5hrfmrcw5pjdsaccvlw-python-dummy-fail-console-script-0.drv' failed" status: 100 <apteryx>hm, perhaps not possible yet. A comment in testing.scm: ;; TODO: decide how to specify expected error types for Guile. <lfam>I still have a gcroot of "/root/.config/guix/latest" <civodul>(not that good tho because "guix pull" was terrible back then) <lfam>I guess it's probably wasting some space on my computer! ***amiloradovsky1 is now known as amiloradovsky
***rekado_ is now known as rekado
<rekado>apteryx: it’s possible, just not with test-error <rekado>apteryx: you can test-equal instead, catch the error yourself and compare it