all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#58417: Installer script no longer works with `yes` utility
@ 2022-10-10 15:33 Jonas Freimuth
  2022-10-11 16:04 ` Maxim Cournoyer
  2022-10-11 16:26 ` Tobias Geerinckx-Rice
  0 siblings, 2 replies; 10+ messages in thread
From: Jonas Freimuth @ 2022-10-10 15:33 UTC (permalink / raw)
  To: 58417

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

Package: guix

Version: 1.4.0

Severity: important

Heyo,

I use the github `guix-install-action` 
(https://github.com/PromyLOPh/guix-install-action), which internally 
runs the `guix-install.sh` script non-interactively, via the yes utility:

```{bash}

bash -c 'yes | bash guix-install.sh'

```

However, since commit `6a2e303d3a49baf7c222a70b91f453e9efd456c6` 
(https://git.savannah.gnu.org/cgit/guix.git/commit/etc/guix-install.sh?id=6a2e303d3a49baf7c222a70b91f453e9efd456c6), 
this apparently causes the entire action to hang (leading to eventual 
termination by github).

I confirmed this behaviour by running the "Download", "Fetch Key", and 
"Install Guix" steps of the `guix-install-action` as root on a WSL2 
instance of Ubuntu20.04 (using todays wsl rootfs from 
https://cloud-images.ubuntu.com/focal/current/).

Running

```{bash}

sudo --preserve-env=GUIX_BINARY_FILE_NAME -- bash -c 'bash guix-install.sh'

```

instead of

```{bash}

sudo --preserve-env=GUIX_BINARY_FILE_NAME -- bash -c 'yes | bash 
guix-install.sh'

```

i.e. running the script interactively works fine.

Is this intended, or is there another suggested way to run the 
`guix-install.sh` script non-interactively?

Best wishes,

Jonas

[-- Attachment #2: Type: text/html, Size: 2258 bytes --]

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

* bug#58417: Installer script no longer works with `yes` utility
  2022-10-10 15:33 bug#58417: Installer script no longer works with `yes` utility Jonas Freimuth
@ 2022-10-11 16:04 ` Maxim Cournoyer
  2022-10-11 16:26 ` Tobias Geerinckx-Rice
  1 sibling, 0 replies; 10+ messages in thread
From: Maxim Cournoyer @ 2022-10-11 16:04 UTC (permalink / raw)
  To: Jonas Freimuth; +Cc: 58417-done

Hi,

Jonas Freimuth <jonas.freimuth@posteo.de> writes:

> Package: guix
>
> Version: 1.4.0
>
> Severity: important
>
> Heyo,
>
> I use the github `guix-install-action`
> (https://github.com/PromyLOPh/guix-install-action), which internally
> runs the `guix-install.sh` script non-interactively, via the yes
> utility:
>
> ```{bash}
>
> bash -c 'yes | bash guix-install.sh'

This should be fixed with e46bb5fd5a.  Please report back if it there
are still issues.

Thanks for reporting the issue, and apologies for the breakage!

-- 
Maxim




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

* Re: bug#58417: Installer script no longer works with `yes` utility
  2022-10-10 15:33 bug#58417: Installer script no longer works with `yes` utility Jonas Freimuth
  2022-10-11 16:04 ` Maxim Cournoyer
@ 2022-10-11 16:26 ` Tobias Geerinckx-Rice
  2022-10-11 18:38   ` zimoun
                     ` (2 more replies)
  1 sibling, 3 replies; 10+ messages in thread
From: Tobias Geerinckx-Rice @ 2022-10-11 16:26 UTC (permalink / raw)
  To: Jonas Freimuth, Maxim Cournoyer; +Cc: Guix-devel

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

[Shunted to guix-devel@]

Jonas Freimuth 写道:
> bash -c 'yes | bash guix-install.sh'

While this happens to work (again) now, that doesn't mean it 
always will or should be considered supported.

We should reserve the right to ask future questions to which the 
safe/sane/common answer is ‘no’, without phrasing it awkwardly 
just to make an unthinking stream of ‘y’s happy.

  $ guix-install.sh
  …
  Would you like to NOT enable the Cool Experimental Feature? 
  (DANGER) [Y/n]

Conversely, I'd like to add a comment that does commit to always 
keeping ‘yes '' | bash guix-install.sh’ working, assuming there 
was no other input or detected issues.  Also nice for humans in a 
hurry.

Does that seem unreasonable to anyone?

Kind regards,

T G-R

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

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

* Re: bug#58417: Installer script no longer works with `yes` utility
  2022-10-11 16:26 ` Tobias Geerinckx-Rice
@ 2022-10-11 18:38   ` zimoun
  2022-10-17  1:22     ` Maxim Cournoyer
  2022-10-11 19:29   ` Maxim Cournoyer
  2022-10-11 19:32   ` Maxim Cournoyer
  2 siblings, 1 reply; 10+ messages in thread
From: zimoun @ 2022-10-11 18:38 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice, Jonas Freimuth, Maxim Cournoyer; +Cc: Guix-devel

Hi Tobias,

On Tue, 11 Oct 2022 at 18:26, Tobias Geerinckx-Rice <me@tobias.gr> wrote:
> Jonas Freimuth 写道:

>> bash -c 'yes | bash guix-install.sh'
>
> While this happens to work (again) now, that doesn't mean it 
> always will or should be considered supported.
>
> We should reserve the right to ask future questions to which the 
> safe/sane/common answer is ‘no’, without phrasing it awkwardly 
> just to make an unthinking stream of ‘y’s happy.
>
>   $ guix-install.sh
>   …
>   Would you like to NOT enable the Cool Experimental Feature? 
>   (DANGER) [Y/n]

Personally, I am always confused by the negative form of a question. :-)


> Conversely, I'd like to add a comment that does commit to always 
> keeping ‘yes '' | bash guix-install.sh’ working, assuming there 
> was no other input or detected issues.  Also nice for humans in a 
> hurry.
>
> Does that seem unreasonable to anyone?

From my point of view, it could nice to have a way to run the
installation script without any human action.  For instance, install
Guix in some GitHub/Gitlab CI.


Cheers,
simon


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

* Re: bug#58417: Installer script no longer works with `yes` utility
  2022-10-11 16:26 ` Tobias Geerinckx-Rice
  2022-10-11 18:38   ` zimoun
@ 2022-10-11 19:29   ` Maxim Cournoyer
  2022-10-11 19:32   ` Maxim Cournoyer
  2 siblings, 0 replies; 10+ messages in thread
From: Maxim Cournoyer @ 2022-10-11 19:29 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: Jonas Freimuth, Guix-devel

Hi,

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

> [Shunted to guix-devel@]
>
> Jonas Freimuth 写道:
>> bash -c 'yes | bash guix-install.sh'
>
> While this happens to work (again) now, that doesn't mean it always
> will or should be considered supported.
>
> We should reserve the right to ask future questions to which the
> safe/sane/common answer is ‘no’, without phrasing it awkwardly just to
> make an unthinking stream of ‘y’s happy.
>
>  $ guix-install.sh
>  …
>  Would you like to NOT enable the Cool Experimental Feature?
>  (DANGER) [Y/n]
>
> Conversely, I'd like to add a comment that does commit to always
> keeping ‘yes '' | bash guix-install.sh’ working, assuming there was no
> other input or detected issues.  Also nice for humans in a hurry.
>
> Does that seem unreasonable to anyone?

To the contrary, that seems pretty reasonable.  You may be interested in
this version of a biased prompt, gracefully shared by Earnestly from
#bash:

--8<---------------cut here---------------start------------->8---
confirm() {
    local -l reply
    local prompt bias=$1
    shift

    case $bias in
        yes) prompt=Y/n ;;
        no)  prompt=y/N
    esac

    # shellcheck disable=SC2059
    printf -- "\033[1m* $1 [$prompt]\033[0m " "${@:2}"
    read -r reply

    case $bias in
        yes) [[ $reply = y || ! $reply ]] ;;
        no)  [[ $reply = y ]]
    esac
}
--8<---------------cut here---------------end--------------->8---

