From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?G=C3=A1bor?= Boskovits Subject: bug#38529: Make --ad-hoc the default for guix environment proposed deprecation mechanism Date: Thu, 12 Dec 2019 21:54:41 +0100 Message-ID: References: <87eexeu8mo.fsf@ambrevar.xyz> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000000a512b059987f5d8" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:39655) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ifVVE-0004ip-Ev for bug-guix@gnu.org; Thu, 12 Dec 2019 15:56:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ifVVC-0005Xj-Kt for bug-guix@gnu.org; Thu, 12 Dec 2019 15:56:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:54985) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ifVVB-0005XD-V9 for bug-guix@gnu.org; Thu, 12 Dec 2019 15:56:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ifVVB-0003zK-U5 for bug-guix@gnu.org; Thu, 12 Dec 2019 15:56:01 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: zimoun Cc: Guix-devel , 38529@debbugs.gnu.org --0000000000000a512b059987f5d8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, zimoun ezt =C3=ADrta (id=C5=91pont: 2019. dec. 1= 2., Cs=C3=BC 17:47): > Hi G=C3=A1bor, > > Thank you for summarizing the discussion on IRC that I missed. > > Maybe I miss a point. Is the aim to conserve the "--ad-hoc" option > with a different effect? Or why do we want to conserve this option > name? > It appears to me simpler to give another name, for example > "--inputs-of". And it is more meaningful. > Sorry for the confusion. Ad-hoc should be retained with the same effect, so that we do not break existing scripts. Renamin the option would be ok. It even makes sense to me. > > > To be concrete, the different cases; (-) means current behavior and > (+) the new one: > > 1. > - guix environment foo > + guix environment --inputs-of foo > > 2. > - guix environment --ad-hoc bar > + guix environment bar > > > First, when "--ad-hoc" is used then it reports a warning: deprecated > option and falls in the current behavior. > When "--inputs-of" is used then it falls in the new behavior. > Therefore, no needs of the ugly "--ignore-deprecated-ad-hoc". > That could be done. The problem is caused by uses of guix environment that does not use any of these options. Those mean different things after the change. > > > In other words, with the same future guix version, > > # Alice > $ guix environment foo --ad-hoc bar > Warning: deprecated... explanations... > instead use: > guix environment bar --inputs-of foo > > # Bob > $ guix environment bar --inputs-of foo > > > Second, the previous "guix environment foo" (dependencies of foo) is > inconsistent with the new "guix environment bar" (only the package > bar). Therefore, let introduce the GUIX_ENVIRONMENT_DEPRECATED > variable to distinguish both, as you said. > Ok. > > # Alice > $ guix environment foo > Warning: previous behavior requires GUIX_ENVIRONMENT_DEPRECATED=3D1 > turn off the warning: GUIX_ENVIRONMENT_NOWARNING=3D1 > > And Alice has now a new shell with the package foo. If she wants the > dependencies, she has two options: > > $ GUIX_ENVIRONMENT=3D1 guix environment foo > or > $ guix environment --inputs-of foo > > > # Bob > $ guix environment bar > Warning: previous behavior requires GUIX_ENVIRONMENT > > And if Bob is annoyed by the warnings each time, he globally turns off > with the variable GUIX_ENVIRONMENT_NOWARNING=3D1. > > > Couple of months later -- after the period adoption -- we remove the > variables GUIX_ENVIRONMENT_NOWARNING and GUIX_ENVIRONMENT_DEPRECATED; > still keeping the warning with the "--ad-hoc" option. And then, after > we can remove the "--ad-hoc" option if required. > > > Maybe a miss a point. But the addition of the flag appears > "--too-long-to-type" to me ugly. > We could recommend simply to use something like: GUIX_ENVIRONMENT_DEPRECATED=3D0 guix environment ... Instead in existing scripts that are fixed to use the new syntax. This indeed looks like a better solution, and it is less of a maintenance burden. Good idea. > > > What do you think? > > All the best, > simon > Summarizing: Introduce the environment variable. For fixed scripts recommend unsetting the environment variable. That looks like a better plan. Thanks for your insights. Best regards, g_bor > --0000000000000a512b059987f5d8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

zimoun <zimon.toutoune@gmail.com> ezt =C3=ADrta (id=C5=91pont: 2019. = dec. 12., Cs=C3=BC 17:47):
Hi G=C3= =A1bor,

Thank you for summarizing the discussion on IRC that I missed.

Maybe I miss a point. Is the aim to conserve the "--ad-hoc" optio= n
with a different effect? Or why do we want to conserve this option
name?
It appears to me simpler to give another name, for example
"--inputs-of". And it is more meaningful.
<= /div>
Sorry for the confusion. Ad-hoc should be retained w= ith the same effect, so that we do not break existing scripts.
Renamin the option would be ok. It even makes sense to me.
=


To be concrete, the different cases; (-) means current behavior and
(+) the new one:

1.
- guix environment foo
+ guix environment --inputs-of foo

2.
- guix environment --ad-hoc bar
+ guix environment bar


First, when "--ad-hoc" is used then it reports a warning: depreca= ted
option and falls in the current behavior.
When "--inputs-of" is used then it falls in the new behavior.
Therefore, no needs of the ugly "--ignore-deprecated-ad-hoc".
=
That could be done. The problem = is caused by uses of guix environment that does not use any of these option= s. Those mean different things after the change.


In other words, with the same future guix version,

=C2=A0# Alice
=C2=A0$ guix environment foo --ad-hoc bar
=C2=A0Warning: deprecated... explanations...
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0instead use:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 guix environment ba= r --inputs-of foo

=C2=A0# Bob
=C2=A0$ guix environment bar --inputs-of foo


Second, the previous "guix environment foo" (dependencies of foo)= is
inconsistent with the new "guix environment bar" (only the packag= e
bar). Therefore, let introduce the GUIX_ENVIRONMENT_DEPRECATED
variable to distinguish both, as you said.
Ok.

=C2=A0# Alice
=C2=A0$ guix environment foo
=C2=A0Warning: previous behavior requires GUIX_ENVIRONMENT_DEPRECATED=3D1 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0turn off the warning= : GUIX_ENVIRONMENT_NOWARNING=3D1

And Alice has now a new shell with the package foo. If she wants the
dependencies, she has two options:

$ GUIX_ENVIRONMENT=3D1 guix environment foo
or
$ guix environment --inputs-of foo


=C2=A0# Bob
=C2=A0$ guix environment bar
=C2=A0Warning: previous behavior requires GUIX_ENVIRONMENT

And if Bob is annoyed by the warnings each time, he globally turns off
with the variable GUIX_ENVIRONMENT_NOWARNING=3D1.


Couple of months later -- after the period adoption -- we remove the
variables GUIX_ENVIRONMENT_NOWARNING and GUIX_ENVIRONMENT_DEPRECATED;
still keeping the warning with the "--ad-hoc" option. And then, a= fter
we can remove the "--ad-hoc" option if required.


Maybe a miss a point. But the addition of the flag appears
"--too-long-to-type" to me ugly.
We could recommend simply to use something like:
GUIX_ENVIRONMENT_DEPRECATED=3D0 guix environment ...
Instead in existing scripts that are fixed to use the new synta= x. This indeed looks like a better solution, and it is less of a maintenanc= e burden. Good idea.


What do you think?

All the best,
simon

Summarizing:
Introduce the environment variable= .
For fixed scripts recommend unsetting the environm= ent variable.

That looks= like a better plan. Thanks for your insights.

<= /div>
Best regards,
g_bor
--0000000000000a512b059987f5d8--