unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#45656: The TeX Live importer crashes with Wrong type (expecting string): #f
@ 2021-01-04 17:11 Maxim Cournoyer
  2021-01-04 18:30 ` Maxim Cournoyer
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Maxim Cournoyer @ 2021-01-04 17:11 UTC (permalink / raw)
  To: 45656

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




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

* bug#45656: The TeX Live importer crashes with Wrong type (expecting string): #f
  2021-01-04 17:11 bug#45656: The TeX Live importer crashes with Wrong type (expecting string): #f Maxim Cournoyer
@ 2021-01-04 18:30 ` Maxim Cournoyer
  2021-01-04 18:47 ` Ricardo Wurmus
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Maxim Cournoyer @ 2021-01-04 18:30 UTC (permalink / raw)
  To: 45656

Hello,

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

> 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




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

* bug#45656: The TeX Live importer crashes with Wrong type (expecting string): #f
  2021-01-04 17:11 bug#45656: The TeX Live importer crashes with Wrong type (expecting string): #f Maxim Cournoyer
  2021-01-04 18:30 ` Maxim Cournoyer
@ 2021-01-04 18:47 ` Ricardo Wurmus
  2021-01-04 19:06 ` bug#45656: [PATCH] import: texlive: Produce a partial package definition rather than crashing Maxim Cournoyer
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Ricardo Wurmus @ 2021-01-04 18:47 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: 45656


Hi Maxim,

> 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




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

* bug#45656: [PATCH] import: texlive: Produce a partial package definition rather than crashing.
  2021-01-04 17:11 bug#45656: The TeX Live importer crashes with Wrong type (expecting string): #f Maxim Cournoyer
  2021-01-04 18:30 ` Maxim Cournoyer
  2021-01-04 18:47 ` Ricardo Wurmus
@ 2021-01-04 19:06 ` Maxim Cournoyer
  2021-01-04 19:13 ` bug#45656: [PATCH v2] " Maxim Cournoyer
  2021-11-21  8:14 ` bug#45656: The TeX Live importer should use the texlive.tlpdb database as its input Ricardo Wurmus
  4 siblings, 0 replies; 6+ messages in thread
From: Maxim Cournoyer @ 2021-01-04 19:06 UTC (permalink / raw)
  To: 45656; +Cc: Maxim Cournoyer

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=yes, Size: 3042 bytes --]

This is a small improvement awaiting a definitive fix for
<https://issues.guix.gnu.org/45656>.

* 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(-)

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





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

* bug#45656: [PATCH v2] import: texlive: Produce a partial package definition rather than crashing.
  2021-01-04 17:11 bug#45656: The TeX Live importer crashes with Wrong type (expecting string): #f Maxim Cournoyer
                   ` (2 preceding siblings ...)
  2021-01-04 19:06 ` bug#45656: [PATCH] import: texlive: Produce a partial package definition rather than crashing Maxim Cournoyer
@ 2021-01-04 19:13 ` Maxim Cournoyer
  2021-11-21  8:14 ` bug#45656: The TeX Live importer should use the texlive.tlpdb database as its input Ricardo Wurmus
  4 siblings, 0 replies; 6+ messages in thread
From: Maxim Cournoyer @ 2021-01-04 19:13 UTC (permalink / raw)
  To: 45656; +Cc: Maxim Cournoyer

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=yes, Size: 2750 bytes --]

This is a small improvement awaiting a definitive fix for
<https://issues.guix.gnu.org/45656>.

* 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(-)

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





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

* bug#45656: The TeX Live importer should use the texlive.tlpdb database as its input
  2021-01-04 17:11 bug#45656: The TeX Live importer crashes with Wrong type (expecting string): #f Maxim Cournoyer
                   ` (3 preceding siblings ...)
  2021-01-04 19:13 ` bug#45656: [PATCH v2] " Maxim Cournoyer
@ 2021-11-21  8:14 ` Ricardo Wurmus
  4 siblings, 0 replies; 6+ messages in thread
From: Ricardo Wurmus @ 2021-11-21  8:14 UTC (permalink / raw)
  To: 45656-done

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




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

end of thread, other threads:[~2021-11-21  8:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-04 17:11 bug#45656: The TeX Live importer crashes with Wrong type (expecting string): #f Maxim Cournoyer
2021-01-04 18:30 ` Maxim Cournoyer
2021-01-04 18:47 ` Ricardo Wurmus
2021-01-04 19:06 ` bug#45656: [PATCH] import: texlive: Produce a partial package definition rather than crashing Maxim Cournoyer
2021-01-04 19:13 ` bug#45656: [PATCH v2] " Maxim Cournoyer
2021-11-21  8:14 ` bug#45656: The TeX Live importer should use the texlive.tlpdb database as its input Ricardo Wurmus

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).