bug#56556: texlive-babel-dutch with and without texlive-hyphen-dutch: No hyphenation patterns were preloaded

2023-05-19 Thread Simon Tournier
Hi,

Argh!  I am just annoyed by this bug too; and again and again.  How to
make progress?

On ven., 07 avril 2023 at 12:47, Emmanuel Beffara  wrote:

>> > I don't really know how we could fix this: maybe build the formats with
>> > all the hyphenation packages enabled?
>>
>> The intertubes suggest running ‘fmtutil --all’ to get hyphenations
>> packages straight.  Is this something we should do in the TeX Live
>> profile hook for example?
>>
>> Emmanuel, is this what you had in mind when you wrote about compilation
>> of hyphenation patterns above?
>
> Indeed !
>
> Doing that is the job of fmtutil and it should be used for building
> environments that include parts of TeXlive.

Well, it does not appear as easy as the intertubes is suggesting. ;-)

First, please note that texlive-babel- drags texlive-hyphen-

--8<---cut here---start->8---
$ guix graph --path texlive-babel-french texlive-hyphen-esperanto -t bag-emerged
texlive-babel-french@59745
texlive-latex-base@59745
texlive-hyphen-esperanto@59745
--8<---cut here---end--->8---

Other said, the profile contains all the hyphenations for all the
languages.  Therefore, I am not sure ’fmtutil --all’ will do the job out
of the box – I do not know.  Savvy TeX folk, WDYT?

--8<---cut here---start->8---
$ guix shell texlive-base texlive-babel-french
$ find $GUIX_ENVIRONMENT -name "*hyph-*" -print | wc -l
318

$ find $GUIX_ENVIRONMENT -name "*hyph-*" -print | head
/gnu/store/iffpalk5vyyykmll7i9g89lnyzcj505b-profile/share/texmf-dist/scripts/hyph-utf8.rb
/gnu/store/iffpalk5vyyykmll7i9g89lnyzcj505b-profile/share/texmf-dist/scripts/languages/es/eshyph-make.lua
/gnu/store/iffpalk5vyyykmll7i9g89lnyzcj505b-profile/share/texmf-dist/tex/generic/dehyph-exptl
/gnu/store/iffpalk5vyyykmll7i9g89lnyzcj505b-profile/share/texmf-dist/tex/generic/hyph-utf8
/gnu/store/iffpalk5vyyykmll7i9g89lnyzcj505b-profile/share/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyph-cs.tex
/gnu/store/iffpalk5vyyykmll7i9g89lnyzcj505b-profile/share/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyph-rm.tex
/gnu/store/iffpalk5vyyykmll7i9g89lnyzcj505b-profile/share/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyph-ml.tex
/gnu/store/iffpalk5vyyykmll7i9g89lnyzcj505b-profile/share/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyph-lt.tex
/gnu/store/iffpalk5vyyykmll7i9g89lnyzcj505b-profile/share/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyph-pt.tex
/gnu/store/iffpalk5vyyykmll7i9g89lnyzcj505b-profile/share/texmf-dist/tex/generic/hyph-utf8/loadhyph/loadhyph-mr.tex
--8<---cut here---end--->8---


Now, let try ’fmtutil --all’ as part of some hook:

--8<---cut here---start->8---
$ git diff
diff --git a/guix/profiles.scm b/guix/profiles.scm
index 6467e464c8..b785fefb08 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -1854,6 +1854,12 @@ (define (texlive-font-maps manifest)
 (string-append "--pdftexoutputdir="
maproot "pdftex/updmap"))

