Difference between trace behavior in guix repl and guile

  • Open
  • quality assurance status badge
Details
4 participants
  • 45mg
  • Adriel Dumas--Jondeau
  • Maxim Cournoyer
  • Suhail Singh
Owner
unassigned
Submitted by
Adriel Dumas--Jondeau
Severity
normal

Debbugs page

Adriel Dumas--Jondeau wrote 1 years ago
(address . bug-guix@gnu.org)
8734uaq1cb.fsf@disroot.org
Here's what's happening in a guix repl:

```
(guix-user)> ,use (guix scripts build)
(guix-user)> ,trace (guix-build "hello") ; doesn't output any trace for some reason
```

And here'the same for a guile repl:

```
(guile-user)> ,use (guix scripts build)
(guile-user)> ,trace (guix-build "hello") ; however it does work
trace: | (guix-build "hello")
trace: | | (_ (guix scripts) #:ensure #f)
trace: | | (_ #<procedure 7ff4802c5000 at ice-9/boot-9.scm:3241:7 ()>)
trace: | | | (lock-mutex #<mutex 7ff487d01fc0>)
...
```

This was observed during a working group on profiling during the Guix Days.

--
Adriel
-----BEGIN PGP SIGNATURE-----

iQHHBAEBCAAxFiEEdTo3gYfn+XlCL0s3vM4s3nSoxFIFAmW9F7QTHGxlaXJkYUBk
aXNyb290Lm9yZwAKCRC8zizedKjEUvNtDACU4O0UIu5YuMLDIOCmmlWjBaFxOIHX
rm3E2BlN4Ty3go35eKLcKbGH6tbhtcAhvu+aaV4M0qb0vx/Kqe63+0RwKYEHi2Cg
z41hvAOPawxZGoo4oohTkL7XoqaNYW736LcFEDuPRK2b5/RgXvw4PqrxwFa4ycb0
uAteuEOQCBGwfqoa9iJnn6lOQ3/F5HhX5zGSDumZOifK5naEhAA/RZiZp5W+qrlh
6P1BM2oGSy4rMLWNUY7lh4RJs25MrG+/YzT32yG+b7G/GSaqtRfONdal/NGi2H0p
fbDsQnjkYOGUqvXrrdBJjuYfj8y3gem8rvLeKdzRy9cc5ZLMvD7HtswVfw7cy6Vl
QbNtl7AyhD8ygFBrL0pSAwvAj7dQpV7uU/Yz0zqgQCQpVP4iZf0spgdmUGTgSf4N
5f+Vja1pLcyksfMukJ8D2HRu4YprENDRQ7MYKPum3/rcuNphLsTAPMETcgAwrdEE
bubolPT0njiz8rx5qsfnInej8eY3d+7Vv/w=
=nD7m
-----END PGP SIGNATURE-----

45mg wrote 2 months ago
Re: bug#68895: `guix repl` breaks Guile REPL features
87zfk6h1wx.fsf@gmail.com
Adriel Dumas--Jondeau <leirda@disroot.org> writes:

Toggle quote (3 lines)
> (guix-user)> ,use (guix scripts build)
> (guix-user)> ,trace (guix-build "hello") ; doesn't output any trace for some reason

It looks like this isn't the only REPL command that doesn't work in
`guix repl`. I haven't done anything close to a full investigation (I am
new to using Guile!), but many other commands simply don't work.

For example, breakpoints are not respected.
`guix repl`:
Toggle snippet (6 lines)
scheme@(guix-user)> (define (my-f x) (+ x 1))
scheme@(guix-user)> ,break my-f
Trap 0: Breakpoint at #<procedure my-f (x)>.
scheme@(guix-user)> (my-f 2)
$1 = 3
`guile`:
Toggle snippet (7 lines)
scheme@(guix-user)> (define (my-f x) (+ x 1))
scheme@(guix-user)> ,break my-f
Trap 0: Breakpoint at #<procedure my-f (x)>.
scheme@(guix-user)> (my-f 2)
$1 = 3

Neither are tracepoints.
`guix repl`:
Toggle snippet (6 lines)
scheme@(guix-user)> (define (my-f x) (+ x 1))
scheme@(guix-user)> ,tracepoint my-f
Trap 0: Tracepoint at #<procedure my-f (x)>.
scheme@(guix-user)> (my-f 2)
$1 = 3
`guile`:
Toggle snippet (8 lines)
scheme@(guile-user)> (define (my-f x) (+ x 1))
scheme@(guile-user)> ,tracepoint my-f
Trap 0: Tracepoint at #<procedure my-f (x)>.
scheme@(guile-user)> (my-f 2)
Trap 0: (my-f 2)
Trap 0: 3
$1 = 3
Suhail Singh wrote 2 months ago
(name . 45mg)(address . 45mg.writes@gmail.com)
87septtjp2.fsf@gmail.com
45mg <45mg.writes@gmail.com> writes:

Toggle quote (4 lines)
> It looks like this isn't the only REPL command that doesn't work in
> `guix repl`. I haven't done anything close to a full investigation (I am
> new to using Guile!), but many other commands simply don't work.

Thank you for your investigation. I am cc-ing guix-devel in case they
have insight regarding these.

--
Suhail
Suhail Singh wrote 2 months ago
Re: bug#68895: Difference between trace behavior in guix repl and guile
(name . Suhail Singh)(address . suhailsingh247@gmail.com)
87o70htjiv.fsf_-_@gmail.com
Suhail Singh <suhailsingh247@gmail.com> writes:

Toggle quote (7 lines)
>> It looks like this isn't the only REPL command that doesn't work in
>> `guix repl`. I haven't done anything close to a full investigation (I am
>> new to using Guile!), but many other commands simply don't work.
>
> Thank you for your investigation. I am cc-ing guix-devel in case they
> have insight regarding these.

Whoops, sent too quickly. Current (probably inexhaustive) list:

- trace
- tracepoint
- break

--
Suhail
Maxim Cournoyer wrote 2 months ago
(name . Suhail Singh)(address . suhailsingh247@gmail.com)
87bjw0s17c.fsf@gmail.com
Hello,

Suhail Singh <suhailsingh247@gmail.com> writes:

Toggle quote (15 lines)
> Suhail Singh <suhailsingh247@gmail.com> writes:
>
>>> It looks like this isn't the only REPL command that doesn't work in
>>> `guix repl`. I haven't done anything close to a full investigation (I am
>>> new to using Guile!), but many other commands simply don't work.
>>
>> Thank you for your investigation. I am cc-ing guix-devel in case they
>> have insight regarding these.
>
> Whoops, sent too quickly. Current (probably inexhaustive) list:
>
> - trace
> - tracepoint
> - break

Perhaps Guix configures Guile to use the no-debug VM even for the REPL?
Se the '--no-debug' documentation in info '(guile) Command-line
Options':

‘--debug’
Start with the debugging virtual machine (VM) engine. Using the
debugging VM will enable support for VM hooks, which are needed for
tracing, breakpoints, and accurate call counts when profiling. The
debugging VM is slower than the regular VM, though, by about ten
percent. *Note VM Hooks::, for more information.

By default, the debugging VM engine is only used when entering an
interactive session. When executing a script with ‘-s’ or ‘-c’,
the normal, faster VM is used by default.

Indeed, if you look at the shebang of scripts/guix.in, which is the
template for the 'guix' entry point script, it uses the '-s' argument.

I'm not sure if there's a way to enable the debug VM after Guile was
started in the equivalent of --no-debug.

--
Thanks,
Maxim
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 68895@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 68895
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help