Subject: Re: bug#64827: texlive is broken

From: Andreas Enge <[email-masked]>
Date: Wed, 26 Jul 2023 21:51:49 +0200

Am Wed, Jul 26, 2023 at 08:17:02PM +0200 schrieb Andreas Enge:
> Oh wait...
> Before:
> $ ll $HOME/.guix-profile/share/texmf-dist/ls-R
> -r--r--r-- 5 root root 4812162  1. Jan 1970  /home/andreas/.guix-profile/share/texmf-dist/ls-R
> After:
> lrwxrwxrwx 1 root root 82  1. Jan 1970  /home/andreas/.guix-profile/share/texmf-dist/ls-R -> /gnu/store/88apcyl30irw6v03gmyav638wq31k9xq-texlive-20230313/share/texmf-dist/ls-R
> 
> Notice the difference in size. The latter gives only the names of the
> subdirectories, the former all files.

No, I was wrong here. 82 is the size of the symlink, the file itself does
contain all the file names.

But there is also this now as part of the texlive package:
+    (propagated-inputs (list texlive-libkpathsea))

texlive-libkpathsea contains
   /gnu/store/h8vmxcbvk8n25y6zjj17qsq0fncansxs-texlive-libkpathsea-20230313/share/texmf-dist/web2c/texmf.cnf
texlive (as a symlink to texlive-texmf) contains
   /gnu/store/88apcyl30irw6v03gmyav638wq31k9xq-texlive-20230313/share/texmf-dist/web2c/texmf.cnf
They are not the same:
$ diff /gnu/store/h8vmxcbvk8n25y6zjj17qsq0fncansxs-texlive-libkpathsea-20230313/share/texmf-dist/web2c/texmf.cnf /gnu/store/88apcyl30irw6v03gmyav638wq31k9xq-texlive-20230313/share/texmf-dist/web2c/texmf.cnf
62c62
< TEXMFROOT = {$GUIX_TEXMF}/..
---
> TEXMFROOT = $SELFAUTOPARENT
111c111
< TEXMF = {$GUIX_TEXMF}
---
> TEXMF = {$TEXMFAUXTREES$TEXMFCONFIG,$TEXMFVAR,$TEXMFHOME,!!$TEXMFLOCAL,!!$TEXMFSYSCONFIG,!!$TEXMFSYSVAR,!!$TEXMFDIST}
575c575
< /gnu/store/h8vmxcbvk8n25y6zjj17qsq0fncansxs-texlive-libkpathsea-20230313/share/texmf-dist/web2c,\
---
> $SELFAUTOLOC/share/texmf-dist/web2c,\
872,874c872,874
< error_line = 254
< half_error_line = 238
< max_print_line = 1000
---
> error_line = 79
> half_error_line = 50
> max_print_line = 79

I think with the propagation of texlive-libkpathsea, there is a conflict
in the profile, which appears to be resolved in favour of texlive;
however, this probably explains why texmf-dist in the profile is no more
just a symlink. In principle it could contain files from two distinct
packages, those just happen to be in conflict.

By the way, the following also fails:
   $ guix shell --container --pure -D texlive
The following derivation will be built:
  /gnu/store/rdrqavbga5rg9l20vpr1ac79psdndj4d-profile.drv
building TeX Live font maps...
/builder for `/gnu/store/bnyjd9vgyqniarynlvcia5vnm36pik9i-texlive-font-maps.drv' failed with exit code 1
build of /gnu/store/bnyjd9vgyqniarynlvcia5vnm36pik9i-texlive-font-maps.drv failed
View build log at '/var/log/guix/drvs/bn/yjd9vgyqniarynlvcia5vnm36pik9i-texlive-font-maps.drv.gz'.
cannot build derivation `/gnu/store/rdrqavbga5rg9l20vpr1ac79psdndj4d-profile.drv': 1 dependencies couldn't be built
guix shell: error: build of `/gnu/store/rdrqavbga5rg9l20vpr1ac79psdndj4d-profile.drv' failed

The log file contains lots of messages of the form:
warning: collision encountered:
  /gnu/store/yzsq1dykjv96h88pcja0hcjbagn2vjxv-texlive-bin-full-20230313/share/texmf-dist/scripts/l3build/l3build.lua
  /gnu/store/s6w8r5q3aql1bhasv0nmwr5xgjv6qnhh-texlive-texmf-20230313/share/texmf-dist/scripts/l3build/l3build.lua
warning: choosing /gnu/store/yzsq1dykjv96h88pcja0hcjbagn2vjxv-texlive-bin-full-20230313/share/texmf-dist/scripts/l3build/l3build.lua

So here the conflicts are made directly visible.

With the propagation of texlive-libkpathsea, texlive is clearly not just
the composition of (the former) texlive-bin and texlive-texmf any more,
where nothing was propagated as far as I can remember. Also, ls-R is now
created as part of texlive instead of texlive-texmf, which may make a
difference. And texmf-var has disappeared, and I have not yet understood
where it has gone. These are a lot of subtle changes, and they do break
the monolithic texlive.

What could be a way forward to restore the texlive package?

Would it be feasible to revert these commits, or is everything too
mixed now?

If the merge cannot be reverted, how about creating the two packages
(texlive-bin and texlive-texmf) required for the monolithic
texlive completely separately as before and reinstating texlive to be
built from scratch without links with the modular texlive? 

Andreas