+(pk 'start)
+;; Generate hyphenations for Babel and friends.
+(invoke #$(file-append texlive-bin "/bin/fmtutil-sys")
+"--all")
+(pk 'end)
+
 ;; Create ls-R file.  I know, that's not *just* for font maps, but
 ;; we've generated new files, so there's no point in running it
 ;; any earlier.  The ls-R file must act on a full TeX Live tree,
@@ -1870,7 +1876,7 @@ (define (texlive-font-maps manifest)

   (mlet %store-monad ((texlive-base (manifest-lookup-package manifest 
"texlive-base")))
 (if (and texlive-base (pair? texlive-inputs))
-(gexp->derivation "texlive-font-maps" build
+(gexp->derivation "texlive-font-maps-debug" build
   #:substitutable? #f
   #:local-build? #t
   #:properties

$ ./pre-inst-env guix shell texlive-base texlive-babel-french --rebuild-cache
The following derivation will be built:
  /gnu/store/hj7gc1phqqai88cq6blrxvmrifsyhy3h-profile.drv

building TeX Live font maps...
-builder for 
`/gnu/store/37mjkgann15rj95m3vqjs8d20kssz8pm-texlive-font-maps-debug.drv' 
failed with exit code 1
build of 
/gnu/store/37mjkgann15rj95m3vqjs8d20kssz8pm-texlive-font-maps-debug.drv failed
View build log at 
'/var/log/guix/drvs/37/mjkgann15rj95m3vqjs8d20kssz8pm-texlive-font-maps-debug.drv.gz'.
cannot build derivation 
`/gnu/store/hj7gc1phqqai88cq6blrxvmrifsyhy3h-profile.drv': 1 dependencies 
couldn't be built
guix shell: error: build of 
`/gnu/store/hj7gc1phqqai88cq6blrxvmrifsyhy3h-profile.drv' failed
--8<---cut here---end--->8---

Hum, let’s inspect the log of this derivation.  See below the complete
log.  Roughly speaking:

--8<---cut here---start->8---
fmtutil [INFO]: disabled 

bug#56556: texlive-babel-dutch with and without texlive-hyphen-dutch: No hyphenation patterns were preloaded

2023-04-07 Thread Emmanuel Beffara
Hi,

De Ludovic Courtès le 07/04/2023 à 12:33:
> > I don't really know how we could fix this: maybe build the formats with
> > all the hyphenation packages enabled?
> 
> The intertubes suggest running ‘fmtutil --all’ to get hyphenations
> packages straight.  Is this something we should do in the TeX Live
> profile hook for example?
> 
> Emmanuel, is this what you had in mind when you wrote about compilation
> of hyphenation patterns above?

Indeed !

Doing that is the job of fmtutil and it should be used for building
environments that include parts of TeXlive.

-- 
Emmanuel





bug#56556: texlive-babel-dutch with and without texlive-hyphen-dutch: No hyphenation patterns were preloaded

2023-04-07 Thread Ludovic Courtès
Hello Josselin and all,

I was just bitten by the infamous:

  Package babel Warning: No hyphenation patterns were preloaded for
  […]

That’s a real issue because it makes modular TeX Live pretty much
unusable for languages other than English.

Josselin Poiret  skribis:

>> Thirdly, formats are apparently not handled right. The main issue is with
>> hyphenation (hence the cc on an open issue): hyphenation patterns need to be
>> compiled into the formats to be available in documents, so the format files
>> should be built depending on which `texlive-hyphen-something` packages are
>> installed. Currently this is not the case:
>>
>> ```
>> $ guix shell --pure coreutils texlive-base texlive-latex-base -- /bin/sh -c 
>> 'realpath $GUIX_TEXMF/web2c/pdflatex.fmt'
>> /gnu/store/m1vh5mm4gjlqzaylfxmxbx5g3j20k8wn-texlive-latex-base-59745/share/texmf-dist/web2c/pdflatex.fmt
>> $ guix shell --pure coreutils texlive-base texlive-latex-base 
>> texlive-hyphen-base texlive-hyphen-french -- /bin/sh -c 'realpath 
>> $GUIX_TEXMF/web2c/pdflatex.fmt'
>> /gnu/store/m1vh5mm4gjlqzaylfxmxbx5g3j20k8wn-texlive-latex-base-59745/share/texmf-dist/web2c/pdflatex.fmt
>> ```
>>
>> If the format is always the same, then no modular installation can do any
>> hyphenation, as reported in https://issues.guix.gnu.org/56556. There might be
>> other things than hyphenation that require similar treatment.
>
> I don't really know how we could fix this: maybe build the formats with
> all the hyphenation packages enabled?

The intertubes suggest running ‘fmtutil --all’ to get hyphenations
packages straight.  Is this something we should do in the TeX Live
profile hook for example?

Emmanuel, is this what you had in mind when you wrote about compilation
of hyphenation patterns above?

(Cc’ing Maxim who has experience with TeX Live.)

Thanks,
Ludo’.





bug#56556: TeXlive packaging issues

2023-03-29 Thread Josselin Poiret via Bug reports for GNU Guix
Hi Emmanuel,

Emmanuel Beffara  writes:

> Firstly, unless I am missing something, creating a manifest with the right set
> of packages is tedious: one has to guess the Guix package that matches each
> LaTeX package, and the correspondence is not obvious. Thankfully, with a
> working installation, `tlmgr show something.sty` helps finding the TeXlive
> package that contains the file and `guix search texlive something` finds the
> corresponding Guix package if there is one (it could be named
> `texlive-something` or `texlive-latex-something`, this feels somewhat
> inconsistent). When trying to compile a complex document, doing that for every
> package and dependency is time-consuming (compile, read compilation errors,
> install more packages, restart).

I agree, although this is because the tex packages aren't super well
packaged.  A lot of dependencies aren't actually included, meaning you
need to add them manually.  This could be improved by just fixing those
package definitions to include them, I actually have some comments about
this in my TODOs.

> Secondly, many packages are missing. Apparently, `(gnu packages tex)` contains
> an arbitrary set of common packages, likely defined by people who needed them
> and had the skill to produce a patch for them. It is fairly easy to produce
> new definitions using `guix import texlive something` and adjusting the
> result, still it feels more complicated than it ought to be. Considering how
> well TeXlive is organized, it should be possible to automatically extract the
> set of all packages in a given release and turn the result into a big
> comprehensive Guile module.

Actually, no, for 2 reasons: as you said, you often need to adjust the
result of the import, and some of them need to be individually
inspected.  Also, upstream doesn't report what inter-package
dependencies there are (AFAIK).  This prevents us from generating the
right packages (see above).

> Besides, importing TeXlive "collections" could be a useful intermediate
> between taking the whole system and picking packages individually.
>
> Thirdly, formats are apparently not handled right. The main issue is with
> hyphenation (hence the cc on an open issue): hyphenation patterns need to be
> compiled into the formats to be available in documents, so the format files
> should be built depending on which `texlive-hyphen-something` packages are
> installed. Currently this is not the case:
>
> ```
> $ guix shell --pure coreutils texlive-base texlive-latex-base -- /bin/sh -c 
> 'realpath $GUIX_TEXMF/web2c/pdflatex.fmt'
> /gnu/store/m1vh5mm4gjlqzaylfxmxbx5g3j20k8wn-texlive-latex-base-59745/share/texmf-dist/web2c/pdflatex.fmt
> $ guix shell --pure coreutils texlive-base texlive-latex-base 
> texlive-hyphen-base texlive-hyphen-french -- /bin/sh -c 'realpath 
> $GUIX_TEXMF/web2c/pdflatex.fmt'
> /gnu/store/m1vh5mm4gjlqzaylfxmxbx5g3j20k8wn-texlive-latex-base-59745/share/texmf-dist/web2c/pdflatex.fmt
> ```
>
> If the format is always the same, then no modular installation can do any
> hyphenation, as reported in https://issues.guix.gnu.org/56556. There might be
> other things than hyphenation that require similar treatment.

I don't really know how we could fix this: maybe build the formats with
all the hyphenation packages enabled?

> That said, I don't know what would be the best way to contribute.

I think fixing step by step all the packages you find to be deficient is
already a good first step.  I've been planning to do that as well but
got swept up in other things.

HTH!

Best,
-- 
Josselin Poiret


signature.asc
Description: PGP signature


bug#56556: TeXlive packaging issues

2023-03-28 Thread Emmanuel Beffara
Hello Guix,

I would like to share a few thoughts on how TeXlive is currently handled in
Guix. The package `texlive` contains all of TeXlive, it works fine but it is
arguably too big to be practical. The documentation rightfully says

> We recommend using the modular package set because it is much less
> resource-hungry. 

Yet assembling modular sets is problematic for various reasons.

Firstly, unless I am missing something, creating a manifest with the right set
of packages is tedious: one has to guess the Guix package that matches each
LaTeX package, and the correspondence is not obvious. Thankfully, with a
working installation, `tlmgr show something.sty` helps finding the TeXlive
package that contains the file and `guix search texlive something` finds the
corresponding Guix package if there is one (it could be named
`texlive-something` or `texlive-latex-something`, this feels somewhat
inconsistent). When trying to compile a complex document, doing that for every
package and dependency is time-consuming (compile, read compilation errors,
install more packages, restart).

Secondly, many packages are missing. Apparently, `(gnu packages tex)` contains
an arbitrary set of common packages, likely defined by people who needed them
and had the skill to produce a patch for them. It is fairly easy to produce
new definitions using `guix import texlive something` and adjusting the
result, still it feels more complicated than it ought to be. Considering how
well TeXlive is organized, it should be possible to automatically extract the
set of all packages in a given release and turn the result into a big
comprehensive Guile module.

Besides, importing TeXlive "collections" could be a useful intermediate
between taking the whole system and picking packages individually.

Thirdly, formats are apparently not handled right. The main issue is with
hyphenation (hence the cc on an open issue): hyphenation patterns need to be
compiled into the formats to be available in documents, so the format files
should be built depending on which `texlive-hyphen-something` packages are
installed. Currently this is not the case:

```
$ guix shell --pure coreutils texlive-base texlive-latex-base -- /bin/sh -c 
'realpath $GUIX_TEXMF/web2c/pdflatex.fmt'
/gnu/store/m1vh5mm4gjlqzaylfxmxbx5g3j20k8wn-texlive-latex-base-59745/share/texmf-dist/web2c/pdflatex.fmt
$ guix shell --pure coreutils texlive-base texlive-latex-base 
texlive-hyphen-base texlive-hyphen-french -- /bin/sh -c 'realpath 
$GUIX_TEXMF/web2c/pdflatex.fmt'
/gnu/store/m1vh5mm4gjlqzaylfxmxbx5g3j20k8wn-texlive-latex-base-59745/share/texmf-dist/web2c/pdflatex.fmt
```

If the format is always the same, then no modular installation can do any
hyphenation, as reported in https://issues.guix.gnu.org/56556. There might be
other things than hyphenation that require similar treatment.

That said, I don't know what would be the best way to contribute.

-- 
Emmanuel





bug#56556:

2022-08-09 Thread Wicki Gabriel (wicg)
I have the same issue. Tested in German language -- it works just fine with the 
full-fledged LaTeX environment.


bug#56556: texlive-babel-dutch with and without texlive-hyphen-dutch: No hyphenation patterns were preloaded

2022-07-14 Thread Remco van 't Veer
Neither texlive-babel-dutch nor texlive-hyphen-dutch load hyphenation.

Test document:

  \documentclass{article}
  \usepackage[dutch]{babel}
  \begin{document}
  test
  \end{document}

Running with texlive-babel-dutch only:

  $ guix shell --pure texlive-base texlive-babel-dutch -- pdflatex test.tex
  This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/GNU Guix) 
(preloaded format=pdflatex)
   restricted \write18 enabled.
  entering extended mode
  (./test.tex
  LaTeX2e <2020-10-01> patch level 4
  L3 programming layer <2021-02-18> 
(/gnu/store/1p55mddnasba5xq2vcnzyc8wjywn4cwn-profile/share/texmf-dist/tex/latex/base/article.cls
  Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
  
(/gnu/store/1p55mddnasba5xq2vcnzyc8wjywn4cwn-profile/share/texmf-dist/tex/latex/base/size10.clo))
 
(/gnu/store/1p55mddnasba5xq2vcnzyc8wjywn4cwn-profile/share/texmf-dist/tex/generic/babel/babel.sty
 
(/gnu/store/1p55mddnasba5xq2vcnzyc8wjywn4cwn-profile/share/texmf-dist/tex/generic/babel/babel.def
 
(/gnu/store/1p55mddnasba5xq2vcnzyc8wjywn4cwn-profile/share/texmf-dist/tex/generic/config/language.def)
 
(/gnu/store/1p55mddnasba5xq2vcnzyc8wjywn4cwn-profile/share/texmf-dist/tex/generic/babel/txtbabel.def))
 
(/gnu/store/1p55mddnasba5xq2vcnzyc8wjywn4cwn-profile/share/texmf-dist/tex/generic/babel-dutch/dutch.ldf

  Package babel Warning: No hyphenation patterns were preloaded for
  (babel)the language `Dutch' into the format.
  (babel)Please, configure your TeX system to add them and
  (babel)rebuild the format. Now I will use the patterns
  (babel)preloaded for \language=0 instead on input line 49.

  )) 
(/gnu/store/1p55mddnasba5xq2vcnzyc8wjywn4cwn-profile/share/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)
 (./test.aux) 
[1{/gnu/store/1p55mddnasba5xq2vcnzyc8wjywn4cwn-profile/share/texmf-dist/fonts/map/pdftex/updmap/pdftex.map}]
 (./test.aux) ) 

  Output written on test.pdf (1 page, 2226 bytes).
  Transcript written on test.log.

With texlive-hyphen-dutch included:

  $ guix shell --pure texlive-base texlive-babel-dutch texlive-hyphen-dutch -- 
pdflatex test.tex
  This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/GNU Guix) 
(preloaded format=pdflatex)
   restricted \write18 enabled.
  entering extended mode
  (./test.tex
  LaTeX2e <2020-10-01> patch level 4
  L3 programming layer <2021-02-18> 
(/gnu/store/c61c43w5c7dlz7ipxcqi4z385p3a4dzb-profile/share/texmf-dist/tex/latex/base/article.cls
  Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
  
(/gnu/store/c61c43w5c7dlz7ipxcqi4z385p3a4dzb-profile/share/texmf-dist/tex/latex/base/size10.clo))
 
(/gnu/store/c61c43w5c7dlz7ipxcqi4z385p3a4dzb-profile/share/texmf-dist/tex/generic/babel/babel.sty
 
(/gnu/store/c61c43w5c7dlz7ipxcqi4z385p3a4dzb-profile/share/texmf-dist/tex/generic/babel/babel.def
 
(/gnu/store/c61c43w5c7dlz7ipxcqi4z385p3a4dzb-profile/share/texmf-dist/tex/generic/config/language.def)
 
(/gnu/store/c61c43w5c7dlz7ipxcqi4z385p3a4dzb-profile/share/texmf-dist/tex/generic/babel/txtbabel.def))
 
(/gnu/store/c61c43w5c7dlz7ipxcqi4z385p3a4dzb-profile/share/texmf-dist/tex/generic/babel-dutch/dutch.ldf

  Package babel Warning: No hyphenation patterns were preloaded for
  (babel)the language `Dutch' into the format.
  (babel)Please, configure your TeX system to add them and
  (babel)rebuild the format. Now I will use the patterns
  (babel)preloaded for \language=0 instead on input line 49.

  )) 
(/gnu/store/c61c43w5c7dlz7ipxcqi4z385p3a4dzb-profile/share/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)
 (./test.aux) 
[1{/gnu/store/c61c43w5c7dlz7ipxcqi4z385p3a4dzb-profile/share/texmf-dist/fonts/map/pdftex/updmap/pdftex.map}]
 (./test.aux) ) 

  Output written on test.pdf (1 page, 2226 bytes).
  Transcript written on test.log.

Problem does not occur when using the complete TeX Live distribution:

  $ guix shell --pure texlive -- pdflatex test.tex
  This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/GNU Guix) 
(preloaded format=pdflatex)
   restricted \write18 enabled.
  entering extended mode
  (./test.tex
  LaTeX2e <2020-10-01> patch level 4
  L3 programming layer <2021-02-18>
  
(/gnu/store/lgkfz7wg59sg81zlf3xy7i7dbvx1fvyp-texlive-texmf-20210325/share/texmf
  -dist/tex/latex/base/article.cls
  Document Class: article 2020/04/10 v1.4m Standard LaTeX document class

  
(/gnu/store/lgkfz7wg59sg81zlf3xy7i7dbvx1fvyp-texlive-texmf-20210325/share/texmf
  -dist/tex/latex/base/size10.clo))
  
(/gnu/store/lgkfz7wg59sg81zlf3xy7i7dbvx1fvyp-texlive-texmf-20210325/share/texmf
  -dist/tex/generic/babel/babel.sty
  
(/gnu/store/lgkfz7wg59sg81zlf3xy7i7dbvx1fvyp-texlive-texmf-20210325/share/texmf
  -dist/tex/generic/babel/babel.def
  
(/gnu/store/lgkfz7wg59sg81zlf3xy7i7dbvx1fvyp-texlive-texmf-20210325/share/texmf
  -dist/tex/generic/babel/txtbabel.def))