unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / Atom feed
* bug#44612: Read standard input in `guix repl'
@ 2020-11-13  9:41 Pierre Neidhardt
  2020-11-13 19:08 ` Bengt Richter
                   ` (2 more replies)
  0 siblings, 3 replies; 35+ messages in thread
From: Pierre Neidhardt @ 2020-11-13  9:41 UTC (permalink / raw)
  To: 44612

[-- Attachment #1: Type: text/plain, Size: 538 bytes --]

`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?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-13  9:41 bug#44612: Read standard input in `guix repl' Pierre Neidhardt
@ 2020-11-13 19:08 ` Bengt Richter
  2020-11-13 22:24   ` zimoun
  2020-11-16  9:25   ` Ludovic Courtès
  2020-11-13 20:27 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2020-12-01  7:52 ` Ludovic Courtès
  2 siblings, 2 replies; 35+ messages in thread
From: Bengt Richter @ 2020-11-13 19:08 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 44612

Hi Pierre,

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
> 
> 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.

> -- 
> Pierre Neidhardt
> https://ambrevar.xyz/

-- 
Regards,
Bengt Richter




^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-13  9:41 bug#44612: Read standard input in `guix repl' Pierre Neidhardt
  2020-11-13 19:08 ` Bengt Richter
@ 2020-11-13 20:27 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2020-11-14  9:52   ` Pierre Neidhardt
  2020-12-01  7:52 ` Ludovic Courtès
  2 siblings, 1 reply; 35+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2020-11-13 20:27 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 382 bytes --]

Pierre,

Pierre Neidhardt 写道:
> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-13 19:08 ` Bengt Richter
@ 2020-11-13 22:24   ` zimoun
  2020-11-16  9:25   ` Ludovic Courtès
  1 sibling, 0 replies; 35+ messages in thread
From: zimoun @ 2020-11-13 22:24 UTC (permalink / raw)
  To: Bengt Richter, Pierre Neidhardt; +Cc: 44612

Dear,

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

> 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,

--8<---------------cut here---------------start------------->8---
$ 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")
--8<---------------cut here---------------end--------------->8---

All the best,
simon




^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-13 20:27 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
@ 2020-11-14  9:52   ` Pierre Neidhardt
  2020-11-14 11:23     ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2020-11-14 12:09     ` zimoun
  0 siblings, 2 replies; 35+ messages in thread
From: Pierre Neidhardt @ 2020-11-14  9:52 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 341 bytes --]

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.

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14  9:52   ` Pierre Neidhardt
@ 2020-11-14 11:23     ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2020-11-14 13:19       ` Pierre Neidhardt
  2020-11-14 13:24       ` Pierre Neidhardt
  2020-11-14 12:09     ` zimoun
  1 sibling, 2 replies; 35+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2020-11-14 11:23 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 44612


[-- Attachment #1.1: Type: text/plain, Size: 650 bytes --]

Pierre,

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

Pierre Neidhardt 写道:
> 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 #1.2: nyxt.log --]
[-- Type: application/octet-stream, Size: 134347 bytes --]

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14  9:52   ` Pierre Neidhardt
  2020-11-14 11:23     ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
@ 2020-11-14 12:09     ` zimoun
  1 sibling, 0 replies; 35+ messages in thread
From: zimoun @ 2020-11-14 12:09 UTC (permalink / raw)
  To: Pierre Neidhardt, Tobias Geerinckx-Rice; +Cc: 44612

Hi Pierre,

On Sat, 14 Nov 2020 at 10:52, Pierre Neidhardt <mail@ambrevar.xyz> wrote:
> 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 ’|’:

--8<---------------cut here---------------start------------->8---
$ 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)>
$ 
--8<---------------cut here---------------end--------------->8---

Another example here:

  <https://yhetil.org/guix-bugs/86mtzkdhet.fsf@tournier.info>


Please look at the details.

All the best,
simon




^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 11:23     ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
@ 2020-11-14 13:19       ` Pierre Neidhardt
  2020-11-14 13:58         ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2020-11-14 15:43         ` Christopher Baines
  2020-11-14 13:24       ` Pierre Neidhardt
  1 sibling, 2 replies; 35+ messages in thread
From: Pierre Neidhardt @ 2020-11-14 13:19 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 1533 bytes --]

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?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 11:23     ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2020-11-14 13:19       ` Pierre Neidhardt
@ 2020-11-14 13:24       ` Pierre Neidhardt
  2020-11-14 14:12         ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  1 sibling, 1 reply; 35+ messages in thread
From: Pierre Neidhardt @ 2020-11-14 13:24 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 485 bytes --]

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?

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
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 13:19       ` Pierre Neidhardt
@ 2020-11-14 13:58         ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2020-11-14 15:03           ` Guillaume Le Vaillant
  2020-11-14 16:11           ` Pierre Neidhardt
  2020-11-14 15:43         ` Christopher Baines
  1 sibling, 2 replies; 35+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2020-11-14 13:58 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 1966 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 13:24       ` Pierre Neidhardt
