unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* getting started with the texlive importer
@ 2020-09-08  9:15 Paul Garlick
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Garlick @ 2020-09-08  9:15 UTC (permalink / raw)
  To: guix-devel

Hi Guix,

I have been trying to use the texlive importer to package some TeXLive
packages.

Using the example from the manual, I try:

$ guix import texlive fontspec

I get:

following redirection to `https://ctan.org/xml/1.2/pkg/fontspec'...
Backtrace:
          13 (primitive-load "/usr/local/bin/guix")
In guix/ui.scm:
  2050:12 12 (run-guix-command _ . _)
In guix/scripts/import.scm:
   116:11 11 (guix-import . _)
In guix/scripts/import/texlive.scm:
    91:19 10 (guix-import-texlive . _)
In guix/memoization.scm:
     98:0  9 (mproc "fontspec" "latex")
In unknown file:
           8 (_ #<procedure 7f1e93b6c920 at guix/memoization.scm:17…>
…)
In ice-9/boot-9.scm:
  1736:10  7 (with-exception-handler _ _ #:unwind? _ # _)
In guix/store.scm:
   631:37  6 (thunk)
In guix/import/texlive.scm:
   151:23  5 (_ #<store-connection 256.99 7f1e93c36370>)
In guix/utils.scm:
    705:8  4 (call-with-temporary-directory #<procedure 7f1e93c08900…>)
In guix/svn-download.scm:
   160:14  3 (_ "/tmp/guix-directory.nfum2k")
In guix/build/svn.scm:
     39:2  2 (svn-fetch _ _ _ #:svn-command _ #:recursive? _ # _ # _)
In guix/build/utils.scm:
    654:6  1 (invoke _ . _)
In ice-9/boot-9.scm:
  1669:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1669:16: In procedure raise-exception:
ERROR:
  1. &invoke-error:
      program: "svn"
      arguments: ("export" "--non-interactive" "--trust-server-cert" "-
r" "51265" "svn://
www.tug.org/texlive/tags/texlive-2019.3/Master/texmf-dist/source/latex/fontspec
" "/tmp/guix-directory.nfum2k")
      exit-status: 1
      term-signal: #f
      stop-signal: #f

So the 'svn export' command is causing an error.  Interestingly, if I
run the same command from the shell it succeeds; the files are
downloaded to the temporary directory.

Are others seeing the same thing?  I wonder whether a recent change in
guix has jiggered the importer.

Best regards,

Paul.



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

* Re: getting started with the texlive importer
@ 2020-09-09 11:53 Paul Garlick
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Garlick @ 2020-09-09 11:53 UTC (permalink / raw)
  To: guix-devel

Hi Guix,

I have been able to run the texlive importer after making some changes
to guix/import/texlive.scm:

@@ -148,20 +148,22 @@ expression describing it."
                          ((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)))
+           ;; (checkout   (download-svn-to-store store ref))
+           )
       `(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)))))))
