unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* #$(this-package-input "subversion") in git introduces a cycle
@ 2023-10-07  2:13 Maxim Cournoyer
  2023-11-30 11:14 ` Simon Tournier
  0 siblings, 1 reply; 2+ messages in thread
From: Maxim Cournoyer @ 2023-10-07  2:13 UTC (permalink / raw)
  To: guix-devel

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

Hello Guix,

While working toward resolving bug #66305, I've decided to tidy the
house a bit, starting with dropping input labels and using gexps for the
git package, as shown attached.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-git-Remove-labels-and-use-gexps.patch --]
[-- Type: text/x-patch, Size: 37358 bytes --]

From 703534c8b1b8355293d3014ef5e59a0f8dd263de Mon Sep 17 00:00:00 2001
Message-ID: <703534c8b1b8355293d3014ef5e59a0f8dd263de.1696644353.git.maxim.cournoyer@gmail.com>
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Date: Fri, 6 Oct 2023 11:02:51 -0400
Subject: [PATCH] gnu: git: Remove labels and use gexps.

* gnu/packages/version-control.scm (git)
[native-inputs, inputs]: Remove labels.
[arguments]: Use gexps.  Use gexp variables input searching procedures where
it makes sense.
---
 gnu/packages/version-control.scm | 692 ++++++++++++++++---------------
 1 file changed, 351 insertions(+), 341 deletions(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index d9c53af71c..1a6e36ca53 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -230,358 +230,368 @@ (define git-cross-configure-flags
 
 (define-public git
   (package
-   (name "git")
-   (version "2.41.0")
-   (source (origin
-            (method url-fetch)
-            (uri (string-append "mirror://kernel.org/software/scm/git/git-"
-                                version ".tar.xz"))
-            (sha256
-             (base32
-              "0h40arw08xbpi2cbf7pvc947v963rjxz3inb2ar81zjc8byvlj77"))))
-   (build-system gnu-build-system)
-   (native-inputs
-    `(("native-perl" ,perl)
-      ;; Add bash-minimal explicitly to ensure it comes before bash-for-tests,
-      ;; see <https://bugs.gnu.org/39513>.
-      ("bash" ,bash-minimal)
-      ("bash-for-tests" ,bash)
-      ("gettext" ,gettext-minimal)
-      ;; To build the man pages from the git sources, we would need a dependency
-      ;; on a full XML tool chain, and building it actually takes ages.  So we
-      ;; use this lazy approach and use released tarball.
-      ("git-manpages"
-       ,(origin
-          (method url-fetch)
-          (uri (string-append
-                "mirror://kernel.org/software/scm/git/git-manpages-"
-                version ".tar.xz"))
-          (sha256
-           (base32
-            "0xsqakgy0s60zpa13ilj6zj420kdh8pf4v3nrp1nziwj8ja4qymw"))))
-      ;; For subtree documentation.
-      ("asciidoc" ,asciidoc)
-      ("docbook2x" ,docbook2x)
-      ("docbook-xsl" ,docbook-xsl)
-      ("libxslt" ,libxslt)
-      ("pkg-config" ,pkg-config)
-      ("texinfo" ,texinfo)
-      ("xmlto" ,xmlto)))
-   (inputs
-    `(("curl" ,curl)
-      ("expat" ,expat)
-      ("openssl" ,openssl)
-      ("perl" ,perl)
-      ("python" ,python) ; for git-p4
-      ("zlib" ,zlib)
-
-       ;; For PCRE support in git grep (USE_LIBPCRE2).
-       ("pcre" ,pcre2)
-
-       ;; For 'gitweb.cgi'.
-       ("perl-cgi" ,perl-cgi)
-
-       ;; For 'git-svn'.
-       ("subversion" ,subversion)
-       ("perl-term-readkey" ,perl-term-readkey)
-
-       ;; For 'git-send-email'.
-       ("perl-authen-sasl" ,perl-authen-sasl)
-       ("perl-net-smtp-ssl" ,perl-net-smtp-ssl)
-       ("perl-io-socket-ssl" ,perl-io-socket-ssl)
-
-       ;; For 'git gui', 'gitk', and 'git citool'.
-       ("tcl" ,tcl)
-       ("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
-     `(#:make-flags `("V=1"             ;more verbose compilation
+    (name "git")
+    (version "2.41.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://kernel.org/software/scm/git/git-"
+                                  version ".tar.xz"))
+              (sha256
+               (base32
+                "0h40arw08xbpi2cbf7pvc947v963rjxz3inb2ar81zjc8byvlj77"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     (list perl
+           ;; Add bash-minimal explicitly to ensure it comes before bash-for-tests,
+           ;; see <https://bugs.gnu.org/39513>.
+           bash-minimal
+           bash
+           gettext-minimal
+           (origin
+             (method url-fetch)
+             (uri (string-append
+                   "mirror://kernel.org/software/scm/git/git-manpages-"
+                   version ".tar.xz"))
+             (sha256
+              (base32
+               "0xsqakgy0s60zpa13ilj6zj420kdh8pf4v3nrp1nziwj8ja4qymw")))
+           ;; For subtree documentation.
+           asciidoc
+           docbook2x
+           docbook-xsl
+           libxslt
+           pkg-config
+           texinfo
+           xmlto))
+    (inputs
+     (list curl
+           expat
+           openssl
+           perl
+           python                       ;for git-p4
+           zlib
 
-                      ,(string-append "SHELL_PATH="
-                                      (assoc-ref %build-inputs "bash")
-                                      "/bin/sh")
+           ;; For PCRE support in git grep (USE_LIBPCRE2).
+           pcre2
 
-                      ;; Tests require a bash with completion support.
-                      ,(string-append "TEST_SHELL_PATH="
-                                      (assoc-ref %build-inputs "bash-for-tests")
-                                      "/bin/bash")
+           ;; For 'gitweb.cgi'.
+           perl-cgi
+
+           ;; For 'git-svn'.
+           subversion
+           perl-term-readkey
+
+           ;; For 'git-send-email'.
+           perl-authen-sasl
+           perl-net-smtp-ssl
+           perl-io-socket-ssl
+
+           ;; For 'git gui', 'gitk', and 'git citool'.
+           tcl
+           tk
+
+           ;; For 'git-credential-libsecret'
+           glib
+           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
+     (list
+      #:make-flags
+      #~(list "V=1"                     ;more verbose compilation
+              (string-append "SHELL_PATH="
+                             #$(this-package-native-input "bash-minimal")
+                             "/bin/sh")
 
-                      "USE_LIBPCRE2=yes"
+              ;; Tests require a bash with completion support.
+              (string-append "TEST_SHELL_PATH="
+                             #$(this-package-native-input "bash")
+                             "/bin/bash")
 
-                      ;; By default 'make install' creates hard links for
-                      ;; things in 'libexec/git-core', which leads to huge
-                      ;; nars; see <https://bugs.gnu.org/21949>.
-                      "NO_INSTALL_HARDLINKS=indeed")
+              "USE_LIBPCRE2=yes"
 
-       ;; Make sure the full bash does not end up in the final closure.
-       #:disallowed-references (,bash)
+              ;; By default 'make install' creates hard links for
+              ;; things in 'libexec/git-core', which leads to huge
+              ;; nars; see <https://bugs.gnu.org/21949>.
+              "NO_INSTALL_HARDLINKS=indeed")
 
-       #:test-target "test"
+      ;; Make sure the full bash does not end up in the final closure.
+      #:disallowed-references (list bash)
 
-       ;; The explicit --with-tcltk forces the build system to hardcode the
-       ;; absolute file name to 'wish'.
-       #:configure-flags (list (string-append "--with-tcltk="
-                                              (assoc-ref %build-inputs "tk")
-                                              "/bin/wish8.6") ; XXX
-                               ,@(if (%current-target-system)
-                                     git-cross-configure-flags
-                                     '()))
+      #:test-target "test"
 
-       #:modules ((srfi srfi-1)
+      ;; The explicit --with-tcltk forces the build system to hardcode the
+      ;; absolute file name to 'wish'.
+      #:configure-flags
+      #~(list (string-append "--with-tcltk="
+                             (search-input-file %build-inputs
+                                                "bin/wish8.6"))
+              #$@(if (%current-target-system)
+                     git-cross-configure-flags
+                     #~()))
+
+      #:modules `((srfi srfi-1)
                   (srfi srfi-26)
                   ((guix build gnu-build-system) #:prefix gnu:)
                   ,@%gnu-build-system-modules)
-       #:phases
-       (modify-phases %standard-phases
-         ,@(if (%current-target-system)
-               ;; The git build system assumes build == host
-               `((add-after 'unpack  'use-host-uname_S
-                   (lambda _
-                     (substitute* "config.mak.uname"
-                       (("uname_S := .*" all)
-                        (if (equal? ,(%current-target-system) "i586-pc-gnu")
-                            "uname_S := GNU\n"
-                            all))))))
-               ;; We do not have bash-for-tests when cross-compiling.
-               `((add-after 'unpack 'modify-PATH
-                   (lambda* (#:key inputs #:allow-other-keys)
-                     (let ((path (string-split (getenv "PATH") #\:))
-                           (bash-full (assoc-ref inputs "bash-for-tests")))
-                       ;; Drop the test bash from PATH so that (which "sh") and
-                       ;; similar does the right thing.
-                       (setenv "PATH" (string-join
-                                       (remove (cut string-prefix? bash-full <>) path)
-                                       ":")))))))
-         ;; Add cross curl-config script to PATH when cross-compiling.
-         ,@(if (%current-target-system)
-               '((add-before 'configure 'add-cross-curl-config
-                   (lambda* (#:key inputs #:allow-other-keys)
-                     (setenv "PATH"
-                             (string-append (assoc-ref inputs "curl") "/bin:"
-                                            (getenv "PATH"))))))
-               '())
-         (add-after 'configure 'patch-makefiles
-           (lambda _
-             (substitute* "Makefile"
-               (("/usr/bin/perl") (which "perl"))
-               (("/usr/bin/python") (which "python3")))))
-         (add-after 'configure 'add-PM.stamp
-           (lambda _
-             ;; Add the "PM.stamp" to avoid "no rule to make target".
-             (call-with-output-file "perl/PM.stamp" (const #t))))
-         (add-after 'build 'build-subtree
-           (lambda* (#:key inputs #:allow-other-keys)
-             (with-directory-excursion "contrib/subtree"
-               (substitute* "Makefile"
-                 ;; Apparently `xmlto' does not bother to looks up the stylesheets
-                 ;; specified in the XML, unlike the above substitution.  Instead it
-                 ;; uses a hard-coded URL.  Work around it here, but if this is
-                 ;; common perhaps we should hardcode this path in xmlto itself.
-                 (("\\$\\(XMLTO\\) -m \\$\\(MANPAGE_XSL\\)")
-                  (string-append "$(XMLTO) -x "
-                                 (string-append (assoc-ref inputs "docbook-xsl")
-                                                "/xml/xsl/docbook-xsl-"
-                                                ,(package-version docbook-xsl))
-                                 "/manpages/docbook.xsl -m $(MANPAGE_XSL)")))
-               (invoke "make")
-               (invoke "make" "install")
-               (invoke "make" "install-doc")
-               (substitute* "git-subtree"
-                 (("/bin/sh") (which "sh"))))))
-         (add-before 'check 'patch-tests
-           (lambda _
-             (let ((store-directory (%store-directory)))
-               ;; These files contain some funny bytes that Guile is unable
-               ;; to decode for shebang patching. Just delete them.
-               (for-each delete-file '("t/t4201-shortlog.sh"
-                                       "t/t7813-grep-icase-iso.sh"))
-               ;; Many tests contain inline shell scripts (hooks etc).
-               (substitute* (find-files "t" "\\.sh$")
-                 (("#!/bin/sh") (string-append "#!" (which "sh"))))
-               ;; Un-do shebang patching here to prevent checksum mismatch.
-               (substitute* '("t/t4034/perl/pre" "t/t4034/perl/post")
-                 (("^#!.*/bin/perl") "#!/usr/bin/perl"))
-               (substitute* "t/t5003-archive-zip.sh"
-                 (("cp /bin/sh") (string-append "cp " (which "sh"))))
-               (substitute* "t/t6030-bisect-porcelain.sh"
-                 (("\"/bin/sh\"") (string-append "\"" (which "sh") "\"")))
-               ;; FIXME: This test runs `git commit` with a bogus EDITOR
-               ;; and empty commit message, but does not fail the way it's
-               ;; expected to. The test passes when invoked interactively.
-               (substitute* "t/t7508-status.sh"
-                 (("\tcommit_template_commented") "\ttrue"))
-               ;; More checksum mismatches due to odd shebangs.
-               (substitute* "t/t9100-git-svn-basic.sh"
-                 (((string-append "\"#!" store-directory ".*/bin/sh")) "\"#!/bin/sh") )
-               (substitute* "t/t9300-fast-import.sh"
-                 (((string-append "\t#!" store-directory ".*/bin/sh")) "\t#!/bin/sh")
-                 (((string-append "'#!" store-directory ".*/bin/sh")) "'#!/bin/sh"))
-               ;; FIXME: Some hooks fail with "basename: command not found".
-               ;; See 't/trash directory.t9164.../svn-hook.log'.
-               (delete-file "t/t9164-git-svn-dcommit-concurrent.sh")
-
-               ;; XXX: These tests fail intermittently for unknown reasons:
-               ;; <https://bugs.gnu.org/29546>.
-               (for-each delete-file
-                         '("t/t9128-git-svn-cmd-branch.sh"
-                           "t/t9167-git-svn-cmd-branch-subproject.sh"
-                           "t/t9141-git-svn-multiple-branches.sh")))))
-         (add-after 'install 'install-info-manual
-           (lambda* (#:key parallel-build? #:allow-other-keys)
-             (define job-count (if parallel-build?
-                                   (number->string (parallel-job-count))
-                                   "1"))
-             (invoke "make" "-C" "Documentation" "install-info"
-                     "-j" job-count
-                     ;; The Makefile refer to 'docbook2x-texi', but our binary
-                     ;; is named 'docbook2texi'.
-                     "DOCBOOK2X_TEXI=docbook2texi" "PERL_PATH=perl")))
-         (add-after 'install 'install-shell-completion
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out         (assoc-ref outputs "out"))
-                    (completions (string-append out "/etc/bash_completion.d")))
-               ;; TODO: Install the tcsh and zsh completions in the right place.
-               (mkdir-p completions)
-               (copy-file "contrib/completion/git-completion.bash"
-                          (string-append completions "/git")))))
-         (add-after 'install 'install-credential-netrc
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((netrc (assoc-ref outputs "credential-netrc")))
-               (install-file "contrib/credential/netrc/git-credential-netrc.perl"
-                             (string-append netrc "/bin"))
-               (rename-file (string-append netrc "/bin/git-credential-netrc.perl")
-                            (string-append netrc "/bin/git-credential-netrc"))
-               ;; Previously, Git.pm was automatically found by netrc.
-               ;; Perl 5.26 changed how it locates modules so that @INC no
-               ;; longer includes the current working directory (the Perl
-               ;; community calls this "dotless @INC").
-               (wrap-program (string-append netrc "/bin/git-credential-netrc")
-                 `("PERL5LIB" ":" prefix
-                   (,(string-append (assoc-ref outputs "out") "/share/perl5")))))))
-         (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")))
-               (install-file "contrib/subtree/git-subtree"
-                             (string-append subtree "/bin"))
-               (install-file "contrib/subtree/git-subtree.1"
-                             (string-append subtree "/share/man/man1")))))
-         (add-after 'install 'restore-sample-hooks-shebang
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (dir (string-append out "/share/git-core/templates/hooks")))
-               (for-each (lambda (file)
-                           (format #t "restoring shebang on `~a'~%" file)
-                           (substitute* file
-                             (("^#!.*/bin/sh") "#!/bin/sh")))
-                         (find-files dir ".*")))))
-         (add-after 'install 'split
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             ;; Split the binaries to the various outputs.
-             (let* ((out      (assoc-ref outputs "out"))
-                    (se       (assoc-ref outputs "send-email"))
-                    (svn      (assoc-ref outputs "svn"))
-                    (gui      (assoc-ref outputs "gui"))
-                    (gitk     (string-append out "/bin/gitk"))
-                    (gitk*    (string-append gui "/bin/gitk"))
-                    (git-gui  (string-append out "/libexec/git-core/git-gui"))
-                    (git-gui* (string-append gui "/libexec/git-core/git-gui"))
-                    (git-cit  (string-append out "/libexec/git-core/git-citool"))
-                    (git-cit* (string-append gui "/libexec/git-core/git-citool"))
-                    (git-se   (string-append out "/libexec/git-core/git-send-email"))
-                    (git-se*  (string-append se  "/libexec/git-core/git-send-email"))
-                    (git-svn  (string-append out "/libexec/git-core/git-svn"))
-                    (git-svn* (string-append svn "/libexec/git-core/git-svn"))
-                    (git-sm   (string-append out
-                                             "/libexec/git-core/git-submodule")))
-               (mkdir-p (string-append gui "/bin"))
-               (mkdir-p (string-append gui "/libexec/git-core"))
-               (mkdir-p (string-append se  "/libexec/git-core"))
-               (mkdir-p (string-append svn "/libexec/git-core"))
-
-               (for-each (lambda (old new)
-                           (copy-file old new)
-                           (delete-file old)
-                           (chmod new #o555))
-                         (list gitk git-gui git-cit git-se git-svn)
-                         (list gitk* git-gui* git-cit* git-se* git-svn*))
-
-               ;; Tell 'git-svn' where Subversion and perl-term-readkey are.
-               (wrap-program git-svn*
-                 `("PATH" ":" prefix
-                   (,(string-append (assoc-ref inputs "subversion")
-                                    "/bin")))
-                 `("PERL5LIB" ":" prefix
-                   ,(map (lambda (i) (string-append (assoc-ref inputs i)
-                                                    "/lib/perl5/site_perl"))
-                         '("subversion" "perl-term-readkey")))
-
-                 ;; XXX: The .so for SVN/Core.pm lacks a RUNPATH, so
-                 ;; help it find 'libsvn_client-1.so'.
-                 `("LD_LIBRARY_PATH" ":" prefix
-                   (,(string-append (assoc-ref inputs "subversion")
-                                    "/lib"))))
-
-               ;; Tell 'git-send-email' where perl modules are.
-               (wrap-program git-se*
-                 `("PERL5LIB" ":" prefix
-                   ,(map (lambda (o) (string-append o "/lib/perl5/site_perl"))
-                         (list
-                          ,@(transitive-input-references
-                             'inputs
-                             (map (lambda (l)
-                                    (assoc l (package-inputs this-package)))
-                                  '("perl-authen-sasl"
-                                    "perl-net-smtp-ssl"
-                                    "perl-io-socket-ssl")))))))
-
-               ;; Tell 'gitweb.cgi' where perl modules are.
-               (wrap-program (string-append out "/share/gitweb/gitweb.cgi")
-                 `("PERL5LIB" ":" prefix
-                   ,(map (lambda (o) (string-append o "/lib/perl5/site_perl"))
-                         (list
-                          ,@(transitive-input-references
-                             'inputs
-                             (map (lambda (l)
-                                    (assoc l (package-inputs this-package)))
-                                  '("perl-cgi")))))))
-
-               ;; Tell 'git-submodule' where Perl is.
-               (wrap-program git-sm
-                 `("PATH" ":" prefix
-                   (,(string-append (assoc-ref inputs "perl")
-                                    "/bin")))))))
-         (add-after 'split 'install-man-pages
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (man (string-append out "/share/man"))
-                    (manpages (assoc-ref inputs "git-manpages")))
-               (mkdir-p man)
-               (with-directory-excursion man
-                 (invoke "tar" "xvf" manpages)))))
-         ,@(if (system-hurd?)
-               '((add-after 'unpack 'delete-tests/hurd
-                   (lambda _
-                     (delete-file "t/t0052-simple-ipc.sh")
-                     (delete-file "t/t5562-http-backend-content-length.sh")
-                     (delete-file "t/t9902-completion.sh"))))
-               '()))))
+      #:phases
+      #~(modify-phases %standard-phases
+          #$@(if (%current-target-system)
+                 ;; The git build system assumes build == host
+                 #~((add-after 'unpack  'use-host-uname_S
+                      (lambda _
+                        (substitute* "config.mak.uname"
+                          (("uname_S := .*" all)
+                           (if (equal? #$(%current-target-system) "i586-pc-gnu")
+                               "uname_S := GNU\n"
+                               all))))))
+                 ;; We do not have a full bash when cross-compiling.
+                 #~((add-after 'unpack 'modify-PATH
+                      (lambda* (#:key inputs #:allow-other-keys)
+                        (let ((path (string-split (getenv "PATH") #\:))
+                              (bash-full #$(this-package-native-input "bash")))
+                          ;; Drop the test bash from PATH so that (which "sh")
+                          ;; and similar does the right thing.
+                          (setenv "PATH"
+                                  (string-join
+                                   (remove (cut string-prefix? bash-full <>)
+                                           path)
+                                   ":")))))))
+          ;; Add cross curl-config script to PATH when cross-compiling.
+          #$@(if (%current-target-system)
+                 #~((add-before 'configure 'add-cross-curl-config
+                      (lambda* (#:key inputs #:allow-other-keys)
+                        (setenv "PATH"
+                                (string-append
+                                 (dirname (search-input-file
+                                           inputs "bin/curl-config"))
+                                 ":" (getenv "PATH"))))))
+                 #~())
+          (add-after 'configure 'patch-makefiles
+            (lambda _
+              (substitute* "Makefile"
+                (("/usr/bin/perl") (which "perl"))
+                (("/usr/bin/python") (which "python3")))))
+          (add-after 'configure 'add-PM.stamp
+            (lambda _
+              ;; Add the "PM.stamp" to avoid "no rule to make target".
+              (call-with-output-file "perl/PM.stamp" (const #t))))
+          (add-after 'build 'build-subtree
+            (lambda* (#:key inputs #:allow-other-keys)
+              (with-directory-excursion "contrib/subtree"
+                (substitute* "Makefile"
+                  ;; Apparently `xmlto' does not bother to looks up the
+                  ;; stylesheets specified in the XML, unlike the above
+                  ;; substitution.  Instead it uses a hard-coded URL.  Work
+                  ;; around it here, but if this is common perhaps we should
+                  ;; hardcode this path in xmlto itself.
+                  (("\\$\\(XMLTO\\) -m \\$\\(MANPAGE_XSL\\)")
+                   (string-append "$(XMLTO) -x "
+                                  (search-input-directory
+                                   (or native-inputs inputs)
+                                   (string-append
+                                    "xml/xsl/docbook-xsl-"
+                                    #$(package-version docbook-xsl)))
+                                  "/manpages/docbook.xsl -m $(MANPAGE_XSL)")))
+                (invoke "make")
+                (invoke "make" "install")
+                (invoke "make" "install-doc")
+                (substitute* "git-subtree"
+                  (("/bin/sh") (which "sh"))))))
+          (add-before 'check 'patch-tests
+            (lambda _
+              (let ((store-directory (%store-directory)))
+                ;; These files contain some funny bytes that Guile is unable
+                ;; to decode for shebang patching. Just delete them.
+                (for-each delete-file '("t/t4201-shortlog.sh"
+                                        "t/t7813-grep-icase-iso.sh"))
+                ;; Many tests contain inline shell scripts (hooks etc).
+                (substitute* (find-files "t" "\\.sh$")
+                  (("#!/bin/sh") (string-append "#!" (which "sh"))))
+                ;; Un-do shebang patching here to prevent checksum mismatch.
+                (substitute* '("t/t4034/perl/pre" "t/t4034/perl/post")
+                  (("^#!.*/bin/perl") "#!/usr/bin/perl"))
+                (substitute* "t/t5003-archive-zip.sh"
+                  (("cp /bin/sh") (string-append "cp " (which "sh"))))
+                (substitute* "t/t6030-bisect-porcelain.sh"
+                  (("\"/bin/sh\"") (string-append "\"" (which "sh") "\"")))
+                ;; FIXME: This test runs `git commit` with a bogus EDITOR
+                ;; and empty commit message, but does not fail the way it's
+                ;; expected to. The test passes when invoked interactively.
+                (substitute* "t/t7508-status.sh"
+                  (("\tcommit_template_commented") "\ttrue"))
+                ;; More checksum mismatches due to odd shebangs.
+                (substitute* "t/t9100-git-svn-basic.sh"
+                  (((string-append "\"#!" store-directory ".*/bin/sh"))
+                   "\"#!/bin/sh") )
+                (substitute* "t/t9300-fast-import.sh"
+                  (((string-append "\t#!" store-directory ".*/bin/sh"))
+                   "\t#!/bin/sh")
+                  (((string-append "'#!" store-directory ".*/bin/sh"))
+                   "'#!/bin/sh"))
+                ;; FIXME: Some hooks fail with "basename: command not found".
+                ;; See 't/trash directory.t9164.../svn-hook.log'.
+                (delete-file "t/t9164-git-svn-dcommit-concurrent.sh")
+
+                ;; XXX: These tests fail intermittently for unknown reasons:
+                ;; <https://bugs.gnu.org/29546>.
+                (for-each delete-file
+                          '("t/t9128-git-svn-cmd-branch.sh"
+                            "t/t9167-git-svn-cmd-branch-subproject.sh"
+                            "t/t9141-git-svn-multiple-branches.sh")))))
+          (add-after 'install 'install-info-manual
+            (lambda* (#:key parallel-build? #:allow-other-keys)
+              (define job-count (if parallel-build?
+                                    (number->string (parallel-job-count))
+                                    "1"))
+              (invoke "make" "-C" "Documentation" "install-info"
+                      "-j" job-count
+                      ;; The Makefile refer to 'docbook2x-texi', but our binary
+                      ;; is named 'docbook2texi'.
+                      "DOCBOOK2X_TEXI=docbook2texi" "PERL_PATH=perl")))
+          (add-after 'install 'install-shell-completion
+            (lambda _
+              (let ((completions (string-append #$output
+                                                "/etc/bash_completion.d")))
+                ;; TODO: Install the tcsh and zsh completions in the right
+                ;; place.
+                (mkdir-p completions)
+                (copy-file "contrib/completion/git-completion.bash"
+                           (string-append completions "/git")))))
+          (add-after 'install 'install-credential-netrc
+            (lambda* (#:key outputs #:allow-other-keys)
+              (install-file "contrib/credential/netrc/git-credential-netrc.perl"
+                            (string-append #$output:credential-netrc "/bin"))
+              (rename-file (string-append #$output:credential-netrc
+                                          "/bin/git-credential-netrc.perl")
+                           (string-append #$output:credential-netrc
+                                          "/bin/git-credential-netrc"))
+              ;; Previously, Git.pm was automatically found by netrc.
+              ;; Perl 5.26 changed how it locates modules so that @INC no
+              ;; longer includes the current working directory (the Perl
+              ;; community calls this "dotless @INC").
+              (wrap-program (string-append #$output:credential-netrc
+                                           "/bin/git-credential-netrc")
+                `("PERL5LIB" ":" prefix
+                  (,(string-append #$output "/share/perl5"))))))
+          (add-after 'install 'install-credential-libsecret
+            (lambda _
+              (with-directory-excursion "contrib/credential/libsecret"
+                ((assoc-ref gnu:%standard-phases 'build))
+                (install-file "git-credential-libsecret"
+                              (string-append #$output:credential-libsecret
+                                             "/bin")))))
+          (add-after 'install 'install-subtree
+            (lambda _
+              (install-file "contrib/subtree/git-subtree"
+                            (string-append #$output:subtree "/bin"))
+              (install-file "contrib/subtree/git-subtree.1"
+                            (string-append #$output:subtree
+                                           "/share/man/man1"))))
+          (add-after 'install 'restore-sample-hooks-shebang
+            (lambda _
+              (let* ((dir (string-append #$output
+                                         "/share/git-core/templates/hooks")))
+                (for-each (lambda (file)
+                            (format #t "restoring shebang on `~a'~%" file)
+                            (substitute* file
+                              (("^#!.*/bin/sh") "#!/bin/sh")))
+                          (find-files dir ".*")))))
+          (add-after 'install 'split
+            (lambda* (#:key inputs #:allow-other-keys)
+              ;; Split the binaries to the various outputs.
+              (let* ((out      #$output)
+                     (se       #$output:send-email)
+                     (svn      #$output:svn)
+                     (gui      #$output:gui)
+                     (gitk     (string-append out "/bin/gitk"))
+                     (gitk*    (string-append gui "/bin/gitk"))
+                     (git-gui  (string-append
+                                out "/libexec/git-core/git-gui"))
+                     (git-gui* (string-append gui "/libexec/git-core/git-gui"))
+                     (git-cit  (string-append
+                                out "/libexec/git-core/git-citool"))
+                     (git-cit* (string-append
+                                gui "/libexec/git-core/git-citool"))
+                     (git-se   (string-append
+                                out "/libexec/git-core/git-send-email"))
+                     (git-se*  (string-append
+                                se  "/libexec/git-core/git-send-email"))
+                     (git-svn  (string-append out "/libexec/git-core/git-svn"))
+                     (git-svn* (string-append svn "/libexec/git-core/git-svn"))
+                     (git-sm   (string-append
+                                out "/libexec/git-core/git-submodule")))
+                (mkdir-p (string-append gui "/bin"))
+                (mkdir-p (string-append gui "/libexec/git-core"))
+                (mkdir-p (string-append se  "/libexec/git-core"))
+                (mkdir-p (string-append svn "/libexec/git-core"))
+
+                (for-each (lambda (old new)
+                            (copy-file old new)
+                            (delete-file old)
+                            (chmod new #o555))
+                          (list gitk git-gui git-cit git-se git-svn)
+                          (list gitk* git-gui* git-cit* git-se* git-svn*))
+
+                ;; Tell 'git-svn' where Subversion and perl-term-readkey are.
+                (wrap-program git-svn*
+                  `("PATH" ":" prefix
+                    (,(dirname (search-input-file inputs "bin/perl"))))
+                  `("PERL5LIB" ":" prefix
+                    ,(search-path-as-list
+                      "lib/perl5/site_perl"
+                      #$(list (this-package-input "subversion")
+                              (this-package-input "perl-term-readkey"))))
+
+                  ;; XXX: The .so for SVN/Core.pm lacks a RUNPATH, so
+                  ;; help it find 'libsvn_client-1.so'.
+                  `("LD_LIBRARY_PATH" ":" prefix
+                    (,(string-append #$(this-package-input "subversion")
+                                     "/lib"))))
+
+                ;; Tell 'git-send-email' where perl modules are.
+                (wrap-program git-se*
+                  `("PERL5LIB" ":" prefix
+                    ,(search-path-as-list
+                      "lib/perl5/site_perl"
+                      '#$(append-map
+                          package-transitive-propagated-inputs
+                          (list (this-package-input "perl-authen-sasl")
+                                (this-package-input "perl-net-smtp-ssl")
+                                (this-package-input "perl-io-socket-ssl"))))))
+
+                ;; Tell 'gitweb.cgi' where perl modules are.
+                (wrap-program (string-append out "/share/gitweb/gitweb.cgi")
+                  `("PERL5LIB" ":" prefix
+                    ,(search-path-as-list
+                      "lib/perl5/site_perl"
+                      '#$(append-map
+                          package-transitive-propagated-inputs
+                          (list (this-package-input "perl-cgi"))))))
+
+                ;; Tell 'git-submodule' where Perl is.
+                (wrap-program git-sm
+                  `("PATH" ":" prefix
+                    (,(dirname (search-input-file inputs "bin/perl"))))))))
+          (add-after 'split 'install-man-pages
+            (lambda _
+              (let* ((man (string-append #$output "/share/man"))
+                     (manpages #$(this-package-input "git-manpages")))
+                (mkdir-p man)
+                (with-directory-excursion man
+                  (invoke "tar" "xvf" manpages)))))
+          #$@(if (system-hurd?)
+                 #~((add-after 'unpack 'delete-tests/hurd
+                      (lambda _
+                        (delete-file "t/t0052-simple-ipc.sh")
+                        (delete-file "t/t5562-http-backend-content-length.sh")
+                        (delete-file "t/t9902-completion.sh"))))
+                 #~()))))
 
     (native-search-paths
      ;; For HTTPS access, Git needs a single-file certificate bundle, specified

base-commit: 8d27ef1ed34a0a7fe14fd76f31541b62d0125498
-- 
2.41.0


[-- Attachment #3: Type: text/plain, Size: 1502 bytes --]


Unfortunately, it causes a cyclic dependency issue, and attempting to
run './pre-inst-env guix build git' consumes all the memory.

I've narrowed the problem down to #$(this-package-input "subversion");
the following diff allows the build to start:

--8<---------------cut here---------------start------------->8---
modified   gnu/packages/version-control.scm
@@ -545,14 +545,15 @@ (define-public git
                   `("PERL5LIB" ":" prefix
                     ,(search-path-as-list
                       "lib/perl5/site_perl"
-                      #$(list (this-package-input "subversion")
+                      #$(list ;(this-package-input "subversion")
                               (this-package-input "perl-term-readkey"))))
 
                   ;; XXX: The .so for SVN/Core.pm lacks a RUNPATH, so
                   ;; help it find 'libsvn_client-1.so'.
-                  `("LD_LIBRARY_PATH" ":" prefix
-                    (,(string-append #$(this-package-input "subversion")
-                                     "/lib"))))
+                  ;; `("LD_LIBRARY_PATH" ":" prefix
+                  ;;   (,(string-append #$(this-package-input "subversion")
+                  ;;                    "/lib")))
+                  )
 
                 ;; Tell 'git-send-email' where perl modules are.
                 (wrap-program git-se*
--8<---------------cut here---------------end--------------->8---

I'm puzzled as to why this happens.  Would someone have an idea?

-- 
Thanks,
Maxim

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

* Re: #$(this-package-input "subversion") in git introduces a cycle
  2023-10-07  2:13 #$(this-package-input "subversion") in git introduces a cycle Maxim Cournoyer
@ 2023-11-30 11:14 ` Simon Tournier
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Tournier @ 2023-11-30 11:14 UTC (permalink / raw)
  To: Maxim Cournoyer, guix-devel

Hi Maxim,

I am late to the party and maybe it is already solved.

On ven., 06 oct. 2023 at 22:13, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:

> I've narrowed the problem down to #$(this-package-input "subversion");
> the following diff allows the build to start:

[...]

> I'm puzzled as to why this happens.  Would someone have an idea?

No idea.  On a side note, on the top of
cd46757c1a0f886848fbb6828c028dd2a2532767, I get this error:

--8<---------------cut here---------------start------------->8---
phase `build' succeeded after 17.4 seconds
starting phase `build-subtree'
error: in phase 'build-subtree': uncaught exception:
unbound-variable #f "Unbound variable: ~S" (native-inputs) #f 
phase `build-subtree' failed after 0.0 seconds
Backtrace:
In srfi/srfi-1.scm:
    634:9 19 (for-each #<procedure 7fffee9f6440 at guix/build/gnu-b…> …)
In ice-9/boot-9.scm:
  1752:10 18 (with-exception-handler _ _ #:unwind? _ # _)
In guix/build/gnu-build-system.scm:
   929:23 17 (_)
In ice-9/boot-9.scm:
    142:2 16 (dynamic-wind #<procedure 7fffeea36e60 at ice-9/eval.s…> …)
In ice-9/eval.scm:
    619:8 15 (_ #(#(#<directory (guile-user) 7ffff77f7c80> (# # …))))
In ice-9/boot-9.scm:
  1752:10 14 (with-exception-handler _ _ #:unwind? _ # _)
In ice-9/ports.scm:
   433:17 13 (call-with-input-file _ _ #:binary _ #:encoding _ # _)
In guix/build/utils.scm:
   899:26 12 (_ #<input: Makefile 15>)
   959:29 11 (loop "\t$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man …")
In srfi/srfi-1.scm:
   460:18 10 (fold #<procedure 7fffef225280 at guix/build/utils.scm…> …)
In ice-9/eval.scm:
   202:51  9 (_ #(#(#(#(#(#(#<directory (guile-user)…> …)) …) …) …) …))
    163:9  8 (_ #(#(#(#(#(#(#<directory (guile-user)…> …)) …) …) …) …))
    163:9  7 (_ #(#(#(#(#(#(#<directory (guile-user)…> …)) …) …) …) …))
    159:9  6 (_ #(#(#(#(#(#(#<directory (guile-user)…> …)) …) …) …) …))
   293:34  5 (_ #(#(#(#(#(#(#<directory (guile-user)…> …)) …) …) …) …))
   223:20  4 (proc #(#(#(#(#(#(#<directory (guile-us…> …)) …) …) …) …))
In unknown file:
           3 (%resolve-variable (7 . native-inputs) #<directory (gui…>)
In ice-9/boot-9.scm:
  1685:16  2 (raise-exception _ #:continuable? _)
  1685:16  1 (raise-exception _ #:continuable? _)
  1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Unbound variable: native-inputs
--8<---------------cut here---------------end--------------->8---

And it probably comes from:

        (search-input-directory
         (or native-inputs inputs)
         (string-append
          "xml/xsl/docbook-xsl-"
          #$(package-version docbook-xsl)))

Maybe it is related to the error you observed later.  Hum, I do not
know… I have not investigated further. :-)

Cheers,
simon


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

end of thread, other threads:[~2023-11-30 18:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-07  2:13 #$(this-package-input "subversion") in git introduces a cycle Maxim Cournoyer
2023-11-30 11:14 ` Simon Tournier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).