GNU bug report logs - #46247
[PATCH] gnu: git: Add credential-libsecret output.

Previous Next

Package: guix-patches;

Reported by: Léo Le Bouter <lle-bout <at> zaclys.net>

Date: Mon, 1 Feb 2021 23:36:01 UTC

Severity: normal

Tags: patch

Done: Chris Marusich <cmmarusich <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 46247 in the body.
You can then email your comments to 46247 AT debbugs.gnu.org in the normal way.

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#46247; Package guix-patches. (Mon, 01 Feb 2021 23:36:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Léo Le Bouter <lle-bout <at> zaclys.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 01 Feb 2021 23:36:01 GMT) Full text and rfc822 format available.

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

From: Léo Le Bouter <lle-bout <at> zaclys.net>
To: guix-patches <at> gnu.org
Cc: Léo Le Bouter <lle-bout <at> zaclys.net>
Subject: [PATCH] gnu: git: Add credential-libsecret output.
Date: Tue,  2 Feb 2021 00:35:18 +0100
* gnu/packages/version-control.scm (git):
[native-inputs]: Add pkg-config.
[inputs]: Add glib and libsecret.
[outputs]: Add "credential-libsecret".
[arguments]: Add 'install-credential-libsecret phase to #:phases to build and
install "git-credential-libsecret" to "credential-libsecret" output.
---
 gnu/packages/version-control.scm | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index afbae86772..f78714da57 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -81,6 +81,8 @@
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages gl)
+  #:use-module (gnu packages glib)
+  #:use-module (gnu packages gnome)
   #:use-module (gnu packages golang)
   #:use-module (gnu packages groff)
   #:use-module (gnu packages guile)
@@ -194,7 +196,8 @@ as well as the classic centralized workflow.")
       ;; For subtree documentation.
       ("asciidoc" ,asciidoc-py3)
       ("docbook-xsl" ,docbook-xsl)
-      ("xmlto" ,xmlto)))
+      ("xmlto" ,xmlto)
+      ("pkg-config" ,pkg-config)))
    (inputs
     `(("curl" ,curl)
       ("expat" ,expat)
@@ -220,11 +223,16 @@ as well as the classic centralized workflow.")
 
       ;; For 'git gui', 'gitk', and 'git citool'.
       ("tcl" ,tcl)
-      ("tk" ,tk)))
+      ("tk" ,tk)
+
+      ;; For 'git-credential-libsecret'
+      ("glib" ,glib)
+      ("libsecret" ,libsecret)))
    (outputs '("out"                               ; the core
               "send-email"                        ; for git-send-email
               "svn"                               ; git-svn
               "credential-netrc"                  ; git-credential-netrc
+              "credential-libsecret"              ; git-credential-libsecret
               "subtree"                           ; git-subtree
               "gui"))                             ; gitk, git gui
    (arguments
@@ -262,6 +270,7 @@ as well as the classic centralized workflow.")
 
       #:modules ((srfi srfi-1)
                  (srfi srfi-26)
+                 ((guix build gnu-build-system) #:prefix gnu:)
                  ,@%gnu-build-system-modules)
       #:phases
       (modify-phases %standard-phases
@@ -389,6 +398,13 @@ as well as the classic centralized workflow.")
                 `("PERL5LIB" ":" prefix
                   (,(string-append (assoc-ref outputs "out") "/share/perl5"))))
               #t)))
