GNU bug report logs - #72813
[PATCH] gnu: packages: Fix git system configuration.

Previous Next

Package: guix-patches;

Reported by: Lilah Tascheter <lilah <at> lunabee.space>

Date: Mon, 26 Aug 2024 03:38:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 72813 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#72813; Package guix-patches. (Mon, 26 Aug 2024 03:38:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Lilah Tascheter <lilah <at> lunabee.space>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 26 Aug 2024 03:38:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Lilah Tascheter <lilah <at> lunabee.space>
To: guix-patches <at> gnu.org
Cc: Lilah Tascheter <lilah <at> lunabee.space>
Subject: [PATCH] gnu: packages: Fix git system configuration.
Date: Sun, 25 Aug 2024 22:36:13 -0500
Git's system config path is, by default, relative to the install prefix.
Fix this to use the usual system path.

System config is is pretty much the only way to change git config for
system services.

* gnu/packages/version-control.scm (git/fixed): New variable.
  (git)[replacement]: Graft with git/fixed.

Change-Id: I44ae667baee6c9389a8f81da743d67d1a63070ed
---
 gnu/packages/version-control.scm | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 42bd4a5744..efb91da8af 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -251,6 +251,7 @@ (define-public git
             (sha256
              (base32
               "1nws1vjgj54sv32wxl1h3n1jkcpabqv7a605hhafsby0n5zfigsi"))))
+   (replacement git/fixed)
    (build-system gnu-build-system)
    (native-inputs
     `(("native-perl" ,perl)
@@ -629,6 +630,14 @@ (define-public git
     (license license:gpl2)
     (home-page "https://git-scm.com/")))
 
+(define git/fixed
+  (package
+    (inherit git)
+    (arguments
+      (substitute-keyword-arguments (package-arguments git)
+        ((#:configure-flags flags #~'())
+         #~(cons "--with-gitconfig=/etc/gitconfig" #$flags))))))
+
 (define-public git-minimal
   ;; The size of the closure of 'git-minimal' is two thirds that of 'git'.
   ;; Its test suite runs slightly faster and most importantly it doesn't

base-commit: 9e57f3bcd4b3c4c8936358d3160f0d4f996204ce
-- 
2.45.2





Information forwarded to guix-patches <at> gnu.org:
bug#72813; Package guix-patches. (Sat, 12 Oct 2024 17:08:02 GMT) Full text and rfc822 format available.

Message #8 received at 72813 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Lilah Tascheter <lilah <at> lunabee.space>
Cc: 72813 <at> debbugs.gnu.org
Subject: Re: [bug#72813] [PATCH] gnu: packages: Fix git system configuration.
Date: Sat, 12 Oct 2024 19:07:24 +0200
Hi Lilah,

Lilah Tascheter <lilah <at> lunabee.space> skribis:

> Git's system config path is, by default, relative to the install prefix.
> Fix this to use the usual system path.
>
> System config is is pretty much the only way to change git config for
> system services.
>
> * gnu/packages/version-control.scm (git/fixed): New variable.
>   (git)[replacement]: Graft with git/fixed.
>
> Change-Id: I44ae667baee6c9389a8f81da743d67d1a63070ed

Apologies for the delay.

In general we would use ‘replacement’ only for security issues.  In this
case I would suggest changing #:configure-flags in ‘git-minimal’ *and*
arrange so that ‘git-minimal/pinned’ remains unchanged (that is, it
should still have the previous #:configure-flags value).

You can check that by running:

  ./pre-inst-env guix build \
    -e '(@ (gnu packages version-control) git-minimal/pinned)' \
    --no-grafts -d

before and after your change.  The result should be identical.

Would you like to give it a try?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#72813; Package guix-patches. (Wed, 22 Jan 2025 22:42:02 GMT) Full text and rfc822 format available.

Message #11 received at 72813 <at> debbugs.gnu.org (full text, mbox):

From: Lilah Tascheter <lilah <at> lunabee.space>
To: 72813 <at> debbugs.gnu.org
Cc: Lilah Tascheter <lilah <at> lunabee.space>,
 Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH v2] gnu: packages: Fix git system configuration.
Date: Wed, 22 Jan 2025 16:40:03 -0600
* gnu/packages/version-control.scm (git-minimal)[arguments]<configure-flags>:
  Add configure flag to properly recognize the system gitconfig.
  (git-minimal/pinned)[arguments]: Use old arguments as to not force rebuild.

Change-Id: I7f31d16aa6c7ab062f300019f1f862b561ece2d3
---
 gnu/packages/version-control.scm | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 2a95bc79e1..f5942e8138 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -283,9 +283,8 @@ (define-public git-minimal
       #:disallowed-references (list bash perl)
       #:test-target "test"
       #:configure-flags
-      (if (%current-target-system)
-          git-cross-configure-flags
-          #~(list))
+      #~(cons "--with-gitconfig=/etc/gitconfig"
+          #$(if (%current-target-system) git-cross-configure-flags #~(list)))
       #:make-flags
       #~(list "V=1"                     ;more verbose compilation
               (string-append "SHELL_PATH="
@@ -772,7 +771,13 @@ (define-public git-minimal/pinned
                                   version ".tar.xz"))
               (sha256
                (base32
-                "0h40arw08xbpi2cbf7pvc947v963rjxz3inb2ar81zjc8byvlj77"))))))
+                "0h40arw08xbpi2cbf7pvc947v963rjxz3inb2ar81zjc8byvlj77"))))
+    ;; Temporary measure to prevent unneccessary package rebuilds.
+    (arguments (substitute-keyword-arguments (package-arguments git-minimal)
+                 ((#:configure-flags flags #~'())
+                  (if (%current-target-system)
+                    git-cross-configure-flags
+                    #~(list)))))))
 
 (define-public python-klaus
   (package

base-commit: 30327e379b2acdcdc418109e1f01ab92210a83cd
-- 
2.47.1





This bug report was last modified 147 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.