all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#66605] [PATCH] etc: gitconfig: Run etc/teams.scm from correct environment.
@ 2023-10-18 12:05 Clément Lassieur
  2023-10-18 17:54 ` Maxim Cournoyer
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Clément Lassieur @ 2023-10-18 12:05 UTC (permalink / raw)
  To: 66605; +Cc: Clément Lassieur, Maxim Cournoyer

* etc/git/gitconfig: Prepend "guix shell -D guix --pure ./pre-inst-env" to the
etc/teams.scm script so that any user that have git:send-email installed can
use it in the Guix checkout without changing their environment.
---
 etc/git/gitconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/etc/git/gitconfig b/etc/git/gitconfig
index 907ad0180454..757360220155 100644
--- a/etc/git/gitconfig
+++ b/etc/git/gitconfig
@@ -14,5 +14,5 @@
 
 [sendemail]
         to = guix-patches@gnu.org
-        headerCmd = etc/teams.scm cc-members-header-cmd
+        headerCmd = guix shell -D guix --pure -- ./pre-inst-env etc/teams.scm cc-members-header-cmd
         thread = no

base-commit: 5498835bb38c0de57f284f0fa6b1178ecdcaf678
prerequisite-patch-id: d95e49e4fc059972fc5a7b2c92816df2228a0af1
prerequisite-patch-id: a0dca8c3175d6ce71c77e220c4ac98b6e97cef56
-- 
2.41.0





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

* [bug#66605] [PATCH] etc: gitconfig: Run etc/teams.scm from correct environment.
  2023-10-18 12:05 [bug#66605] [PATCH] etc: gitconfig: Run etc/teams.scm from correct environment Clément Lassieur
@ 2023-10-18 17:54 ` Maxim Cournoyer
  2023-10-18 20:52   ` Clément Lassieur
  2023-10-18 21:50 ` [bug#66605] [PATCH v2] " Clément Lassieur
  2023-10-22 20:07 ` [bug#66605] [PATCH v5] " Maxim Cournoyer
  2 siblings, 1 reply; 11+ messages in thread
From: Maxim Cournoyer @ 2023-10-18 17:54 UTC (permalink / raw)
  To: Clément Lassieur; +Cc: 66605

Hi,

Clément Lassieur <clement@lassieur.org> writes:

> * etc/git/gitconfig: Prepend "guix shell -D guix --pure ./pre-inst-env" to the
> etc/teams.scm script so that any user that have git:send-email installed can
> use it in the Guix checkout without changing their environment.

I'm not sure I understand; why does etc/teams.scm cc-members-header-cmd
fail in an environment where git:send-email is available?

-- 
Thanks,
Maxim




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

* [bug#66605] [PATCH] etc: gitconfig: Run etc/teams.scm from correct environment.
  2023-10-18 17:54 ` Maxim Cournoyer
@ 2023-10-18 20:52   ` Clément Lassieur
  0 siblings, 0 replies; 11+ messages in thread
From: Clément Lassieur @ 2023-10-18 20:52 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 66605

Hi Maxim,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

>> * etc/git/gitconfig: Prepend "guix shell -D guix --pure ./pre-inst-env" to the
>> etc/teams.scm script so that any user that have git:send-email installed can
>> use it in the Guix checkout without changing their environment.
>
> I'm not sure I understand; why does etc/teams.scm cc-members-header-cmd
> fail in an environment where git:send-email is available?

Because it requires (git) and (guix ui).  So you need ./pre-inst-env for
(guix ui), plus guile, guile-git and guile-gcrypt.  The minimal setup
would be:

    `guix shell guile guile-git guile-gcrypt git git:send-email --pure -- ./pre-inst-env git send-email`

or

    `guix shell guile guile-git guile-gcrypt -- ./pre-inst-env git send-email`

with an impure environment containing git and git:send-email.

But it could be shortened as

    `guix shell git:send-email -D guix --pure -- ./pre-inst-env git send-email`

However, in this case `guix shell git:send-email` is necessary even with
impure environments containing git and git:send-email because `-D guix`
pulls git without pulling git:send-email.

Thanks,
Clément




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

* [bug#66605] [PATCH v2] etc: gitconfig: Run etc/teams.scm from correct environment.
  2023-10-18 12:05 [bug#66605] [PATCH] etc: gitconfig: Run etc/teams.scm from correct environment Clément Lassieur
  2023-10-18 17:54 ` Maxim Cournoyer
@ 2023-10-18 21:50 ` Clément Lassieur
  2023-10-19  1:39   ` Maxim Cournoyer
  2023-10-19  1:47   ` Maxim Cournoyer
  2023-10-22 20:07 ` [bug#66605] [PATCH v5] " Maxim Cournoyer
  2 siblings, 2 replies; 11+ messages in thread
From: Clément Lassieur @ 2023-10-18 21:50 UTC (permalink / raw)
  To: 66605; +Cc: Clément Lassieur, Maxim Cournoyer

* etc/git/gitconfig: Prepend "guix repl" to the etc/teams.scm script so that
any user that has git:send-email installed can use it in the Guix checkout
without changing their environment.  (teams.scm uses (git) and (guix ui).)
---
 etc/git/gitconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/etc/git/gitconfig b/etc/git/gitconfig
index 907ad0180454..abcd494d62e8 100644
--- a/etc/git/gitconfig
+++ b/etc/git/gitconfig
@@ -14,5 +14,5 @@
 
 [sendemail]
         to = guix-patches@gnu.org
-        headerCmd = etc/teams.scm cc-members-header-cmd
+        headerCmd = guix repl etc/teams.scm cc-members-header-cmd
         thread = no

base-commit: 5498835bb38c0de57f284f0fa6b1178ecdcaf678
prerequisite-patch-id: d95e49e4fc059972fc5a7b2c92816df2228a0af1
prerequisite-patch-id: a0dca8c3175d6ce71c77e220c4ac98b6e97cef56
-- 
2.41.0





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

* [bug#66605] [PATCH v2] etc: gitconfig: Run etc/teams.scm from correct environment.
  2023-10-18 21:50 ` [bug#66605] [PATCH v2] " Clément Lassieur
@ 2023-10-19  1:39   ` Maxim Cournoyer
  2023-10-19  1:47   ` Maxim Cournoyer
  1 sibling, 0 replies; 11+ messages in thread
From: Maxim Cournoyer @ 2023-10-19  1:39 UTC (permalink / raw)
  To: Clément Lassieur; +Cc: 66605

Hi,

Clément Lassieur <clement@lassieur.org> writes:

> * etc/git/gitconfig: Prepend "guix repl" to the etc/teams.scm script so that
> any user that has git:send-email installed can use it in the Guix checkout
> without changing their environment.  (teams.scm uses (git) and (guix ui).)
> ---
>  etc/git/gitconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/etc/git/gitconfig b/etc/git/gitconfig
> index 907ad0180454..abcd494d62e8 100644
> --- a/etc/git/gitconfig
> +++ b/etc/git/gitconfig
> @@ -14,5 +14,5 @@
>  
>  [sendemail]
>          to = guix-patches@gnu.org
> -        headerCmd = etc/teams.scm cc-members-header-cmd
> +        headerCmd = guix repl etc/teams.scm cc-members-header-cmd

I had noticed as well that since Guix depends on 'git', we now have to
include git:send-email to the profile to be able to use it, like:

'guix shell -D guix git:send-email'.

I think on foreign distributions, you also need to use mumi or git
send-email in ./pre-inst-env, which is what your patch solves, I
believe.  This is not needed on a Guix System because the guix-daemon
used by it adds the Guix modules to the GUILE_LOAD_PATH.

-- 
Thanks,
Maxim




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

* [bug#66605] [PATCH v2] etc: gitconfig: Run etc/teams.scm from correct environment.
  2023-10-18 21:50 ` [bug#66605] [PATCH v2] " Clément Lassieur
  2023-10-19  1:39   ` Maxim Cournoyer
@ 2023-10-19  1:47   ` Maxim Cournoyer
  2023-10-19 10:05     ` Clément Lassieur
  1 sibling, 1 reply; 11+ messages in thread
From: Maxim Cournoyer @ 2023-10-19  1:47 UTC (permalink / raw)
  To: Clément Lassieur; +Cc: 66605

Hello,

Clément Lassieur <clement@lassieur.org> writes:

> * etc/git/gitconfig: Prepend "guix repl" to the etc/teams.scm script so that
> any user that has git:send-email installed can use it in the Guix checkout
> without changing their environment.  (teams.scm uses (git) and (guix ui).)
> ---
>  etc/git/gitconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/etc/git/gitconfig b/etc/git/gitconfig
> index 907ad0180454..abcd494d62e8 100644
> --- a/etc/git/gitconfig
> +++ b/etc/git/gitconfig
> @@ -14,5 +14,5 @@
>  
>  [sendemail]
>          to = guix-patches@gnu.org
> -        headerCmd = etc/teams.scm cc-members-header-cmd
> +        headerCmd = guix repl etc/teams.scm cc-members-header-cmd

Even nicer could be using 'guix repl' in the teams.scm script shebang.
This way even for those using it outside of 'git send-email', it'd
always work.

-- 
Thanks,
Maxim




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

* [bug#66605] [PATCH v2] etc: gitconfig: Run etc/teams.scm from correct environment.
  2023-10-19  1:47   ` Maxim Cournoyer
@ 2023-10-19 10:05     ` Clément Lassieur
  2023-10-21  3:39       ` [bug#66605] [PATCH v3] teams: Adjust shebang to use 'guix repl' Maxim Cournoyer
  0 siblings, 1 reply; 11+ messages in thread
From: Clément Lassieur @ 2023-10-19 10:05 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 66605

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


> Even nicer could be using 'guix repl' in the teams.scm script shebang.
> This way even for those using it outside of 'git send-email', it'd
> always work.

I can't find a nice solution to do that.  And I think people who run teams.scm directly will expect a guile crash and make sure to get the correct environment, so it's not really a problem at that point.

This is not the case for people who run `git send-email`.  Those people don't expect a guile crash.

So if you have a clean solution that works in a shebang (without the file being detected as a shell script by most editors), please show it :-)

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

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

* [bug#66605] [PATCH v3] teams: Adjust shebang to use 'guix repl'.
  2023-10-19 10:05     ` Clément Lassieur
@ 2023-10-21  3:39       ` Maxim Cournoyer
  0 siblings, 0 replies; 11+ messages in thread
From: Maxim Cournoyer @ 2023-10-21  3:39 UTC (permalink / raw)
  To: 66605; +Cc: Maxim Cournoyer, clement

This ensures the correct Guix dependencies are always available for the
script.

* etc/teams.scm.in: Rename to...
* etc/teams.scm: ... this.  Adjust shebang.
* .gitignore: No longer ignore it.
* configure.ac: Do not process it with AC_CONFIG_FILES.

Fixes: https://issues.guix.gnu.org/66605
Change-Id: I7a01750c6c5f0696b6c36b1e6caa9389d9e6822c
---
 .gitignore                      | 1 -
 configure.ac                    | 1 -
 etc/{teams.scm.in => teams.scm} | 8 ++++++--
 3 files changed, 6 insertions(+), 4 deletions(-)
 rename etc/{teams.scm.in => teams.scm} (99%)
 mode change 100644 => 100755

diff --git a/.gitignore b/.gitignore
index 543dc1c655..0f74b5da3d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -68,7 +68,6 @@
 /doc/version.texi
 /doc/version-*.texi
 /etc/committer.scm
-/etc/teams.scm
 /etc/gnu-store.mount
 /etc/guix-daemon.cil
 /etc/guix-daemon.conf
diff --git a/configure.ac b/configure.ac
index d817f620cf..ecbd596a34 100644
--- a/configure.ac
+++ b/configure.ac
@@ -281,7 +281,6 @@ AC_CONFIG_FILES([Makefile
                  guix/config.scm])
 
 AC_CONFIG_FILES([etc/committer.scm], [chmod +x etc/committer.scm])
-AC_CONFIG_FILES([etc/teams.scm], [chmod +x etc/teams.scm])
 AC_CONFIG_FILES([test-env:build-aux/test-env.in], [chmod +x test-env])
 AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in],
   [chmod +x pre-inst-env])
diff --git a/etc/teams.scm.in b/etc/teams.scm
old mode 100644
new mode 100755
similarity index 99%
rename from etc/teams.scm.in
rename to etc/teams.scm
index 55242caad1..98bbfd9e57
--- a/etc/teams.scm.in
+++ b/etc/teams.scm
@@ -1,5 +1,9 @@
-#!@GUILE@ \
---no-auto-compile -s
+#!/bin/sh
+# Extra care is taken here to ensure this script can run in most environments,
+# since it is invoked by 'git send-email'.
+pre_inst_env_maybe=
+command -v guix || pre_inst_env_maybe=./pre-inst-env
+exec $pre_inst_env_maybe guix repl -- "$0" "$@"
 !#
 
 ;;; GNU Guix --- Functional package management for GNU

base-commit: d2111894c48b2ebd7e7be683c07241bbd8a91919
prerequisite-patch-id: b8372a944dab5ec4df332a27705ff18e6a0e679c
-- 
2.41.0





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

* [bug#66605] [PATCH v5] teams: Adjust shebang to use 'guix repl'.
  2023-10-18 12:05 [bug#66605] [PATCH] etc: gitconfig: Run etc/teams.scm from correct environment Clément Lassieur
  2023-10-18 17:54 ` Maxim Cournoyer
  2023-10-18 21:50 ` [bug#66605] [PATCH v2] " Clément Lassieur
@ 2023-10-22 20:07 ` Maxim Cournoyer
  2023-10-22 20:23   ` Clément Lassieur
  2 siblings, 1 reply; 11+ messages in thread
From: Maxim Cournoyer @ 2023-10-22 20:07 UTC (permalink / raw)
  To: 66605; +Cc: Maxim Cournoyer, Clément Lassieur

This ensures the correct Guix dependencies are always available for the
script.

* etc/teams.scm.in: Rename to...
* etc/teams.scm: ... this.  Adjust shebang.
* .gitignore: No longer ignore it.
* configure.ac: Do not process it with AC_CONFIG_FILES.

Fixes: https://issues.guix.gnu.org/66605
---

Changes in v5:
 - Redirect command -v output to /dev/null

 .gitignore                      | 1 -
 configure.ac                    | 1 -
 etc/{teams.scm.in => teams.scm} | 8 ++++++--
 3 files changed, 6 insertions(+), 4 deletions(-)
 rename etc/{teams.scm.in => teams.scm} (99%)
 mode change 100644 => 100755

diff --git a/.gitignore b/.gitignore
index 543dc1c655..0f74b5da3d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -68,7 +68,6 @@
 /doc/version.texi
 /doc/version-*.texi
 /etc/committer.scm
-/etc/teams.scm
 /etc/gnu-store.mount
 /etc/guix-daemon.cil
 /etc/guix-daemon.conf
diff --git a/configure.ac b/configure.ac
index d817f620cf..ecbd596a34 100644
--- a/configure.ac
+++ b/configure.ac
@@ -281,7 +281,6 @@ AC_CONFIG_FILES([Makefile
                  guix/config.scm])
 
 AC_CONFIG_FILES([etc/committer.scm], [chmod +x etc/committer.scm])
-AC_CONFIG_FILES([etc/teams.scm], [chmod +x etc/teams.scm])
 AC_CONFIG_FILES([test-env:build-aux/test-env.in], [chmod +x test-env])
 AC_CONFIG_FILES([pre-inst-env:build-aux/pre-inst-env.in],
   [chmod +x pre-inst-env])
diff --git a/etc/teams.scm.in b/etc/teams.scm
old mode 100644
new mode 100755
similarity index 99%
rename from etc/teams.scm.in
rename to etc/teams.scm
index 55242caad1..0b25955701
--- a/etc/teams.scm.in
+++ b/etc/teams.scm
@@ -1,5 +1,9 @@
-#!@GUILE@ \
---no-auto-compile -s
+#!/bin/sh
+# Extra care is taken here to ensure this script can run in most environments,
+# since it is invoked by 'git send-email'.
+pre_inst_env_maybe=
+command -v guix > /dev/null || pre_inst_env_maybe=./pre-inst-env
+exec $pre_inst_env_maybe guix repl -- "$0" "$@"
 !#
 
 ;;; GNU Guix --- Functional package management for GNU

base-commit: faeebdc37e9137d62e11175e83988f77496a6641
-- 
2.41.0





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

* [bug#66605] [PATCH v5] teams: Adjust shebang to use 'guix repl'.
  2023-10-22 20:07 ` [bug#66605] [PATCH v5] " Maxim Cournoyer
@ 2023-10-22 20:23   ` Clément Lassieur
  2023-10-23  0:39     ` bug#66605: " Maxim Cournoyer
  0 siblings, 1 reply; 11+ messages in thread
From: Clément Lassieur @ 2023-10-22 20:23 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 66605

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

> This ensures the correct Guix dependencies are always available for the
> script.
>
> * etc/teams.scm.in: Rename to...
> * etc/teams.scm: ... this.  Adjust shebang.
> * .gitignore: No longer ignore it.
> * configure.ac: Do not process it with AC_CONFIG_FILES.
>
> Fixes: https://issues.guix.gnu.org/66605
> ---

Sounds good to me!  Of course, please commit it as your own.

Thank you very much,
Clément




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

* bug#66605: [PATCH v5] teams: Adjust shebang to use 'guix repl'.
  2023-10-22 20:23   ` Clément Lassieur
@ 2023-10-23  0:39     ` Maxim Cournoyer
  0 siblings, 0 replies; 11+ messages in thread
From: Maxim Cournoyer @ 2023-10-23  0:39 UTC (permalink / raw)
  To: Clément Lassieur; +Cc: 66605-done

Hi,

Clément Lassieur <clement@lassieur.org> writes:

> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>
>> This ensures the correct Guix dependencies are always available for the
>> script.
>>
>> * etc/teams.scm.in: Rename to...
>> * etc/teams.scm: ... this.  Adjust shebang.
>> * .gitignore: No longer ignore it.
>> * configure.ac: Do not process it with AC_CONFIG_FILES.
>>
>> Fixes: https://issues.guix.gnu.org/66605
>> ---
>
> Sounds good to me!  Of course, please commit it as your own.
>
> Thank you very much,
> Clément

Done!  Thanks for the report!

-- 
Thanks,
Maxim




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

end of thread, other threads:[~2023-10-23  0:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-18 12:05 [bug#66605] [PATCH] etc: gitconfig: Run etc/teams.scm from correct environment Clément Lassieur
2023-10-18 17:54 ` Maxim Cournoyer
2023-10-18 20:52   ` Clément Lassieur
2023-10-18 21:50 ` [bug#66605] [PATCH v2] " Clément Lassieur
2023-10-19  1:39   ` Maxim Cournoyer
2023-10-19  1:47   ` Maxim Cournoyer
2023-10-19 10:05     ` Clément Lassieur
2023-10-21  3:39       ` [bug#66605] [PATCH v3] teams: Adjust shebang to use 'guix repl' Maxim Cournoyer
2023-10-22 20:07 ` [bug#66605] [PATCH v5] " Maxim Cournoyer
2023-10-22 20:23   ` Clément Lassieur
2023-10-23  0:39     ` bug#66605: " 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.