The first arguments is the default argument (yes or no).  The rest works
the same (but they used printf to format things).  We can adapt our
version with that.

If you make the change you'll want to write a news so that 'yes' users
can transition to "yes ''".

-- 
Thanks,
Maxim


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

* Re: bug#58417: Installer script no longer works with `yes` utility
  2022-10-11 16:26 ` Tobias Geerinckx-Rice
  2022-10-11 18:38   ` zimoun
  2022-10-11 19:29   ` Maxim Cournoyer
@ 2022-10-11 19:32   ` Maxim Cournoyer
  2 siblings, 0 replies; 10+ messages in thread
From: Maxim Cournoyer @ 2022-10-11 19:32 UTC (permalink / raw)
  To: Tobias Geerinckx-Rice; +Cc: Jonas Freimuth, Guix-devel

Hi again,

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

> [Shunted to guix-devel@]
>
> Jonas Freimuth 写道:
>> bash -c 'yes | bash guix-install.sh'
>
> While this happens to work (again) now, that doesn't mean it always
> will or should be considered supported.
>
> We should reserve the right to ask future questions to which the
> safe/sane/common answer is ‘no’, without phrasing it awkwardly just to
> make an unthinking stream of ‘y’s happy.
>
>  $ guix-install.sh
>  …
>  Would you like to NOT enable the Cool Experimental Feature?
>  (DANGER) [Y/n]
>
> Conversely, I'd like to add a comment that does commit to always
> keeping ‘yes '' | bash guix-install.sh’ working, assuming there was no
> other input or detected issues.  Also nice for humans in a hurry.
>
> Does that seem unreasonable to anyone?

I forgot to add: I think we should only introduce such a change if/when
the need occurs.  We may never need it, and having a 'yes' only bias
forces us to offer only quality additions that we think users ought to
want enabled ;-).

-- 
Thanks,
Maxim


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