+        (add-after 'install 'install-credential-libsecret
+          (lambda* (#:key outputs #:allow-other-keys)
+            (let* ((libsecret (assoc-ref outputs "credential-libsecret")))
+              (with-directory-excursion "contrib/credential/libsecret"
+                ((assoc-ref gnu:%standard-phases 'build))
+                (install-file "git-credential-libsecret"
+                              (string-append libsecret "/bin"))))))
         (add-after 'install 'install-subtree
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((subtree (assoc-ref outputs "subtree")))
-- 
2.30.0





Reply sent to Chris Marusich <cmmarusich <at> gmail.com>:
You have taken responsibility. (Mon, 22 Feb 2021 01:11:01 GMT) Full text and rfc822 format available.

Notification sent to Léo Le Bouter <lle-bout <at> zaclys.net>:
bug acknowledged by developer. (Mon, 22 Feb 2021 01:11:01 GMT) Full text and rfc822 format available.

Message #10 received at 46247-close <at> debbugs.gnu.org (full text, mbox):

From: Chris Marusich <cmmarusich <at> gmail.com>
To: Léo Le Bouter <lle-bout <at> zaclys.net>
Cc: 46247-close <at> debbugs.gnu.org
Subject: Re: [bug#46247] [PATCH] gnu: git: Add credential-libsecret output.
Date: Sun, 21 Feb 2021 17:10:28 -0800
[Message part 1 (text/plain, inline)]
Hi Léo,

I've committed this, with minor changes, as
c53ee79c4ce187b185a070977f69ad9d4fb55179.

Léo Le Bouter <lle-bout <at> zaclys.net> writes:

> +        (add-after 'install 'install-credential-libsecret
> +          (lambda* (#:key outputs #:allow-other-keys)
> +            (let* ((libsecret (assoc-ref outputs "credential-libsecret")))
> +              (with-directory-excursion "contrib/credential/libsecret"
> +                ((assoc-ref gnu:%standard-phases 'build))
> +                (install-file "git-credential-libsecret"
> +                              (string-append libsecret "/bin"))))))

A few days ago, I tested your patch (applied to
19783b9f553e433743fd695302df8cac4ec91ae1, which at the time was the
latest commit on master).  Unfortunately, it caused git-minimal to fail
to build:

--8<---------------cut here---------------start------------->8---
./pre-inst-env guix build git

...

starting phase `install-credential-libsecret'
make: pkg-config: No such file or directory
make: pkg-config: No such file or directory
gcc -g -O2   -o git-credential-libsecret.o -c git-credential-libsecret.c
git-credential-libsecret.c:29:10: fatal error: glib.h: No such file or directory
 #include <glib.h>
          ^~~~~~~~
compilation terminated.
make: *** [Makefile:19: git-credential-libsecret.o] Error 1
command "make" "-j" "2" failed with status 2
builder for `/gnu/store/fwfv6k7jl8f77awgvs0lg3dnlx85nxd9-git-minimal-2.30.1.drv' failed with exit code 1
build of /gnu/store/fwfv6k7jl8f77awgvs0lg3dnlx85nxd9-git-minimal-2.30.1.drv failed
View build log at '/var/log/guix/drvs/fw/fv6k7jl8f77awgvs0lg3dnlx85nxd9-git-minimal-2.30.1.drv.bz2'.
guix build: error: build of `/gnu/store/fwfv6k7jl8f77awgvs0lg3dnlx85nxd9-git-minimal-2.30.1.drv' failed
--8<---------------cut here---------------end--------------->8---

The same command (./pre-inst-env guix build git) succeeded on commit
19783b9f553e433743fd695302df8cac4ec91ae1.

The problem was that git-minimal inherits the arguments (thus the
phases) from git, so it needs to also delete the newly added phase:

  (delete 'build-subtree)
  (delete 'split)
  (delete 'install-man-pages)
  (delete 'install-subtree)
  (delete 'install-credential-netrc)
  (delete 'install-credential-libsecret)

I also took the liberty of adding #t at the end of the new phase.  My
understanding is that all successful phases should still be returning
#t, as described below, so please take care to always return #t at the
end of every phase:

https://lists.gnu.org/archive/html/guix-devel/2018-01/msg00353.html
https://lists.gnu.org/archive/html/guix-devel/2018-05/msg00369.html

Thank you for the contribution!  I hope it streamlines your workflow!

-- 
Chris
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 22 Mar 2021 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 34 days ago.

Previous Next


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