@ 2020-11-14 14:12         ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2020-11-14 16:05           ` Pierre Neidhardt
  0 siblings, 1 reply; 35+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2020-11-14 14:12 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 1004 bytes --]

Pierre Neidhardt 写道:
> 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.

> 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.

> Or is it a reproducibility issue?

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

Kind regards,

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 13:58         ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
@ 2020-11-14 15:03           ` Guillaume Le Vaillant
  2020-11-14 15:07             ` Guillaume Le Vaillant
  2020-11-14 15:22             ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2020-11-14 16:11           ` Pierre Neidhardt
  1 sibling, 2 replies; 35+ messages in thread
From: Guillaume Le Vaillant @ 2020-11-14 15:03 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: mail, 44612

[-- Attachment #1: Type: text/plain, Size: 2253 bytes --]


Tobias Geerinckx-Rice via Bug reports for GNU Guix <bug-guix@gnu.org> skribis:

> 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 15:03           ` Guillaume Le Vaillant
@ 2020-11-14 15:07             ` Guillaume Le Vaillant
  2020-11-14 16:06               ` Pierre Neidhardt
  2020-11-14 15:22             ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  1 sibling, 1 reply; 35+ messages in thread
From: Guillaume Le Vaillant @ 2020-11-14 15:07 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: mail, 44612

[-- Attachment #1: Type: text/plain, Size: 251 bytes --]


Guillaume Le Vaillant <glv@posteo.net> skribis:

> 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 15:03           ` Guillaume Le Vaillant
  2020-11-14 15:07             ` Guillaume Le Vaillant
@ 2020-11-14 15:22             ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2020-11-14 15:36               ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  1 sibling, 1 reply; 35+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2020-11-14 15:22 UTC (permalink / raw)
  To: Guillaume Le Vaillant; +Cc: 44612, mail

[-- Attachment #1: Type: text/plain, Size: 486 bytes --]

Guillaume,

Guillaume Le Vaillant 写道:
> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 15:22             ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
@ 2020-11-14 15:36               ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  0 siblings, 0 replies; 35+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2020-11-14 15:36 UTC (permalink / raw)
  Cc: glv, 44612, mail

[-- Attachment #1: Type: text/plain, Size: 214 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 13:19       ` Pierre Neidhardt
  2020-11-14 13:58         ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
@ 2020-11-14 15:43         ` Christopher Baines
  2020-11-14 16:03           ` Pierre Neidhardt
  1 sibling, 1 reply; 35+ messages in thread
From: Christopher Baines @ 2020-11-14 15:43 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 1737 bytes --]


Pierre Neidhardt <mail@ambrevar.xyz> writes:

> 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?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 15:43         ` Christopher Baines
@ 2020-11-14 16:03           ` Pierre Neidhardt
  0 siblings, 0 replies; 35+ messages in thread
From: Pierre Neidhardt @ 2020-11-14 16:03 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 662 bytes --]

Hi Chris!

Christopher Baines <mail@cbaines.net> writes:

>> 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:

--8<---------------cut here---------------start------------->8---
> echo '(display "Hi.\n")' | guix repl -t machine 2>/dev/null
(repl-version 0 1 1)
Hi.
(values (non-self-quoting 2052 "#<unspecified>"))
--8<---------------cut here---------------end--------------->8---

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 14:12         ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
@ 2020-11-14 16:05           ` Pierre Neidhardt
  2020-11-14 16:13             ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  0 siblings, 1 reply; 35+ messages in thread
From: Pierre Neidhardt @ 2020-11-14 16:05 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 468 bytes --]

I think this is the old non-UTF8 encoding grafting issue (if you ask me,
I'll send you the link).  Try:

--8<---------------cut here---------------start------------->8---
guix build --no-grafts nyxt
--8<---------------cut here---------------end--------------->8---

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
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 15:07             ` Guillaume Le Vaillant
@ 2020-11-14 16:06               ` Pierre Neidhardt
  0 siblings, 0 replies; 35+ messages in thread
From: Pierre Neidhardt @ 2020-11-14 16:06 UTC (permalink / raw)
  To: Guillaume Le Vaillant, Tobias Geerinckx-Rice; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 126 bytes --]

Fantastic, this works!

Thanks a lot, Guillaume!

I'll update Nyxt then.

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 13:58         ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2020-11-14 15:03           ` Guillaume Le Vaillant
@ 2020-11-14 16:11           ` Pierre Neidhardt
  1 sibling, 0 replies; 35+ messages in thread
From: Pierre Neidhardt @ 2020-11-14 16:11 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 1433 bytes --]

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

> 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.


> if we want to debug Nyxt? :-)

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

>> 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:

--8<---------------cut here---------------start------------->8---
(require :uiop)
(with-input-from-string (s "(display \"foo\\n\")")
  (uiop:run-program '("guix" "repl") :input s :output :string :error-output nil))
--8<---------------cut here---------------end--------------->8---

> 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
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 16:05           ` Pierre Neidhardt
@ 2020-11-14 16:13             ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2020-11-14 16:25               ` Pierre Neidhardt
  0 siblings, 1 reply; 35+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2020-11-14 16:13 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 146 bytes --]

Pierre Neidhardt 写道:
> guix build --no-grafts nyxt

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

Kind regards,

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 16:13             ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
@ 2020-11-14 16:25               ` Pierre Neidhardt
  2020-11-14 17:08                 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  0 siblings, 1 reply; 35+ messages in thread