+                   ;; (sha256
+                   ;;  (base32
+                   ;;   ,(bytevector->nix-base32-string
+                   ;;     (let-values (((port get-hash) (open-sha256-
port)))
+                   ;;       (write-file checkout port)
+                   ;;       (force-output port)
+                   ;;       (get-hash)))))
+                   ))
          (build-system texlive-build-system)
          (arguments ,`(,'quote (#:tex-directory ,(string-join (list
component id) "/"))))
          (home-page ,home-page)

This successfully produces a definition, albeit without the hash field.

So it seems that the procedure 'download-svn-to-store ' is the source
of the original error.  Any ideas on how to fix?

Paul.  



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

* Re: getting started with the texlive importer
@ 2020-09-10 16:19 Paul Garlick
  2020-09-10 17:02 ` John Soo
  2020-09-10 18:20 ` Ricardo Wurmus
  0 siblings, 2 replies; 6+ messages in thread
From: Paul Garlick @ 2020-09-10 16:19 UTC (permalink / raw)
  To: guix-devel

Hi Guix,

Ok, I have found a fix.

It turns out that the 'svn export' command throws an error if the
target directory already exists.  

Initially I set the 'log' argument of 'download-svn-to-store' to
'current-output-port' to see the error message from svn:

svn: E155000: Destination directory exists; please remove the directory
or use - -force to overwrite

This error is generated because a temporary directory is created by the
'call-with-temporary-directory' procedure (from svn-download.scm).  The
name of the directory is used as an argument for the 'svn export'
command.

The fix I have tested is the following:

--- a/guix/svn-download.scm
+++ b/guix/svn-download.scm
@@ -159,10 +159,11 @@ reports to LOG."
             (parameterize ((current-output-port log))
               (build:svn-fetch (svn-reference-url ref)
                                (svn-reference-revision ref)
-                               temp
+                               (string-append temp "/svn")
                                #:user-name (svn-reference-user-name
ref)
                                #:password (svn-reference-password
ref)))))
        (and result
-            (add-to-store store name #t "sha256" temp))))))
+            (add-to-store store name #t "sha256"
+                          (string-append temp "/svn")))))))
 
 ;;; svn-download.scm ends here

The effect is to add a subdirectory to the temporary directory.  This
is used as the target to download the files to.  It does not exist
until created by the 'svn export' command.

WDYT?  If there are no objections I will push a commit early next week.

Best regards,

Paul.



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

* Re: getting started with the texlive importer
  2020-09-10 16:19 getting started with the texlive importer Paul Garlick
@ 2020-09-10 17:02 ` John Soo
  2020-09-10 18:20 ` Ricardo Wurmus
  1 sibling, 0 replies; 6+ messages in thread
From: John Soo @ 2020-09-10 17:02 UTC (permalink / raw)
  To: Paul Garlick; +Cc: guix-devel

Nice work!

That bug has been around for years I think.

Thanks!

John


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

* Re: getting started with the texlive importer
  2020-09-10 16:19 getting started with the texlive importer Paul Garlick
  2020-09-10 17:02 ` John Soo
@ 2020-09-10 18:20 ` Ricardo Wurmus
  2020-09-14 13:52   ` Paul Garlick
  1 sibling, 1 reply; 6+ messages in thread
From: Ricardo Wurmus @ 2020-09-10 18:20 UTC (permalink / raw)
  To: Paul Garlick; +Cc: guix-devel


Hi Paul,

> Ok, I have found a fix.
[…]
> The effect is to add a subdirectory to the temporary directory.  This
> is used as the target to download the files to.  It does not exist
> until created by the 'svn export' command.

Interesting!  I think I added this back then and at some point it used
to work as intended.  It’s a bit odd that it broke long ago, but I’m
very happy you found a way around this error!

> WDYT?  If there are no objections I will push a commit early next week.

Looks good to me.  Please push!

-- 
Ricardo


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

* Re: getting started with the texlive importer
  2020-09-10 18:20 ` Ricardo Wurmus
@ 2020-09-14 13:52   ` Paul Garlick
  0 siblings, 0 replies; 6+ messages in thread
From: Paul Garlick @ 2020-09-14 13:52 UTC (permalink / raw)
  To: Ricardo Wurmus, John Soo; +Cc: guix-devel

Hi Ricardo, Hi John,

> Looks good to me.  Please push!

Cheers!

Pushed as 735808b12cc23909b421e10e212a07e7aa69a5eb 

Best regards,

Paul.





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

end of thread, other threads:[~2020-09-14 13:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 16:19 getting started with the texlive importer Paul Garlick
2020-09-10 17:02 ` John Soo
2020-09-10 18:20 ` Ricardo Wurmus
2020-09-14 13:52   ` Paul Garlick
  -- strict thread matches above, loose matches on Subject: below --
2020-09-09 11:53 Paul Garlick
2020-09-08  9:15 Paul Garlick

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