* Re: bug#58417: Installer script no longer works with `yes` utility
  2022-10-11 18:38   ` zimoun
@ 2022-10-17  1:22     ` Maxim Cournoyer
  2022-10-17  7:55       ` zimoun
  0 siblings, 1 reply; 10+ messages in thread
From: Maxim Cournoyer @ 2022-10-17  1:22 UTC (permalink / raw)
  To: zimoun; +Cc: Tobias Geerinckx-Rice, Jonas Freimuth, Guix-devel

Hi Simon,

zimoun <zimon.toutoune@gmail.com> writes:

[...]

>> Conversely, I'd like to add a comment that does commit to always 
>> keeping ‘yes '' | bash guix-install.sh’ working, assuming there 
>> was no other input or detected issues.  Also nice for humans in a 
>> hurry.
>>
>> Does that seem unreasonable to anyone?
>
> From my point of view, it could nice to have a way to run the
> installation script without any human action.  For instance, install
> Guix in some GitHub/Gitlab CI.

If I understood Tobias, they were not suggesting to make the
non-interactive installation use case harder/impossible, just to change
it from 'yes | ./install.sh' to 'yes "" | ./install.sh', which would
give us the freedom to choose a default value of either yes or no for
each question.

Hope that helps!

-- 
Thanks,
Maxim


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

* Re: bug#58417: Installer script no longer works with `yes` utility
  2022-10-17  1:22     ` Maxim Cournoyer
@ 2022-10-17  7:55       ` zimoun
  2022-10-17 21:22         ` Maxim Cournoyer
  0 siblings, 1 reply; 10+ messages in thread
From: zimoun @ 2022-10-17  7:55 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: Tobias Geerinckx-Rice, Jonas Freimuth, Guix-devel

Hi Maxim,

On dim., 16 oct. 2022 at 21:22, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:

> If I understood Tobias, they were not suggesting to make the
> non-interactive installation use case harder/impossible, just to change
> it from 'yes | ./install.sh' to 'yes "" | ./install.sh', which would
> give us the freedom to choose a default value of either yes or no for
> each question.

Thanks for explaining.

IIUC, is the point to have 'default | ./install.sh'?


Cheers,
simon


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

* Re: bug#58417: Installer script no longer works with `yes` utility
  2022-10-17  7:55       ` zimoun
@ 2022-10-17 21:22         ` Maxim Cournoyer
  2022-10-17 21:58           ` zimoun
  0 siblings, 1 reply; 10+ messages in thread
From: Maxim Cournoyer @ 2022-10-17 21:22 UTC (permalink / raw)
  To: zimoun; +Cc: Tobias Geerinckx-Rice, Jonas Freimuth, Guix-devel

Hi,

zimoun <zimon.toutoune@gmail.com> writes:

> Hi Maxim,
>
> On dim., 16 oct. 2022 at 21:22, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:
>
>> If I understood Tobias, they were not suggesting to make the
>> non-interactive installation use case harder/impossible, just to change
>> it from 'yes | ./install.sh' to 'yes "" | ./install.sh', which would
>> give us the freedom to choose a default value of either yes or no for
>> each question.
>
> Thanks for explaining.
>
> IIUC, is the point to have 'default | ./install.sh'?

What do you mean by 'default | ./install.sh' ?  I think Tobias' point
was to have the ability for a newline (RET) to mean either YES or NO,
compared to the current case where it always mean YES.  "yes ''" does
this: enter nothing then RET, repeatedly.

-- 
Thanks,
Maxim


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

* Re: bug#58417: Installer script no longer works with `yes` utility
  2022-10-17 21:22         ` Maxim Cournoyer
@ 2022-10-17 21:58           ` zimoun
  0 siblings, 0 replies; 10+ messages in thread
From: zimoun @ 2022-10-17 21:58 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: Tobias Geerinckx-Rice, Jonas Freimuth, Guix-devel

Hi,

On Mon, 17 Oct 2022 at 17:22, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:

> What do you mean by 'default | ./install.sh' ?

Nothing relevant. :-)

>                                                 I think Tobias' point
> was to have the ability for a newline (RET) to mean either YES or NO,
> compared to the current case where it always mean YES.  "yes ''" does
> this: enter nothing then RET, repeatedly.

Ah, yes.  For sure.   Sorry for the noise.


Cheers,
simon


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

end of thread, other threads:[~2022-10-18 10:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-10 15:33 bug#58417: Installer script no longer works with `yes` utility Jonas Freimuth
2022-10-11 16:04 ` Maxim Cournoyer
2022-10-11 16:26 ` Tobias Geerinckx-Rice
2022-10-11 18:38   ` zimoun
2022-10-17  1:22     ` Maxim Cournoyer
2022-10-17  7:55       ` zimoun
2022-10-17 21:22         ` Maxim Cournoyer
2022-10-17 21:58           ` zimoun
2022-10-11 19:29   ` Maxim Cournoyer
2022-10-11 19:32   ` Maxim Cournoyer

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.