From: Pierre Neidhardt @ 2020-11-14 16:25 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 186 bytes --]

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
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 16:25               ` Pierre Neidhardt
@ 2020-11-14 17:08                 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2020-11-14 17:21                   ` Pierre Neidhardt
  0 siblings, 1 reply; 35+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2020-11-14 17:08 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 600 bytes --]

Pierre Neidhardt 写道:
> Does building sbcl-dexador work for you?

Yes, even with multiple cores & grafts enabled.

> 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?

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

  Always has been,
    /
T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 17:08                 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
@ 2020-11-14 17:21                   ` Pierre Neidhardt
  2020-11-14 17:33                     ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  0 siblings, 1 reply; 35+ messages in thread
From: Pierre Neidhardt @ 2020-11-14 17:21 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 606 bytes --]

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.

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 17:21                   ` Pierre Neidhardt
@ 2020-11-14 17:33                     ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2020-11-14 19:08                       ` zimoun
  0 siblings, 1 reply; 35+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2020-11-14 17:33 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 1186 bytes --]

Pierre Neidhardt 写道:
> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 17:33                     ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
@ 2020-11-14 19:08                       ` zimoun
  2020-11-16 10:45                         ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  0 siblings, 1 reply; 35+ messages in thread
From: zimoun @ 2020-11-14 19:08 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice, Pierre Neidhardt; +Cc: 44612

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:

>> Commit 403ba4140f52b9ea9483e4c775f102bbb9753e51.

[..]

>> /gnu/store/bdi8dq8i3f59zxp7jrabas847dh80m7x-nyxt-2-pre-release-4.drv

[..]

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

[..]

>   $ 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.


--8<---------------cut here---------------start------------->8---
$ 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
--8<---------------cut here---------------end--------------->8---


Cheers,
simon




^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-13 19:08 ` Bengt Richter
  2020-11-13 22:24   ` zimoun
@ 2020-11-16  9:25   ` Ludovic Courtès
  2020-11-16 11:36     ` Pierre Neidhardt
  1 sibling, 1 reply; 35+ messages in thread
From: Ludovic Courtès @ 2020-11-16  9:25 UTC (permalink / raw)
  To: Bengt Richter; +Cc: Pierre Neidhardt, 44612

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’ and keeping the REPL process
around instead of respawning it for every expression.

Ludo’.




^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-14 19:08                       ` zimoun
@ 2020-11-16 10:45                         ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  2020-11-16 11:38                           ` zimoun
  0 siblings, 1 reply; 35+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2020-11-16 10:45 UTC (permalink / raw)
  To: zimoun; +Cc: Pierre Neidhardt, 44612

[-- Attachment #1: Type: text/plain, Size: 215 bytes --]

Simon,

zimoun 写道:
> 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-16  9:25   ` Ludovic Courtès
@ 2020-11-16 11:36     ` Pierre Neidhardt
  2020-11-16 11:53       ` Pierre Neidhardt
  2020-11-16 12:52       ` Ludovic Courtès
  0 siblings, 2 replies; 35+ messages in thread
From: Pierre Neidhardt @ 2020-11-16 11:36 UTC (permalink / raw)
  To: Ludovic Courtès, Bengt Richter; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 1513 bytes --]

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:

--8<---------------cut here---------------start------------->8---
$ echo "(display \"Hi.\\n\")" | guix repl -t machine /dev/stdin
Hi.
--8<---------------cut here---------------end--------------->8---

This does not:

--8<---------------cut here---------------start------------->8---
$ echo "(display \"Hi.\\n\")" | guix repl -t machine  
(repl-version 0 1 1)
Hi.
(values (non-self-quoting 2052 "#<unspecified>"))
--8<---------------cut here---------------end--------------->8---

