Read standard input in `guix repl'

  • Done
  • quality assurance status badge
Details
7 participants
  • Bengt Richter
  • Guillaume Le Vaillant
  • Ludovic Courtès
  • Pierre Neidhardt
  • Christopher Baines
  • Tobias Geerinckx-Rice
  • zimoun
Owner
unassigned
Submitted by
Pierre Neidhardt
Severity
normal
P
P
Pierre Neidhardt wrote on 13 Nov 2020 10:41
(address . bug-guix@gnu.org)
87h7ptzj8t.fsf@ambrevar.xyz
`guix repl` is a fantastic, hassle-free tool to bind Guix with
third-party languages. I've done it here:


It just works!

The only issue is that it needs to be passed a file, so I must create a
temporary file so that I can call `guix repl` on it.

It'd be better if we could send Guile code to the standard input of the
`guix repl -` process to bypass file generation.

Thoughts?

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl+uVNISHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/V7kH/2E/kYNnzILWkQmj5n1T4jeWj/FIVwxu
0w88U3S459RMFI9Wrav+8ZXxlqoL3W+OTQVngJpc+eym0wBCnkQl6c7RrnrFINct
luyOyTLgD6l5iPu+ZssLdD0vyLYjXikRjQtwzDjO0Ls+kQc7tVtRm4Whq+XVW5XJ
3kPqNmJV5P5LkpZJFXE5T5qtxwt1/U7kGztsF7f5tT8O+xuRkGvcRCrkVWytqfy8
WHL+ZL+y+yl2iUZsvUelHHB8Q2FG5/QJ9Lpq3XeTUss4rj+2HdxpgBxXVKLetmwC
EchSnK45CYIPWxAWmq/ogo6dkPznrILnN/oVyN6+vIRnd5CVet06ASM=
=vLIL
-----END PGP SIGNATURE-----

B
B
Bengt Richter wrote on 13 Nov 2020 20:08
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)(address . 44612@debbugs.gnu.org)
20201113190830.GA2995@LionPure
Hi Pierre,

On +2020-11-13 10:41:38 +0100, Pierre Neidhardt wrote:
Toggle quote (16 lines)
> `guix repl` is a fantastic, hassle-free tool to bind Guix with
> third-party languages. I've done it here:
>
> https://github.com/atlas-engineer/nyxt/blob/2-pre-release-4/libraries/ospama/ospama-guix.lisp
>
> It just works!
>
> The only issue is that it needs to be passed a file, so I must create a
> temporary file so that I can call `guix repl` on it.
>
> It'd be better if we could send Guile code to the standard input of the
> `guix repl -` process to bypass file generation.
>
> Thoughts?
>

Would this enable people to type something like
wget -O - http:try.this.for.example.com/fun.mischief|guix repl -
and if so, can you suggest some options for automatic hash or signature
checking so that a paranoid could feel safe using a file pointed to
by a friend?

(I know one can already do silly stuff ... :)

I was hoping for a concise option that would enable a standard way of doing
integrity/trust checks by the stdin bufferful within guix. (Which I guess implies
designing fun.mischief file syntax as some kind of container packet stream, with
individually verifiable packets -- what would that mean for input to guix repl?).

Maybe a --paranoid option at the level of --dry-run or -n ?
(maybe configurable as default --paranoid=on :)

As far as avoiding file generation, a pipeline that needs file-size chunks to do
validation checks would only avoid file inode supply limits, right?
I guess YMMV per platform? IPC also has supply limits, IIRC.

Hm, what about an option for guix like
guix --trust-manifest="file-containing-sufficient-verification-info-for-what-happens-next" repl -
meaning e.g., sha256sum value for what would be passed via '-' and if that contains references
to other files etc., than hashes or signatures etc for everything entailed.

Toggle quote (4 lines)
> --
> Pierre Neidhardt
> https://ambrevar.xyz/

--
Regards,
Bengt Richter
T
T
Tobias Geerinckx-Rice wrote on 13 Nov 2020 21:27
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)
87zh3l6lzk.fsf@nckx
Pierre,

Pierre Neidhardt ???
Toggle quote (4 lines)
> The only issue is that it needs to be passed a file, so I must
> create a
> temporary file so that I can call `guix repl` on it.

A magic ‘-’ alias is nice, providing ‘guix repl -- -’ still DTRT
(I know, who does that, but still).

But why can't you just pipe your input into ‘guix repl’ now?

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX67sMA0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15Q2YA/3YpeSHPHYycEc3+bKNQMLT3CBsuUk8mxyfxTqxN
+9YBAQCZa5lpd7R+fQYMwSMuHDYZZ7MkVtqKv3G+Xtdn571dBA==
=LeBG
-----END PGP SIGNATURE-----

Z
Z
zimoun wrote on 13 Nov 2020 23:24
(address . 44612@debbugs.gnu.org)
86mtzkdhet.fsf@tournier.info
Dear,

On Fri, 13 Nov 2020 at 20:08, Bengt Richter <bokr@bokr.com> wrote:

Toggle quote (6 lines)
> Would this enable people to type something like
> wget -O - http:try.this.for.example.com/fun.mischief|guix repl -
> and if so, can you suggest some options for automatic hash or signature
> checking so that a paranoid could feel safe using a file pointed to
> by a friend?

How is it different to:

cat file | guix repl
or
guix repl -- file

? « Stupid is as stupid does, sir. » Well, it is hard nor impossible
to prevent people to shoot themselves in their foot if they really want
to. Somehow.


For instance,

Toggle snippet (29 lines)
$ cat /tmp/foo.scm | guix repl
GNU Guile 3.0.4
Copyright (C) 1995-2020 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
name: hello
version: 2.10
outputs: out
systems: x86_64-linux i686-linux
dependencies:
location: gnu/packages/base.scm:74:2
homepage: https://www.gnu.org/software/hello/
license: GPL 3+
synopsis: Hello, GNU world: An example GNU package
description: GNU Hello prints the message "Hello, world!" and then exits. It serves as an example of standard GNU coding practices. As such, it supports command-line arguments, multiple languages, and so on.

$1 = #t
scheme@(guix-user)>
$ cat /tmp/foo.scm
(use-modules (gnu packages base)
(guix scripts show))

(guix-show "hello")

All the best,
simon
P
P
Pierre Neidhardt wrote on 14 Nov 2020 10:52
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
87h7ps8duy.fsf@ambrevar.xyz
Tobias Geerinckx-Rice <me@tobias.gr> writes:

Toggle quote (5 lines)
> A magic ‘-’ alias is nice, providing ‘guix repl -- -’ still DTRT
> (I know, who does that, but still).
>
> But why can't you just pipe your input into ‘guix repl’ now?

It does not work now, I haven't looked at the details.

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl+vqNUSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/rhYH/jghbX/Lcx5vPq8bgKQGjS1/HmoKPZoX
gM1VIM7qYre8v6Qb9hNRdTwor1N/noG++gMtbCH09x7GRX+hVcO7WzAo0jhszpbR
kbtuNrSnMPquU6AKexXfLuwDuKgdICAzS8vjl2xJNSkWTtC9hcG/NbUqiR40e20u
NMn4Nw5n1s+m7mByXCIShOLh3KJ2rMhaXYuvkVAN5YXrkBlXcqkl9FOB7ZDNr2Io
diuydEnEYdCQ9hjgUOZi/aiu5G13mtgoK736e4HqVdlpwqIKP8bLdobkI0svjaTJ
m4mewpUEljLwccfAs0/WigYh5fBHRssvOaxfmzK7altjUWMv1oHe/s8=
=M4Hy
-----END PGP SIGNATURE-----

T
T
Tobias Geerinckx-Rice wrote on 14 Nov 2020 12:23
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)
87lff46v32.fsf@nckx
Pierre,

So far this looks like an (SB)CL(-specific) bug, right? Does it
happen anywhere else? I tried Guile[0].

Pierre Neidhardt ???
Toggle quote (2 lines)
> It does not work now, I haven't looked at the details.

Please do.

To ‘it does not work’ I can reply only that Nyxt doesn't build
[log attached] on current master & that learning Common Lisp by
putting random text into SBCL doesn't work :-)

Kind regards,

T G-R

[0]:
(use-modules ((ice-9 popen)))
(let ((g (open-output-pipe "guix repl")))
;; XXX The Guile prompt after each input line is ugly.
(display "(use-modules ((guix))) (%store-prefix)" g)
(close-pipe g))
Attachment: nyxt.log
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX6++IQ0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15nbMA/jWBMzKDRoHZr+z97Aq86/NGDc897MdhR+fTLStn
doE0AP9QgcVZZrIi8Pq4NAPL5ZExF2MIRofRwvFyfUr7uKSdCA==
=uSB/
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 14 Nov 2020 14:19
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
87sg9cxeif.fsf@ambrevar.xyz
Hey Tobias,

Always good to have someone actually test the stuff :)

Tobias Geerinckx-Rice <me@tobias.gr> writes:

Toggle quote (3 lines)
> So far this looks like an (SB)CL(-specific) bug, right? Does it
> happen anywhere else? I tried Guile[0].

Maybe there was a misunderstanding, it's not about Common Lisp.
We can do easier than from Guile, i.e. from a shell:

Toggle snippet (3 lines)
echo '(display "hello")' | guix repl

and... it works! O.o

OK, my bad then, I mistested somehow.

For future reference, it's also works in Common Lisp:

Toggle snippet (14 lines)
> (with-input-from-string (s "(display \"foo\\n\")")
(uiop:run-program '("guix" "repl") :input s :output t :error-output nil))
GNU Guile 3.0.4
Copyright (C) 1995-2020 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
foo


However this brings me to another issue: the program output is prefixed
with the REPL welcome message which is printed to stdout.

So ideally when we read from standard input we should not include the
welcome message.

Any clue how to do that?

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl+v2UgSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/4doIAJOurTKsYV/B3o17og/F/BjBrK5AJiJS
a8bLUcP1Q8Y8C0LDWV4ZLDpdVFS8PFNTReo+HukAYqpT3Fv6weUAPoyzIsjgPh9b
HWizwxE94g5dbF93VQbk7ep0F9YM5TYqVGbKrKwTJF/i+TtycKgnkKmGI4SDRYnl
1GME1na6hJtawkM7FQYjCs0L6N4IJEEIyPGzqJUcvjknx1Z1rlp4krBVJub0KBi/
wYLIYU6YBtWwbvNauxhYmPCO3yzbahMwSBdWYAVkWw/q6ElOPOrPYgVFAfsZReil
hnXIBgJAn0zb3kAX9GHU5ND17LwAjEn1MfN5hnJkKiCfoF7B8mGTAIA=
=Hooa
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 14 Nov 2020 14:24
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
87pn4gxe8q.fsf@ambrevar.xyz
Tobias Geerinckx-Rice <me@tobias.gr> writes:

Toggle quote (3 lines)
> To ‘it does not work’ I can reply only that Nyxt doesn't build
> [log attached] on current master

Shoot! :p

Which architecture?

I builds for me on x86-64 at commit
403ba4140f52b9ea9483e4c775f102bbb9753e51.

I've released Nyxt 2-pre-release-4 a few days ago and I've used it to
build the Guix pack, so your feedback is surprising.

Or is it a reproducibility issue?

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl+v2qUSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x//C4IAKEggPFLkQ6Bfdxew7ZWwqzWOaC73xrJ
+h9ts2jUlyMnlE55JWo/Fm2McPTF2TsdMwAiu+WOKlyQ9/WK8vrY0gn0C6HwarPn
0ab5sGooFdV9zaAbw6REq5nKGKEfGBew6Akw4kF+q61tQWKvdPN1Zl4fW5shsC6L
S+3VBSqTVtT2a08q/TdiH9jn7efXpn63BiO9jN2pfoUMUvMRuADTDStojrCmazGl
oxGvy4ljHESdiHpNUlzs6Y9qpHjdpK+Wlgd080i0OBeP1LO8mIt8NpcWkTzu4dE/
OzUl8EX7fa6QtVeNLk5khj7YKUiSIw4PSDP29hOyy63ldsocGqKd6nY=
=++Te
-----END PGP SIGNATURE-----

T
T
Tobias Geerinckx-Rice wrote on 14 Nov 2020 14:58
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)
878sb459cf.fsf@nckx
Pierre,

Pierre Neidhardt ???
Toggle quote (2 lines)
> and... it works! O.o

Don't you hate it when that happens? Ban bug suicide.

(Does that mean this one can be closed? Or retitled, if we want
to debug Nyxt? :-)

Toggle quote (4 lines)
> For future reference, it's also works in Common Lisp:
> (uiop:run-program '("guix" "repl") :input s :output t
> :error-output nil))

Well, I stranded trying to import (or whatever the CL term is)
UIOP itself, but my Common Lisp-fu is hella weak.

Toggle quote (8 lines)
> However this brings me to another issue: the program output is
> prefixed
> with the REPL welcome message which is printed to stdout.
>
> So ideally when we read from standard input we should not
> include the
> welcome message.

That's a question for Guile channels, but I totally agree. It's
annoying and nowhere near ‘an interactive mode’ as suggested by
the GPL3.

This is sensible:

$ echo echo Hi. | bash
Hi.
$

This is not:

$ echo '(display "Hi.\n")' | guile
GNU Guile 3.0.2
Copyright (C) 1995-2020 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show
w'.
This program is free software, and you are welcome to
redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
Hi.
scheme@(guile-user)>
$

Toggle quote (2 lines)
> Any clue how to do that?

The following line in my ~/.guile does just that:

(set! repl-welcome (const #t))

...unfortunately, it doesn't work late:

$ echo '(use-modules ((system repl common))) \
(set! repl-welcome (const #t))' | guix repl
[shouty noises]
$

It does not appear documented if and how you'd make Guile load a
different (Nyxt-specific) init file name.

This reminds me: do you want Nyxt to call ‘guix repl -q’ to skip
loading ~/.guile to make your UI more predictable & debuggable?
Or keep it as an escape hatch for cool hacks?

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX6/icA0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15ICMA/jt/UtVrFy2qKaoXsWJun/DlyE6tSEQrVSiE46Nf
xmFKAQDOfu+Wd2oTcyuDRF2pqsTg/LW88E6y9swve8dB88QnDQ==
=Sz3u
-----END PGP SIGNATURE-----

T
T
Tobias Geerinckx-Rice wrote on 14 Nov 2020 15:12
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)
875z6858p1.fsf@nckx
Pierre Neidhardt ???
Toggle quote (9 lines)
> Tobias Geerinckx-Rice <me@tobias.gr> writes:
>
>> To ‘it does not work’ I can reply only that Nyxt doesn't build
>> [log attached] on current master
>
> Shoot! :p
>
> Which architecture?

Boring old x86_64 I'm afraid.

Toggle quote (3 lines)
> I builds for me on x86-64 at commit
> 403ba4140f52b9ea9483e4c775f102bbb9753e51.

I pulled to that commit but it's still the same ungrafted
derivation
(/gnu/store/bdi8dq8i3f59zxp7jrabas847dh80m7x-nyxt-2-pre-release-4.drv).

Building for the fourth time now, with -{M,c}1...

...nope, always the same error:

Unhandled ASDF/FIND-COMPONENT:MISSING-DEPENDENCY in thread
#<SB-THREAD:THREAD "main thread" RUNNING {1001898213}>:
Component "cl-base64" not found, required by #<SYSTEM "dexador">

So I'm surprised it does build for you. Weak Lisp-fu or not, that
looks pretty deterministic to me. Weird.

Toggle quote (2 lines)
> Or is it a reproducibility issue?

No, it's an error in the ‘build’ phase.

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX6/lug0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15SWABAKS4mLnPvAfxoVn4LSawPvmpu/uhhODO517dLtrj
Fl/0AP9UNXJU0+QECLOcHw1sqCW8Zxnui3eUbSGro3c0yoVrCg==
=s89g
-----END PGP SIGNATURE-----

Z
Z
zimoun wrote on 14 Nov 2020 13:09
(address . 44612@debbugs.gnu.org)
86a6vkywa5.fsf@tournier.info
Hi Pierre,

On Sat, 14 Nov 2020 at 10:52, Pierre Neidhardt <mail@ambrevar.xyz> wrote:
Toggle quote (9 lines)
> Tobias Geerinckx-Rice <me@tobias.gr> writes:
>
>> A magic ‘-’ alias is nice, providing ‘guix repl -- -’ still DTRT
>> (I know, who does that, but still).
>>
>> But why can't you just pipe your input into ‘guix repl’ now?
>
> It does not work now, I haven't looked at the details.

It does with the plain shell pipe ’|’:

Toggle snippet (14 lines)
$ echo 42 | guix repl
GNU Guile 3.0.4
Copyright (C) 1995-2020 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
$1 = 42
scheme@(guix-user)>
$

Another example here:



Please look at the details.

All the best,
simon
G
G
Guillaume Le Vaillant wrote on 14 Nov 2020 16:03
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
87v9e8hter.fsf@yamatai
Tobias Geerinckx-Rice via Bug reports for GNU Guix <bug-guix@gnu.org> skribis:

Toggle quote (69 lines)
> Pierre,
>
> Pierre Neidhardt ???
>> and... it works! O.o
>
> Don't you hate it when that happens? Ban bug suicide.
>
> (Does that mean this one can be closed? Or retitled, if we want to debug
> Nyxt? :-)
>
>> For future reference, it's also works in Common Lisp:
>> (uiop:run-program '("guix" "repl") :input s :output
>> t :error-output nil))
>
> Well, I stranded trying to import (or whatever the CL term is) UIOP itself, but
> my Common Lisp-fu is hella weak.
>
>> However this brings me to another issue: the program output is prefixed
>> with the REPL welcome message which is printed to stdout.
>>
>> So ideally when we read from standard input we should not include the
>> welcome message.
>
> That's a question for Guile channels, but I totally agree. It's annoying and
> nowhere near ‘an interactive mode’ as suggested by the GPL3.
>
> This is sensible:
>
> $ echo echo Hi. | bash
> Hi.
> $
> This is not:
>
> $ echo '(display "Hi.\n")' | guile
> GNU Guile 3.0.2
> Copyright (C) 1995-2020 Free Software Foundation, Inc.
>
> Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
> This program is free software, and you are welcome to redistribute it
> under certain conditions; type `,show c' for details.
>
> Enter `,help' for help.
> Hi.
> scheme@(guile-user)> $
>
>> Any clue how to do that?
>
> The following line in my ~/.guile does just that:
>
> (set! repl-welcome (const #t))
>
> ...unfortunately, it doesn't work late:
>
> $ echo '(use-modules ((system repl common))) \
> (set! repl-welcome (const #t))' | guix repl
> [shouty noises]
> $
>
> It does not appear documented if and how you'd make Guile load a different
> (Nyxt-specific) init file name.
>
> This reminds me: do you want Nyxt to call ‘guix repl -q’ to skip loading
> ~/.guile to make your UI more predictable & debuggable? Or keep it as an escape
> hatch for cool hacks?
>
> Kind regards,
>
> T G-R

It looks like you can get rid of the welcome message by using the '-s'
option:

$ echo '(display "Hi.\n")' | guile -s /dev/stdin
Hi.
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCX6/x3A8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j9jgAD+M+lMQFSN+TES1ViTu9+s6BCWIPtThBSSfR33
TyQvmJwA/AvjXzW3lziOqDpVnicfWWIaHUuuxXVkMfpx9DNxTrOH
=HjO3
-----END PGP SIGNATURE-----

G
G
Guillaume Le Vaillant wrote on 14 Nov 2020 16:07
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
87sg9cht8w.fsf@yamatai
Guillaume Le Vaillant <glv@posteo.net> skribis:

Toggle quote (6 lines)
> It looks like you can get rid of the welcome message by using the '-s'
> option:
>
> $ echo '(display "Hi.\n")' | guile -s /dev/stdin
> Hi.

Or:
$ echo '(display "Hi.\n")' | guix repl /dev/stdin
Hi.
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCX6/yrw8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j9cnAEAhKcSFK1IydVFHJiC4siOuknkRUzpFUVzg5/w
inEn3CAA/RJno5Bi06y90Xbw/6QqgOmNq4cYe4Qm2BZnbyhFIi7M
=544R
-----END PGP SIGNATURE-----

T
T
Tobias Geerinckx-Rice wrote on 14 Nov 2020 16:22
(name . Guillaume Le Vaillant)(address . glv@posteo.net)
87361c55gd.fsf@nckx
Guillaume,

Guillaume Le Vaillant ???
Toggle quote (4 lines)
> It looks like you can get rid of the welcome message by using
> the '-s'
> option:

Wonderful!

But I'd tried ‘-s’ already:

$ guile -s /tmp/scm
GNU Guile 3.0.4
Copyright (C) 1995-2020 Free Software Foundation, Inc.
[...here we go again...]

That's starting to look like a bug. Or rather, having to use
‘/dev/stdin’ explicity is clearly an ugly work-around
for... something.

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX6/2Iw0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15PbQA/jwhujeIpEwHP3DsDPhGnfq0ZRR5k7tOfi5hg79X
szjyAQDRNijejpa50L3vtOafbOgyPpZR0fZ6TOmU0Et5efNyBw==
=j+bl
-----END PGP SIGNATURE-----

T
T
Tobias Geerinckx-Rice wrote on 14 Nov 2020 16:36
87zh3k3q84.fsf@nckx
The point is that people shouldn't have to resort to gross
not-even-POSIX hacks just to get rid of this message. Imagine
typing

... | grep x /dev/stdin | uniq /dev/stdin | wc /dev/stdin

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX6/5fA0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15bkcA/A/rBEtWrhFTryiJj3D7iNYs12uenw7b0uCWpK7D
eDcuAQCycikl3IYjaXO8LlaX6Zbgd8touBe75A4e5Ms9QC04BA==
=2+Gx
-----END PGP SIGNATURE-----

C
C
Christopher Baines wrote on 14 Nov 2020 16:43
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)
87a6vkc5bt.fsf@cbaines.net
Pierre Neidhardt <mail@ambrevar.xyz> writes:

Toggle quote (45 lines)
> Hey Tobias,
>
> Always good to have someone actually test the stuff :)
>
> Tobias Geerinckx-Rice <me@tobias.gr> writes:
>
>> So far this looks like an (SB)CL(-specific) bug, right? Does it
>> happen anywhere else? I tried Guile[0].
>
> Maybe there was a misunderstanding, it's not about Common Lisp.
> We can do easier than from Guile, i.e. from a shell:
>
> --8<---------------cut here---------------start------------->8---
> echo '(display "hello")' | guix repl
> --8<---------------cut here---------------end--------------->8---
>
> and... it works! O.o
>
> OK, my bad then, I mistested somehow.
>
> For future reference, it's also works in Common Lisp:
>
> --8<---------------cut here---------------start------------->8---
>> (with-input-from-string (s "(display \"foo\\n\")")
> (uiop:run-program '("guix" "repl") :input s :output t :error-output nil))
> GNU Guile 3.0.4
> Copyright (C) 1995-2020 Free Software Foundation, Inc.
>
> Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
> This program is free software, and you are welcome to redistribute it
> under certain conditions; type `,show c' for details.
>
> Enter `,help' for help.
> foo
>
> --8<---------------cut here---------------end--------------->8---
>
> However this brings me to another issue: the program output is prefixed
> with the REPL welcome message which is printed to stdout.
>
> So ideally when we read from standard input we should not include the
> welcome message.
>
> Any clue how to do that?

I haven't been following along too closely, but I'm surprised guix repl
--type=machine hasn't been mentioned, is that relevant?
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl+v+wZfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XeDQA//bIDVqo2UBiOBiCwCBwy9Z+vg0TGu+IEo
Sv7YNAAw5qzBlNMb5scyxviEqqz+kmk6MI0dOG6+3yuK9XAxLx3zCS1YGbsG8FCT
+EVL6XuinWrOjFiHhSUtebE9TbAZc+xc0KNX/FQTVSdd5iTKQleE2jCLSZwHU/Ci
OgoMgGiy2gMWN0hoOlroWjVwCtFMR7I2FTRT5GYcUuwyhv9zIvQkolb7X76V9S7W
cWoSQ8GI2yRMYubaF410JT9HY7Iew/AN31ZAz/Qivv03LCrahAETo01sWkQyUzD+
viuqy4khyp7yfxd5unaHHI3mV4N++P5WiUlA4FLrTnXqr4T4IaGfDUo5MaEepQch
3Ofgv003ZFp5IFxfPU5ywZ/tLyVQyLq82BxB4jhoGyOQJ4xFZdyPBU6hgVqsKhYy
8S6P9qmg+6rL5wDzsDbundGEUEzzIP47lHWZWh4cWuRMJSe7pSuuxEB8v/kLIBHj
FGGgJ5g/gAX7Tx9VkGcp/N8/sfY/I0zHI0k3OQMQGSB3toVU2OlVd/JJpRZRYZu/
5o98R2kj+WpoQnwOe516WCAEUrdsmiKF8faJpHKCQOk6Z0w+hxRQW+04GjO+IcPq
0CjfRQrJyKTltDxA7+Okl15hg1Z9PaVYeP4e4KM2tm4Bdgf4UuFB8BOwEBQNwnib
xdu310blWD0=
=CUny
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 14 Nov 2020 17:03
(name . Christopher Baines)(address . mail@cbaines.net)
87361cx6w3.fsf@ambrevar.xyz
Hi Chris!

Christopher Baines <mail@cbaines.net> writes:

Toggle quote (5 lines)
>> Any clue how to do that?
>
> I haven't been following along too closely, but I'm surprised guix repl
> --type=machine hasn't been mentioned, is that relevant?

Ha, didn't know about this one, I should have read the manual more
closely!

Sadly, it doesn't cut it:

Toggle snippet (6 lines)
> echo '(display "Hi.\n")' | guix repl -t machine 2>/dev/null
(repl-version 0 1 1)
Hi.
(values (non-self-quoting 2052 "#<unspecified>"))

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl+v/9wSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/AfgH/jnShi4YLZVPIoXGbFQ3XdXNGXjymW0Z
EfkY1miG1w33AsJ0h4sO78CQA66D74+5RSv/ueVgRwaBimrIkMv5gIZTWkDLJUl0
GPTN0fgGLOIOu1w0VShKcE5FSsnhggswudcD8RqNbajPZ7pKkLDjLRl+Y2aeUqTG
KtHGNjg0xP3oIlpYs7y2HYATJkjddBQ52g+YjOQ+/uYukw0y+USvTZbPuNOmLIXc
OJNnfFwEh8LPRWUzBPavOoWitY+TcyTM5vyXYD7WvsG1W4wae5VErL/AaZCSxvIt
22rZ/krmidgbeQFsbhF9k5HozqndHqVKGCTgpmmDKQOiILYcj0N1swA=
=/PMc
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 14 Nov 2020 17:05
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
87zh3jx6t2.fsf@ambrevar.xyz
I think this is the old non-UTF8 encoding grafting issue (if you ask me,
I'll send you the link). Try:

Toggle snippet (3 lines)
guix build --no-grafts nyxt

If this is the case, nothing Nyxt can do here I'm afraid, as it's a Guix
issue with the reference scannr (it does not find non-UTF8 references).

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl+wAEkSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/fWkH/0zl+hjKYTS28yEq5ZZLxvICBUFZ4BTD
JdV80e+MLsio6mPqQJqXufbZNCZMTNKV0GlhVUpjljuOvJ2vcUa3JYTEfsyHNofF
TcCxYco3jsAH6/qppZ7U3rGNKnstUs5FlfgnVdPLgcgVYvcKQfBWgT6IVzR5Ic30
sABk+jK8mj5EdxrJ6/jiRc6OrY0E1fBE3GzJFHqvYY+SOGVBdh+X7LPZ6y57jXTE
G86TO4uJ7hu2t2NUu4ZbI8/4wD0aXudncU0dS5QeJnIiZOSyqb2zTdnoYbm861lp
8AZ+PuUObqqWHwlIsTjdwNwdgMU2BkZHKdtlgBXBq6P3hpqraom5g5g=
=lRnL
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 14 Nov 2020 17:06
87wnynx6r3.fsf@ambrevar.xyz
Fantastic, this works!

Thanks a lot, Guillaume!

I'll update Nyxt then.

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl+wAJASHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/VqIIAK0ojlA74FS1ra54AgGfpKUhtvT2eVzr
9Oxa4FJfZgP2/W89x1E9XyeO4JRixtzjSWpxGGBnQmDr+qBlul62DSfrFDrWfLwa
wcPr8T9n13TAhEj2nCWQ/xosLEjC3UxCmH4f3S1X8PgnCG4X40GKaZ7bqfVM6sRW
GBSLY6r0OLXYoiV6EJVOqDC+hgfG/9DhmObBP766mcSv0rd1wQzlfEX7yyNm/VnU
2k2Wgc22a6TKI7YwqbVTmoIMOKPLEJRlIgWvnN0VP8s2UN+Ej5vEtAA29XtIm3GA
cuQV1qlY03Kpqvo1d7eMh/AsT9Q/z7/gx2MPTfdPEOiFq/hwbkXtDTA=
=j8e8
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 14 Nov 2020 17:11
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
87tutrx6js.fsf@ambrevar.xyz
Tobias Geerinckx-Rice <me@tobias.gr> writes:

Toggle quote (9 lines)
> Pierre,
>
> Pierre Neidhardt ???
>> and... it works! O.o
>
> Don't you hate it when that happens? Ban bug suicide.
>
> (Does that mean this one can be closed? Or retitled,

We can retitle it to remove the Guile banner indeed.


Toggle quote (2 lines)
> if we want to debug Nyxt? :-)

Err... I'm confused, this is not about Nyxt :p

Toggle quote (7 lines)
>> For future reference, it's also works in Common Lisp:
>> (uiop:run-program '("guix" "repl") :input s :output t
>> :error-output nil))
>
> Well, I stranded trying to import (or whatever the CL term is)
> UIOP itself, but my Common Lisp-fu is hella weak.

If you tried with SBCL, then you need to first require UIOP:

Toggle snippet (5 lines)
(require :uiop)
(with-input-from-string (s "(display \"foo\\n\")")
(uiop:run-program '("guix" "repl") :input s :output :string :error-output nil))

Toggle quote (4 lines)
> This reminds me: do you want Nyxt to call ‘guix repl -q’ to skip
> loading ~/.guile to make your UI more predictable & debuggable?
> Or keep it as an escape hatch for cool hacks?

Oops, thanks for the reminder. Will do indeed, I don't think it's
needed in Nyxt. Or maybe make it optional. Well, if someone ever
complains about it...

Cheers!

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl+wAZcSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/9goIAJR9xhCATdsyd5FVpHPAhOWt1toplsS6
93ZWTeK0z2I3/TMHGaRxAEL/ZBIHCdHomvkUS98Fg/e3jx9IsxCsKvf1wP1jNIfq
nILb5TRNVj8pHynSNbxO8V7K2sKNzm1FcbUGG+YfsCgUMiKr/nTNbO0cbVsUn1Fu
i940cc53mpUGYory2dGpp3BRUHFuChANGJbUzlTD1EnURb3XpPGrBYhdpRd2rc0A
fv7e5ggKaD9hzPxVVwLEBUwArOZp7U6WMtHqw/7BZTw9q8swras/jh0VKQz6x87t
jRr3NP29BQzViQ0f46cRgn3G9jFoMknWS7Z3lLOhlte3oGVE2TyJrQ0=
=8fbT
-----END PGP SIGNATURE-----

T
T
Tobias Geerinckx-Rice wrote on 14 Nov 2020 17:13
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)
87wnyn532a.fsf@nckx
Pierre Neidhardt ???
Toggle quote (2 lines)
> guix build --no-grafts nyxt

That's what fails. I haven't tried building with grafts.

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX7ACPg0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15YpoBAM3fimVaTc5uQWojDWYbdSpdOW7GXp3SSOVxFIP6
UbpeAQDW+qI4X1MnwVgAc8EKZZuVwFWDmPJu/nHOOZ8ynSMFAA==
=5XbC
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 14 Nov 2020 17:25
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
87pn4fx5v3.fsf@ambrevar.xyz
Does building sbcl-dexador work for you?

Maybe it's a parallel build issue. Can you reduce the number cores to 1
see if that helps?

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl+wBRASHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/yiUH/0kj0WZihXNHg6mhGD6KPVDEpK2BU5ng
CkamS7tWLJWVgcHk4nvsgkOK19sFqqMPiZ8YlMeOWAOYhJKjMKBAKKoyHxPk4+YW
o17hv0jTOMudHLh0sKnimToNFe7kRNWL+HMxE+sIs8U2IIDv+I88CYEJNz3LOHk8
NtxnYkCZdfxcicjqQe5OehQwiLgoRL6ucZWh8qZn9aiwAVnjxSlV4+6dBE43yUTK
L7X2je31N0GBml2Pl5SUoUwDbP2zTXkwZ+n2SMIAX2s7yb01Y3oXzr4+6872T0qk
+8SmKPK0yzf708bkSr7OD0dzMI8Q7b2ILWxzSe7lzEfd1wapHSld81U=
=abC3
-----END PGP SIGNATURE-----

T
T
Tobias Geerinckx-Rice wrote on 14 Nov 2020 18:08
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)
87tutr50jo.fsf@nckx
Pierre Neidhardt ???
Toggle quote (2 lines)
> Does building sbcl-dexador work for you?

Yes, even with multiple cores & grafts enabled.

Toggle quote (4 lines)
> Maybe it's a parallel build issue. Can you reduce the number
> cores to 1
> see if that helps?

I think I mentioned in my previous mail that I was using -{M,c}1.
Anyway, I was, the message never changes.

Here's that ungrafted derivation again:

/gnu/store/2s6m5wkjksxi63wv1cz73x0kqj0az2l9-nyxt-2-pre-release-4.drv

Can you confirm that we're building the same thing?

Toggle quote (2 lines)
> Err... I'm confused, this is not about Nyxt :p

Always has been,
/
T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX7AO+w0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15awQBAKSdVZ4hwniN0oU58gnrMNNzyne2hBoCFhXmx8YZ
n7EDAQCBgmsfh6BmTQccoyWWaMrWC+yQ0poFH4Cdz0rpAVwzAQ==
=QoiF
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 14 Nov 2020 18:21
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
87k0unx3ai.fsf@ambrevar.xyz
Tobias Geerinckx-Rice <me@tobias.gr> writes:

Toggle quote (6 lines)
> Here's that ungrafted derivation again:
>
> /gnu/store/2s6m5wkjksxi63wv1cz73x0kqj0az2l9-nyxt-2-pre-release-4.drv
>
> Can you confirm that we're building the same thing?

We are not, it seems:

Toggle snippet (4 lines)
$ ./pre-inst-env guix build --no-grafts -d nyxt
/gnu/store/bdi8dq8i3f59zxp7jrabas847dh80m7x-nyxt-2-pre-release-4.drv

Commit 403ba4140f52b9ea9483e4c775f102bbb9753e51.

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl+wEhUSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/Wq0IAI0j7E4O1yT1qbUbMtuYJq+iTjLuFYrd
72kFjrzxTSnFEb6NGhbhdbDQFfBqpubYyANwYiCOFLnG+aJRy23TfI0hw3zj643G
gIdIDr/kCM7+TwasoI2S48CpAJj5oo0jof6HTV9Tj0cdFOQ/1xmE28uNriTZ3KbY
UxQaz+pELMHGrCAG80NUH1yeFox5WGfLfC/x68hCeruuO4Qv/InVCBPMAj4SYLbJ
CzMgFVjwkRDH+GuwaFgK+oImyRa2D5klDmFx9DDbjoVriCyWVOGE21A1LOJC5Wm7
z+QZHJIq+gpf5NiBfnoMyLfVLLeZ0pZzBWei3uvPbOc5OSVjlXRBJwc=
=r35T
-----END PGP SIGNATURE-----

T
T
Tobias Geerinckx-Rice wrote on 14 Nov 2020 18:33
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)
87r1ov4ze1.fsf@nckx
Pierre Neidhardt ???
Toggle quote (19 lines)
> Tobias Geerinckx-Rice <me@tobias.gr> writes:
>
>> Here's that ungrafted derivation again:
>>
>> /gnu/store/2s6m5wkjksxi63wv1cz73x0kqj0az2l9-nyxt-2-pre-release-4.drv
>>
>> Can you confirm that we're building the same thing?
>
> We are not, it seems:
>
> --8<---------------cut
> here---------------start------------->8---
> $ ./pre-inst-env guix build --no-grafts -d nyxt
> /gnu/store/bdi8dq8i3f59zxp7jrabas847dh80m7x-nyxt-2-pre-release-4.drv
> --8<---------------cut
> here---------------end--------------->8---
>
> Commit 403ba4140f52b9ea9483e4c775f102bbb9753e51.

Hm, OK, even with

$ git checkout 403ba4140f52b9ea9483e4c775f102bbb9753e51
$ guix environment guix -- ./pre-inst-env guix build \
--no-grafts nyxt -{M,c}1 -d
/gnu/store/2s6m5wkjksxi63wv1cz73x0kqj0az2l9-nyxt-2-pre-release-4.drv

But for whatever reason I have your derivation, and

$ guix build --no-grafts -{M,c}1 \
/gnu/store/bdi8dq8i3f59zxp7jrabas847dh80m7x-nyxt-2-pre-release-4.drv

fails just as reliably, in the same way, so I don't think that's
related.

I'll try it on a different x86_64 machine.

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX7AU1g0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15G2QBAPkoHmxDEmbPWAx/Di0GR2sof3i+yG28bASKH+nO
Y+9zAP4mjHIlSABz2PovHP9p3vYsk7BXIsdsEEKKFiAwKYNABg==
=XST9
-----END PGP SIGNATURE-----

Z
Z
zimoun wrote on 14 Nov 2020 20:08
(address . 44612@debbugs.gnu.org)
86k0unycww.fsf@gmail.com
Hi Tobias,

Do not know if it is expected but that downloads the world… then it
compiles it. It is not Green-friendly. ;-)

If it helps, what I get on my laptop:

Toggle quote (2 lines)
>> Commit 403ba4140f52b9ea9483e4c775f102bbb9753e51.

[..]

Toggle quote (2 lines)
>> /gnu/store/bdi8dq8i3f59zxp7jrabas847dh80m7x-nyxt-2-pre-release-4.drv

[..]

Toggle quote (5 lines)
> $ guix environment guix -- ./pre-inst-env guix build \
> --no-grafts nyxt -{M,c}1 -d
> →
> /gnu/store/2s6m5wkjksxi63wv1cz73x0kqj0az2l9-nyxt-2-pre-release-4.drv

[..]

Toggle quote (7 lines)
> $ guix build --no-grafts -{M,c}1 \
> /gnu/store/bdi8dq8i3f59zxp7jrabas847dh80m7x-nyxt-2-pre-release-4.drv
>
> fails just as reliably, in the same way, so I don't think that's
> related.


Toggle snippet (17 lines)
$ guix time-machine --commit=403ba4140f52b9ea9483e4c775f102bbb9753e51 \
-- build --no-grafts -d nyxt
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
/gnu/store/bdi8dq8i3f59zxp7jrabas847dh80m7x-nyxt-2-pre-release-4.drv

$ guix time-machine --commit=403ba4140f52b9ea9483e4c775f102bbb9753e51 \
-- build --no-grafts nyxt
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
/gnu/store/1fa4443ripbxjnyvk577hp98r7szrbh2-nyxt-2-pre-release-4

$ guix time-machine --commit=403ba4140f52b9ea9483e4c775f102bbb9753e51 \
-- build --no-grafts nyxt -{M,c}1 -d
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
/gnu/store/bdi8dq8i3f59zxp7jrabas847dh80m7x-nyxt-2-pre-release-4.drv


Cheers,
simon
L
L
Ludovic Courtès wrote on 16 Nov 2020 10:25
(name . Bengt Richter)(address . bokr@bokr.com)
87blfx1wmf.fsf@gnu.org
Hi,

Bengt Richter <bokr@bokr.com> skribis:

Toggle quote (6 lines)
> On +2020-11-13 10:41:38 +0100, Pierre Neidhardt wrote:
>> `guix repl` is a fantastic, hassle-free tool to bind Guix with
>> third-party languages. I've done it here:
>>
>> https://github.com/atlas-engineer/nyxt/blob/2-pre-release-4/libraries/ospama/ospama-guix.lisp

I recommend using ‘guix repl -t machine’ and keeping the REPL process
around instead of respawning it for every expression.

Ludo’.
T
T
Tobias Geerinckx-Rice wrote on 16 Nov 2020 11:45
(name . zimoun)(address . zimon.toutoune@gmail.com)
87tutpwpey.fsf@nckx
Simon,

zimoun ???
Toggle quote (4 lines)
> Do not know if it is expected but that downloads the world… then
> it
> compiles it. It is not Green-friendly. ;-)

What exactly downloads the world?

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX7JYVQ0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW15WA8BAKoEvsBo1V2qPjqfnz5AsRhCAEcujcONf2ygAfk2
8+zQAQDyxn1oqcxucoHQNaQUrvWt1Yhpm3Pzfyyjs5qE0OyIDg==
=D7nw
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 16 Nov 2020 12:36
(address . 44612@debbugs.gnu.org)
87wnylbkkd.fsf@ambrevar.xyz
Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (12 lines)
> Hi,
>
> Bengt Richter <bokr@bokr.com> skribis:
>
>> On +2020-11-13 10:41:38 +0100, Pierre Neidhardt wrote:
>>> `guix repl` is a fantastic, hassle-free tool to bind Guix with
>>> third-party languages. I've done it here:
>>>
>>> https://github.com/atlas-engineer/nyxt/blob/2-pre-release-4/libraries/ospama/ospama-guix.lisp
>
> I recommend using ‘guix repl -t machine’

Looks like `-t machine` has the same issue.
This does what I want:

Toggle snippet (4 lines)
$ echo "(display \"Hi.\\n\")" | guix repl -t machine /dev/stdin
Hi.

This does not:

Toggle snippet (6 lines)
$ echo "(display \"Hi.\\n\")" | guix repl -t machine
(repl-version 0 1 1)
Hi.
(values (non-self-quoting 2052 "#<unspecified>"))

Toggle quote (3 lines)
> and keeping the REPL process around instead of respawning it for every
> expression.

At first glance, we would want to do this indeed.

But in the case of Nyxt, there would be no point when to terminate the
process, so it would be around for the whole time Nyxt is running, which
may not be desirable.

Alternatively, I could simply keep it alive for a given duration (1
minute?) and automatically spawn it if the process is dead.

Any recommendations?

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl+yZCISHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/PYEH/idb2ePvYX2y4ClOV8lVSLTHRHSBCjqI
uLTg+yM9ix8F/dot+1Z2rtGcu63RwKsJOnNHQkk9hCPpcrS9BwnMiyiqlGkYoqqz
k10AjBrruCV4qd9DhRTASag2SS1M8P/JlK/4MrxAhUAFqF1A+KjgvBaPoPOmzE/F
oVCTM7MoB9L7OkDC+PZKy78VRBZfy4ucFpztGE+g2iU5Aw6L3tBkGt+li/dHukIv
Oc4/jak76WX30tUnWZiy+c8NoxLCcfu5+3v1oGj698+Q/diwyHEs+FUvuMAMCcI1
EZ+6QsU2xJK92J2f8k2TL5bHbNG5FvnYC4Vi3ZDj8ZY1UpvBFlZOc2Y=
=lBW5
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 16 Nov 2020 12:53
(address . 44612@debbugs.gnu.org)
87tutpbjqs.fsf@ambrevar.xyz
If I understand correctly, "-t machine" is for when we want to retrieve
the results of all top-level evaluations.

If we only want specific results, then we are better off "passing" the
desired value to the caller by dumping them to the standard output.

For the latter, "-t machine" is not necessary I believe.

Is this correct?

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl+yaEsSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/q1oIAKaupmfSZqF/apJoaNFk2nHeTPCTicTP
X8Fa0f2xgwanoXb9nxtLcP9sYwl6vlY7o+EOvC7ptzaWIrxZXERex7znL/Yflco5
35IbaOxYjFrU3+5uvaWhNCbmaEgH2fmWqIqycXOeQkJHBIjq0TIIOx+ss/Ef3Qnw
Ks5iMkwCayHa5pmp+84kXFjNVypo0QcM4m5mYd13iiSd7YjNGNRnWILT1ZPBXD0T
NtxyidjDyDlO9PF5rOLPXjS/OpkLH9rrGzIMX/VXFTZbASHiB8UmHzDdf7ItJYMM
k1ckLod2Uv5hB8Cg3X6GJWCT6YP47FMA8wKgjFHHsy+cgMUKOULw6tQ=
=gcZr
-----END PGP SIGNATURE-----

Z
Z
zimoun wrote on 16 Nov 2020 12:38
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)
863619ttua.fsf@gmail.com
Hi Tobias,

On Mon, 16 Nov 2020 at 11:45, Tobias Geerinckx-Rice <me@tobias.gr> wrote:

Toggle quote (2 lines)
> What exactly downloads the world?

I have not inspected but I think that’s because a lot of substitutes
missing:

Toggle snippet (26 lines)
$ pkgs=$(guix time-machine --branch=version-1.2.0 -- package -A ^sbcl- |cut -f1)
$ guix time-machine --branch=version-1.2.0 -- weather $pkgs
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
computing 455 package derivations for x86_64-linux...
looking for 456 store items on https://ci.guix.gnu.org...
updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
https://ci.guix.gnu.org
71.3% substitutes available (325 out of 456)
at least 214.4 MiB of nars (compressed)
431.6 MiB on disk (uncompressed)
0.008 seconds per request (3.5 seconds in total)
130.2 requests per second

0.0% (0 out of 131) of the missing items are queued
at least 1,000 queued builds
x86_64-linux: 490 (49.0%)
i686-linux: 353 (35.3%)
aarch64-linux: 133 (13.3%)
armhf-linux: 24 (2.4%)
build rate: 30.54 builds per hour
aarch64-linux: 4.21 builds per hour
i686-linux: 10.14 builds per hour
x86_64-linux: 11.45 builds per hour
armhf-linux: 4.73 builds per hour

Well, I have not pulled ’master’ since a couple of days but should be
the same, I guess. Yes, it is with f6a42ac:

72.4% substitutes available (336 out of 464)


All the best,
simon
L
L
Ludovic Courtès wrote on 16 Nov 2020 13:52
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)
87h7ppxy48.fsf@gnu.org
Hi,

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

Toggle quote (28 lines)
> Ludovic Courtès <ludo@gnu.org> writes:
>
>> Hi,
>>
>> Bengt Richter <bokr@bokr.com> skribis:
>>
>>> On +2020-11-13 10:41:38 +0100, Pierre Neidhardt wrote:
>>>> `guix repl` is a fantastic, hassle-free tool to bind Guix with
>>>> third-party languages. I've done it here:
>>>>
>>>> https://github.com/atlas-engineer/nyxt/blob/2-pre-release-4/libraries/ospama/ospama-guix.lisp
>>
>> I recommend using ‘guix repl -t machine’
>
> Looks like `-t machine` has the same issue.
> This does what I want:
>
> $ echo "(display \"Hi.\\n\")" | guix repl -t machine /dev/stdin
> Hi.
>
>
> This does not:
>
> $ echo "(display \"Hi.\\n\")" | guix repl -t machine
> (repl-version 0 1 1)
> Hi.
> (values (non-self-quoting 2052 "#<unspecified>"))

The general idea is that the REPL protocol allows you to offload
computations to the ‘guix repl’ process and to read the result of those
computations. Side effects such as writing to stdout are not treated,
but they’re mostly beyond the scope of ‘guix repl’.

Toggle quote (9 lines)
>> and keeping the REPL process around instead of respawning it for every
>> expression.
>
> At first glance, we would want to do this indeed.
>
> But in the case of Nyxt, there would be no point when to terminate the
> process, so it would be around for the whole time Nyxt is running, which
> may not be desirable.

I think it’s desirable since it saves on CPU costs.

Toggle quote (3 lines)
> Alternatively, I could simply keep it alive for a given duration (1
> minute?) and automatically spawn it if the process is dead.

Yes, that’s a reasonable tradeoff.

Thanks,
Ludo’.
P
P
Pierre Neidhardt wrote on 16 Nov 2020 17:11
(name . Ludovic Courtès)(address . ludo@gnu.org)
87a6vhb7sw.fsf@ambrevar.xyz
Perfect, thanks for the feedback!

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl+ypL8SHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/w8EIAKX3iyoYZgmWuuMNLo337wJdb7nv1CRS
52jVH+dh/1+9PB1iNwP3e5gTTc785ZswCQFUZvWn7rS5YwoXlRq6QlkcJOAhiKVe
Rhnk2EVjiDalKjXsC4QC7SRlikB/Dvp5kTMwmglfdqeebzGT/WaQMHCJdD6yQ7Mv
T7PfiYhBYC8EjnUbDqvoEmYIh+jyN6pWrm5GC0iIX5pzu9EysupWY1ZXkKRZG7j1
vtVz31mk1bNQ1a5u+NbE1vMiNLA/ka7jVeFEa8kLa0dlOSGFq3c25KmoPiR6h79z
ZNPj2eT4a63CNYDHjfZDCgy3FYteQb1ku3dGQM4ppYMKEVRli1sY0Rk=
=Jmnu
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 1 Dec 2020 08:52
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)(address . 44612@debbugs.gnu.org)
875z5mj73x.fsf@gnu.org
Hi!

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

Toggle quote (3 lines)
> It'd be better if we could send Guile code to the standard input of the
> `guix repl -` process to bypass file generation.

I think the thread derailed a bit, but in the end, this is already
possible, in particular with ‘guix repl -t machine’ (designed for this
purpose).

I’m closing, but we can always open a new issue if the need arises.

Thanks,
Ludo’.
L
L
Ludovic Courtès wrote on 1 Dec 2020 08:52
control message for bug #44612
(address . control@debbugs.gnu.org)
874kl6j73p.fsf@gnu.org
tags 44612 notabug
close 44612
quit
P
P
Pierre Neidhardt wrote on 1 Dec 2020 09:29
Re: bug#44612: Read standard input in `guix repl'
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 44612@debbugs.gnu.org)
87k0u2rkt6.fsf@ambrevar.xyz
Indeed, it works perfectly now, I've implemented your suggestions and
Nyxt is now running a "guix repl server" to which it sends all the
requests. It's awesome! :)

