The TeX Live importer should use the texlive.tlpdb database as its input

  • Done
  • quality assurance status badge
Details
2 participants
  • Maxim Cournoyer
  • Ricardo Wurmus
Owner
unassigned
Submitted by
Maxim Cournoyer
Severity
normal
Merged with
M
M
Maxim Cournoyer wrote on 4 Jan 2021 18:11
The TeX Live importer crashes with Wrong type (expecting string): #f
(name . bug-guix)(address . bug-guix@gnu.org)
87ft3geifh.fsf@gmail.com
Hello,

The TeX Live importer doesn't appear to be functional:

$ guix import texlive lh
following redirection to `https://ctan.org/xml/1.2/pkg/lh'...
command "svn" "export" "--non-interactive" "--trust-server-cert" "-r" "51265" "svn://www.tug.org/texlive/tags/texlive-2019.3/Master/texmf-dist/source/latex/lh" "/tmp/guix-directory.vfSCcU/svn" failed with signal 11
Backtrace:
In ice-9/boot-9.scm:
1736:10 15 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
In unknown file:
14 (apply-smob/0 #<thunk 7fb1a712a4a0>)
In ice-9/boot-9.scm:
718:2 13 (call-with-prompt _ _ #<procedure default-prompt-handler (k proc)>)
In ice-9/eval.scm:
619:8 12 (_ #(#(#<directory (guile-user) 7fb1a6d67f00>)))
In guix/ui.scm:
2118:12 11 (run-guix-command _ . _)
In guix/scripts/import.scm:
120:11 10 (guix-import . _)
In guix/scripts/import/texlive.scm:
91:19 9 (guix-import-texlive . _)
In guix/memoization.scm:
98:0 8 (mproc "lh" "latex")
In unknown file:
7 (_ #<procedure 7fb1a4c85a20 at guix/memoization.scm:179:32 ()> #<procedure list _> ("lh" …))
In ice-9/boot-9.scm:
1736:10 6 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
In guix/store.scm:
632:37 5 (thunk)
In guix/import/texlive.scm:
162:25 4 (_ _)
In guix/serialization.scm:
324:6 3 (dump #f)
257:34 2 (_ _)
In unknown file:
1 (lstat #f)
In ice-9/boot-9.scm:
1669:16 0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1669:16: In procedure raise-exception:
Wrong type (expecting string): #f

The same happens with other packages, such as 'ec'.

Thanks,

Maxim
M
M
Maxim Cournoyer wrote on 4 Jan 2021 19:30
(address . 45656@debbugs.gnu.org)
87czykees2.fsf@gmail.com
Hello,

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

Toggle quote (45 lines)
> Hello,
>
> The TeX Live importer doesn't appear to be functional:
>
> $ guix import texlive lh
> following redirection to `https://ctan.org/xml/1.2/pkg/lh'...
> command "svn" "export" "--non-interactive" "--trust-server-cert" "-r" "51265" "svn://www.tug.org/texlive/tags/texlive-2019.3/Master/texmf-dist/source/latex/lh" "/tmp/guix-directory.vfSCcU/svn" failed with signal 11
> Backtrace:
> In ice-9/boot-9.scm:
> 1736:10 15 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
> In unknown file:
> 14 (apply-smob/0 #<thunk 7fb1a712a4a0>)
> In ice-9/boot-9.scm:
> 718:2 13 (call-with-prompt _ _ #<procedure default-prompt-handler (k proc)>)
> In ice-9/eval.scm:
> 619:8 12 (_ #(#(#<directory (guile-user) 7fb1a6d67f00>)))
> In guix/ui.scm:
> 2118:12 11 (run-guix-command _ . _)
> In guix/scripts/import.scm:
> 120:11 10 (guix-import . _)
> In guix/scripts/import/texlive.scm:
> 91:19 9 (guix-import-texlive . _)
> In guix/memoization.scm:
> 98:0 8 (mproc "lh" "latex")
> In unknown file:
> 7 (_ #<procedure 7fb1a4c85a20 at guix/memoization.scm:179:32 ()> #<procedure list _> ("lh" …))
> In ice-9/boot-9.scm:
> 1736:10 6 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
> In guix/store.scm:
> 632:37 5 (thunk)
> In guix/import/texlive.scm:
> 162:25 4 (_ _)
> In guix/serialization.scm:
> 324:6 3 (dump #f)
> 257:34 2 (_ _)
> In unknown file:
> 1 (lstat #f)
> In ice-9/boot-9.scm:
> 1669:16 0 (raise-exception _ #:continuable? _)
>
> ice-9/boot-9.scm:1669:16: In procedure raise-exception:
> Wrong type (expecting string): #f
>
> The same happens with other packages, such as 'ec'.

The reason appears to be that the svn reference URL is wrong;
unfortunately this information is not present in the SXML metadata
retrieved; it seems the best option when such an URL does not exist
would be to fallback to a SVN multi-fetch (perhaps using the
simple-texlive-package procedure to derive a template) of the components
found in the texlive.tlpdb listing found in the output of our
texlive-bin package.

TODO!

Maxim
R
R
Ricardo Wurmus wrote on 4 Jan 2021 19:47
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
87turwiloh.fsf@elephly.net
Hi Maxim,

Toggle quote (2 lines)
> The TeX Live importer doesn't appear to be functional:

Yes, sadly, it’s not very useful any more.

The next iteration of the importer should use texlive.tlpdb instead of
CTAN *and* the SVN repository.

--
Ricardo
M
M
Maxim Cournoyer wrote on 4 Jan 2021 20:06
[PATCH] import: texlive: Produce a partial package definition rather than crashing.
(address . 45656@debbugs.gnu.org)
20210104190645.7693-1-maxim.cournoyer@gmail.com
This is a small improvement awaiting a definitive fix for

* guix/import/texlive.scm (sxml->package): Produce a warning when the SVN
checkout failed. Rather than crashing on the unexpected #f value, return a
partial package definition with the source field set to #f.
---
guix/import/texlive.scm | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)

Toggle diff (61 lines)
diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm
index a84683ef6f..ba04a74d0f 100644
--- a/guix/import/texlive.scm
+++ b/guix/import/texlive.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -25,6 +26,8 @@
#:use-module (srfi srfi-26)
#:use-module (srfi srfi-34)
#:use-module (web uri)
+ #:use-module (guix diagnostics)
+ #:use-module (guix i18n)
#:use-module (guix http-client)
#:use-module (gcrypt hash)
#:use-module (guix memoization)
@@ -147,21 +150,26 @@ expression describing it."
((license) (string->license license))
((lst ...) (map string->license lst))))
(home-page (string-append "http://www.ctan.org/pkg/" id))
- (ref (texlive-ref component id))
- (checkout (download-svn-to-store store ref)))
+ (ref (pk (texlive-ref (pk 'component component) (pk 'id id))))
+ (checkout (pk 'download (download-svn-to-store store ref))))
+ (unless checkout
+ (warning (G_ "Could not determine source location. \
+Please manually specify the source field.~%")))
`(package
(name ,(guix-name component id))
(version ,version)
- (source (origin
- (method svn-fetch)
- (uri (texlive-ref ,component ,id))
- (sha256
- (base32
- ,(bytevector->nix-base32-string
- (let-values (((port get-hash) (open-sha256-port)))
- (write-file checkout port)
- (force-output port)
- (get-hash)))))))
+ (source ,(if checkout
+ `(origin
+ (method svn-fetch)
+ (uri (texlive-ref ,component ,id))
+ (sha256
+ (base32
+ ,(bytevector->nix-base32-string
+ (let-values (((port get-hash) (open-sha256-port)))
+ (write-file checkout port)
+ (force-output port)
+ (get-hash))))))
+ #f))
(build-system texlive-build-system)
(arguments ,`(,'quote (#:tex-directory ,(string-join (list component id) "/"))))
(home-page ,home-page)
--
2.29.2
M
M
Maxim Cournoyer wrote on 4 Jan 2021 20:13
[PATCH v2] import: texlive: Produce a partial package definition rather than crashing.
(address . 45656@debbugs.gnu.org)
20210104191314.8426-1-maxim.cournoyer@gmail.com
This is a small improvement awaiting a definitive fix for

* guix/import/texlive.scm (sxml->package): Produce a warning when the SVN
checkout failed. Rather than crashing on the unexpected #f value, return a
partial package definition with the source field set to #f.
---
guix/import/texlive.scm | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)

Toggle diff (57 lines)
diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm
index a84683ef6f..18d8b95ee0 100644
--- a/guix/import/texlive.scm
+++ b/guix/import/texlive.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -25,6 +26,8 @@
#:use-module (srfi srfi-26)
#:use-module (srfi srfi-34)
#:use-module (web uri)
+ #:use-module (guix diagnostics)
+ #:use-module (guix i18n)
#:use-module (guix http-client)
#:use-module (gcrypt hash)
#:use-module (guix memoization)
@@ -149,19 +152,24 @@ expression describing it."
(home-page (string-append "http://www.ctan.org/pkg/" id))
(ref (texlive-ref component id))
(checkout (download-svn-to-store store ref)))
+ (unless checkout
+ (warning (G_ "Could not determine source location. \
+Please manually specify the source field.~%")))
`(package
(name ,(guix-name component id))
(version ,version)
- (source (origin
- (method svn-fetch)
- (uri (texlive-ref ,component ,id))
- (sha256
- (base32
- ,(bytevector->nix-base32-string
- (let-values (((port get-hash) (open-sha256-port)))
- (write-file checkout port)
- (force-output port)
- (get-hash)))))))
+ (source ,(if checkout
+ `(origin
+ (method svn-fetch)
+ (uri (texlive-ref ,component ,id))
+ (sha256
+ (base32
+ ,(bytevector->nix-base32-string
+ (let-values (((port get-hash) (open-sha256-port)))
+ (write-file checkout port)
+ (force-output port)
+ (get-hash))))))
+ #f))
(build-system texlive-build-system)
(arguments ,`(,'quote (#:tex-directory ,(string-join (list component id) "/"))))
(home-page ,home-page)
--
2.29.2
M
M
Maxim Cournoyer wrote on 11 Jan 2021 14:20
control message for bug #45656
(address . control@debbugs.gnu.org)
87o8hvobin.fsf@gmail.com
retitle 45656 The TeX Live importer should use the texlive.tlpdb database as its input
quit
M
M
Maxim Cournoyer wrote on 19 Aug 2021 04:52
control message for bug #49977
(address . control@debbugs.gnu.org)
87bl5uw3g9.fsf@gmail.com
merge 49977 45656
quit
R
R
Ricardo Wurmus wrote on 21 Nov 2021 09:14
The TeX Live importer should use the texlive.tlpdb database as its input
(address . 45656-done@debbugs.gnu.org)
878rxhhqm4.fsf@elephly.net
We now have a new importer that uses the texlive.tlpdb. It still
needs a lot of work, but it should already be more useful than the
previous importer.
Closing.

--
Ricardo
Closed
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 45656
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