> 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
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-16 10:45                         ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
@ 2020-11-16 11:38                           ` zimoun
  0 siblings, 0 replies; 35+ messages in thread
From: zimoun @ 2020-11-16 11:38 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: Pierre Neidhardt, 44612

Hi Tobias,

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

> What exactly downloads the world?

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

--8<---------------cut here---------------start------------->8---
$ 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
--8<---------------cut here---------------end--------------->8---

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




^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-16 11:36     ` Pierre Neidhardt
@ 2020-11-16 11:53       ` Pierre Neidhardt
  2020-11-16 12:52       ` Ludovic Courtès
  1 sibling, 0 replies; 35+ messages in thread
From: Pierre Neidhardt @ 2020-11-16 11:53 UTC (permalink / raw)
  To: Ludovic Courtès, Bengt Richter; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 387 bytes --]

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
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-16 11:36     ` Pierre Neidhardt
  2020-11-16 11:53       ` Pierre Neidhardt
@ 2020-11-16 12:52       ` Ludovic Courtès
  2020-11-16 16:11         ` Pierre Neidhardt
  1 sibling, 1 reply; 35+ messages in thread
From: Ludovic Courtès @ 2020-11-16 12:52 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 44612

Hi,

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

> 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’.

>> 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.

> 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’.




^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-16 12:52       ` Ludovic Courtès
@ 2020-11-16 16:11         ` Pierre Neidhardt
  0 siblings, 0 replies; 35+ messages in thread
From: Pierre Neidhardt @ 2020-11-16 16:11 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 83 bytes --]

Perfect, thanks for the feedback!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-11-13  9:41 bug#44612: Read standard input in `guix repl' Pierre Neidhardt
  2020-11-13 19:08 ` Bengt Richter
  2020-11-13 20:27 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
@ 2020-12-01  7:52 ` Ludovic Courtès
  2020-12-01  8:29   ` Pierre Neidhardt
  2 siblings, 1 reply; 35+ messages in thread
From: Ludovic Courtès @ 2020-12-01  7:52 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 44612

Hi!

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

> 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’.




^ permalink raw reply	[flat|nested] 35+ messages in thread

* bug#44612: Read standard input in `guix repl'
  2020-12-01  7:52 ` Ludovic Courtès
@ 2020-12-01  8:29   ` Pierre Neidhardt
  0 siblings, 0 replies; 35+ messages in thread
From: Pierre Neidhardt @ 2020-12-01  8:29 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 44612

[-- Attachment #1: Type: text/plain, Size: 331 bytes --]

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


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2020-12-01  8:30 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13  9:41 bug#44612: Read standard input in `guix repl' Pierre Neidhardt
2020-11-13 19:08 ` Bengt Richter
2020-11-13 22:24   ` zimoun
2020-11-16  9:25   ` Ludovic Courtès
2020-11-16 11:36     ` Pierre Neidhardt
2020-11-16 11:53       ` Pierre Neidhardt
2020-11-16 12:52       ` Ludovic Courtès
2020-11-16 16:11         ` Pierre Neidhardt
2020-11-13 20:27 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2020-11-14  9:52   ` Pierre Neidhardt
2020-11-14 11:23     ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2020-11-14 13:19       ` Pierre Neidhardt
2020-11-14 13:58         ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2020-11-14 15:03           ` Guillaume Le Vaillant
2020-11-14 15:07             ` Guillaume Le Vaillant
2020-11-14 16:06               ` Pierre Neidhardt
2020-11-14 15:22             ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2020-11-14 15:36               ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2020-11-14 16:11           ` Pierre Neidhardt
2020-11-14 15:43         ` Christopher Baines
2020-11-14 16:03           ` Pierre Neidhardt
2020-11-14 13:24       ` Pierre Neidhardt
2020-11-14 14:12         ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2020-11-14 16:05           ` Pierre Neidhardt
2020-11-14 16:13             ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2020-11-14 16:25               ` Pierre Neidhardt
2020-11-14 17:08                 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2020-11-14 17:21                   ` Pierre Neidhardt
2020-11-14 17:33                     ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2020-11-14 19:08                       ` zimoun
2020-11-16 10:45                         ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2020-11-16 11:38                           ` zimoun
2020-11-14 12:09     ` zimoun
2020-12-01  7:52 ` Ludovic Courtès
2020-12-01  8:29   ` Pierre Neidhardt

unofficial mirror of bug-guix@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guix-bugs/0 guix-bugs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-bugs guix-bugs/ https://yhetil.org/guix-bugs \
		bug-guix@gnu.org
	public-inbox-index guix-bugs

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.gnu.guix.bugs
	nntp://news.gmane.io/gmane.comp.gnu.guix.bugs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git