[PATCH] gnu: packages: Fix git system configuration.

  • Open
  • quality assurance status badge
Details
2 participants
  • Lilah Tascheter
  • Ludovic Courtès
Owner
unassigned
Submitted by
Lilah Tascheter
Severity
normal

Debbugs page

Lilah Tascheter wrote 7 months ago
(address . guix-patches@gnu.org)(name . Lilah Tascheter)(address . lilah@lunabee.space)
1ea5ce3850cc9e91526391e315061f8e0c523f8c.1724643373.git.lilah@lunabee.space
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(+)

Toggle diff (31 lines)
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
Ludovic Courtès wrote 5 months ago
(name . Lilah Tascheter)(address . lilah@lunabee.space)(address . 72813@debbugs.gnu.org)
871q0ltflf.fsf@gnu.org
Hi Lilah,

Lilah Tascheter <lilah@lunabee.space> skribis:

Toggle quote (11 lines)
> 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’.
Lilah Tascheter wrote 2 months ago
[PATCH v2] gnu: packages: Fix git system configuration.
(address . 72813@debbugs.gnu.org)(name . Lilah Tascheter)(address . lilah@lunabee.space)(name . Ludovic Courtès)(address . ludo@gnu.org)
b308e191b0420a60f0f5eb5a58ca575bfb2e8077.1737585603.git.lilah@lunabee.space
* 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(-)

Toggle diff (35 lines)
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
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 72813@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 72813
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help