The only issue remaining is the weird behaviour that one has to pass
/dev/stdin to get rid of the welcome message:

echo '(display "Hi.\n")' | guix repl /dev/stdin
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl/F/uUSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/jn8H/1azkq9o934fuiBjN5xMPLaqEa/om712
Eynt45/ZyNUOUs4vzUWscKrfazpukPBoNTeB5l4u/YpOLS4hglh9U+rbTooJWyQn
A2G4d09b/4PaPyM9hSa5MHwjBwvIMs/zpE9109aa0Z4TaGl8Hc7aOUR5ly2Lr9nN
Bhk4k4VlA6bF2Nb9zNmUX9K6OkT+pEe2JoHJVbm3O1PYlJ7p1p5cQt+9MwvsD4z5
Fti2xG4AANXL842+IIizwQrVxSr0073Og2a0zII06fm8iz/HrX7K99p8DdBT2QOT
EuTDMHQgxnLeksBAoUdYAVY+4K3mL/EF9gmmy0yALOH7l510ZX3JhQk=
=JLmx
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 3 Dec 2020 11:22
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)(address . 44612@debbugs.gnu.org)
87zh2vgpex.fsf@gnu.org
Hi Pierre!

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

Toggle quote (9 lines)
> Indeed, it works perfectly now, I've implemented your suggestions and
> Nyxt is now running a "guix repl server" to which it sends all the
> requests. It's awesome! :)
>
> The only issue remaining is the weird behaviour that one has to pass
> /dev/stdin to get rid of the welcome message:
>
> echo '(display "Hi.\n")' | guix repl /dev/stdin

