Message ID | 20220615150434.11604-2-tom@tom-fitzhenry.me.uk |
---|---|
State | Accepted |
Headers | show |
Series | Remove texlive's dependence on mariadb. | expand |
Context | Check | Description |
---|---|---|
cbaines/comparison | success | View comparision |
cbaines/git branch | success | View Git branch |
cbaines/applying patch | success | View Laminar job |
cbaines/issue | success | View issue |
Tom Fitzhenry schreef op do 16-06-2022 om 01:04 [+1000]: > +index 12831417..df6daa39 100644 > +--- a/lib/tex/hyphen/language.rb > ++++ b/lib/tex/hyphen/language.rb > +@@ -1,6 +1,5 @@ > + require 'yaml' > + require 'hydra' > +-require 'byebug' > + > + require_relative 'path' > + I recommend a small description: ’Avoid dependency on byebug to reduce package closure significantly, see https://issues.guix.gnu.org/55997’. Also, patches need to be added to gnu/local.mk because $reasons. > (sha256 > (base32 > "04xzf5gr3ylyh3ls09imrx4mwq3qp1k97r9njzlan6hlff875rx2")))) > @@ -225,7 +226,7 @@ (define (texlive-hyphen-package name code locations hash) > (invoke "ruby" "generate-ptex-patterns.rb"))))))))) > (native-inputs > `(("ruby" ,ruby) > - ("ruby-hydra" ,ruby-hydra) > + ("ruby-hydra-minimal" ,ruby-hydra-minimal) > ("hyph-utf8-scripts" ,hyph-utf8-scripts))) While we are rebuilding anyway, could you eliminate input labels (in a separate patch)? (native-inputs (list ruby ruby-hydra-minimal hyph-utf8-scripts)) Anyway, the concept looks good to me, though I haven't done any practical testing! Greetings, Maxime.
Maxime Devos <maximedevos@telenet.be> writes: > I recommend a small description: ’Avoid dependency on byebug to reduce > package closure significantly, see https://issues.guix.gnu.org/55997’. > Also, patches need to be added to gnu/local.mk because $reasons. SGTM. I'll add this to v2. > While we are rebuilding anyway, could you eliminate input labels (in a > separate patch)? > > (native-inputs (list ruby ruby-hydra-minimal hyph-utf8-scripts)) I tried this, but this causes a build phase failure for texlive-hyphen-package packages: --8<---------------cut here---------------start------------->8--- starting phase `build' error: in phase 'build': uncaught exception: wrong-type-arg "string-length" "Wrong type argument in position ~A (expecting ~A): ~S" (1 "string" #f) (#f) phase `build' failed after 0.0 seconds Backtrace: 10 (primitive-load "/gnu/store/b133miwd62x14d2lsbrsx1dk4rx…") In guix/build/gnu-build-system.scm: 906:2 9 (gnu-build #:source _ #:outputs _ #:inputs _ #:phases . #) In ice-9/boot-9.scm: 1752:10 8 (with-exception-handler _ _ #:unwind? _ # _) In srfi/srfi-1.scm: 634:9 7 (for-each #<procedure 553260 at guix/build/gnu-build-s…> …) In ice-9/boot-9.scm: 1752:10 6 (with-exception-handler _ _ #:unwind? _ # _) In guix/build/gnu-build-system.scm: 927:23 5 (_) In ice-9/eval.scm: 619:8 4 (_ #(#(#(#(#(#(#(#(#<directory (g…>) …) …) …) …) …) …) …)) In guix/build/utils.scm: 390:15 3 (copy-recursively #f "scripts" #:log _ # _ #:copy-file _ …) In unknown file: 2 (string-length #f) In ice-9/boot-9.scm: 1685:16 1 (raise-exception _ #:continuable? _) 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: In procedure string-length: Wrong type argument in position 1 (expecting string): #f --8<---------------cut here---------------end--------------->8--- The failing line is gnu/packages/tex.scm line 188 [0]: (copy-recursively (assoc-ref inputs "hyph-utf8-scripts") "scripts") This fails because the assoc-ref call returns #f, presumably because native-inputs is no longer an alist. To try to find a new-style way to recursively copy an entire input, I read https://guix.gnu.org/blog/2021/the-big-change/ and searched the codebase, but I was unable to find any. The closest I could find was to use search-input-directory, but this seems to only be suitable to copy known subdirectories across all inputs, not an entire single input. Do you know of any way/examples to recursively copy entire single inputs? > Anyway, the concept looks good to me, though I haven't done any > practical testing! Great! I will provide testing details in v2. 0. https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/tex.scm?id=793ce82c9d5ead8457da9cec8d1d8afc12704f10#n188
Tom Fitzhenry schreef op ma 20-06-2022 om 00:01 [+1000]: > (copy-recursively > (assoc-ref inputs "hyph-utf8-scripts") "scripts") > > This fails because the assoc-ref call returns #f, presumably because > native-inputs is no longer an alist. It's still an alist under the hood. > To try to find a new-style way to recursively copy an entire input, I > read https://guix.gnu.org/blog/2021/the-big-change/ and searched the > codebase, but I was unable to find any. > > The closest I could find was to use search-input-directory, but > this seems to only be suitable to copy known subdirectories across > all inputs, not an entire single input. Two options: insert the input directly into the G-exp: (copy-recursively #+hyph-utf8-scripts "scripts") or: search for a file in hyph-utf8-scripts and then extract the directory name: (copy-recursively (dirname (search-input-file inputs "hyph-utf8.rb")) "scripts") . I'd prefer the latter because that makes it easier to define a custom texlive-hyphen-... package replacing hyph-utf8-scripts by a custom hyph-utf8-scripts by using simple package transformations (e.g.: inherit + replace the native-inputs). Greetings, Maxime
diff --git a/gnu/packages/patches/texlive-hyph-utf8-no-byebug.patch b/gnu/packages/patches/texlive-hyph-utf8-no-byebug.patch new file mode 100644 index 0000000000..92d12d6665 --- /dev/null +++ b/gnu/packages/patches/texlive-hyph-utf8-no-byebug.patch @@ -0,0 +1,11 @@ +diff --git a/lib/tex/hyphen/language.rb b/lib/tex/hyphen/language.rb +index 12831417..df6daa39 100644 +--- a/lib/tex/hyphen/language.rb ++++ b/lib/tex/hyphen/language.rb +@@ -1,6 +1,5 @@ + require 'yaml' + require 'hydra' +-require 'byebug' + + require_relative 'path' + diff --git a/gnu/packages/tex.scm b/gnu/packages/tex.scm index 1dd3f09f90..33e2fab23c 100644 --- a/gnu/packages/tex.scm +++ b/gnu/packages/tex.scm @@ -157,6 +157,7 @@ (define hyph-utf8-scripts (file-name (string-append "hyph-utf8-scripts-" (number->string %texlive-revision) "-checkout")) + (patches (search-patches "texlive-hyph-utf8-no-byebug.patch")) (sha256 (base32 "04xzf5gr3ylyh3ls09imrx4mwq3qp1k97r9njzlan6hlff875rx2")))) @@ -225,7 +226,7 @@ (define (texlive-hyphen-package name code locations hash) (invoke "ruby" "generate-ptex-patterns.rb"))))))))) (native-inputs `(("ruby" ,ruby) - ("ruby-hydra" ,ruby-hydra) + ("ruby-hydra-minimal" ,ruby-hydra-minimal) ("hyph-utf8-scripts" ,hyph-utf8-scripts))) (home-page "https://ctan.org/pkg/hyph-utf8"))))