As discussed earlier, I think you should use ‘-t machine’, which doesn’t
have the welcome message. ‘-t guile’ (the default) is meant for humans,
not for inter-process communication.

Ludo’.
P
P
Pierre Neidhardt wrote on 3 Dec 2020 11:33
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 44612@debbugs.gnu.org)
87r1o7mb6r.fsf@ambrevar.xyz
Hi Ludo!

Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (4 lines)
> As discussed earlier, I think you should use ‘-t machine’, which doesn’t
> have the welcome message. ‘-t guile’ (the default) is meant for humans,
> not for inter-process communication.

Oh, for sure, I'm using `t machine` now.

All I meant is that the aforementioned behaviour highlights a
probable (harmless) bug, so if someone has got the time, they should
look at what `guix repl` is doing with stdin, something is fishy.

Cheers!

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQFGBAEBCAAwFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl/IvtwSHG1haWxAYW1i
cmV2YXIueHl6AAoJEJvc9Jeku8x/OuAIAIagFgsn1fzvToOiPyVVg8YWhpN+FRBN
7BYVlIIlyx06g59gfq3ElCqvdYJxtV0BEjibNX5HXBFO2Oax6LeQX9S7syW1mqRE
h6xomOsVcGDizAQzZZZpOYWe7XU/prFeOtf37tdTToE6JuyzD8RzfEMR8xI9FoI1
yYv1wiQb35Pen3IRIX7ngslyP6nd/S8p5qdvkQa7olM1Tfa09/arxxfhWd6gENzl
o/548hdZh9NzU/Bji07N8x8Yw2AH0MMbennMmuG+lh2Cuxx6KK6Vpzkft5awazDC
6uS/XpYWbBIfhj1zSaa86fAlbpG6RADvn3u0qSb1KzLc15rjDxWuz8U=
=iEyD
-----END PGP SIGNATURE-----

?