Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

texlive: 2016 -> 2017 #30332

Merged
merged 3 commits into from Dec 13, 2017
Merged

texlive: 2016 -> 2017 #30332

merged 3 commits into from Dec 13, 2017

Conversation

veprbl
Copy link
Member

@veprbl veprbl commented Oct 11, 2017

Motivation for this change

Fix #27086

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Not much testing was done on this. scheme-small is not working, but scheme-full should work.

cc @vcunat

TODO

  • Fix crash during evaluation of scheme-full on Linux with nix 1.11.x
  • Find way to freeze packages or mirror like was done before

EXTRA

@vcunat
Copy link
Member

vcunat commented Oct 11, 2017

At some point we need to create a snapshot and serve it somehow. (It seems likely that either our texlive infrastructure or tarballs.nixos.org would need a change to work together well.)

Upstream updates continuously, and we don't want that. http://ctan.math.utah.edu/ctan/tex-archive/systems/texlive/tlnet/archive contains files just two days old.

@vcunat
Copy link
Member

vcunat commented Oct 11, 2017

I almost don't use TeX (anymore). We'd better have diverse test cases from our users, ideally before merging.

@veprbl
Copy link
Member Author

veprbl commented Oct 11, 2017

The hashes might break soon, yes, but this is more like proof of concept for now.

@veprbl veprbl closed this Oct 11, 2017
@veprbl veprbl reopened this Oct 11, 2017
@ciil
Copy link
Member

ciil commented Oct 12, 2017

I wanted to test this and checked out the pull request, but I can't get scheme-full to evaluate. Breaks with error: stack overflow (possible infinite recursion).

@veprbl
Copy link
Member Author

veprbl commented Oct 12, 2017

@ciil
I can't reproduce your problem. How do you evaluate? What version of nix?
Can you also try

nix-shell -p "texlive.combine { inherit (texlive) scheme-full; }"

@ciil
Copy link
Member

ciil commented Oct 12, 2017

Trying to install in a nix-shell:

ciil@eridani:~/vcs/nixpkgs % nix-shell --version
nix-shell (Nix) 1.11.15
ciil@eridani:~/vcs/nixpkgs % nixos-version
18.03.git.c9b5c3b (Impala)
ciil@eridani:~/vcs/nixpkgs % nix-shell -p "texlive.combine { inherit (texlive) scheme-full; }"
error: stack overflow (possible infinite recursion)
ciil@eridani:~/vcs/nixpkgs % nix-shell -p texlive.combined.scheme-full
error: stack overflow (possible infinite recursion)

With texlive.combined.scheme-full in environment.systemPackages in my configuration.nix:

ciil@eridani:~/vcs/nixpkgs % sudo nixos-rebuild switch
[sudo] password for ciil: 
building Nix...
building the system configuration...
error: stack overflow (possible infinite recursion)

Without the texlive package my system evaluates. Some more information:

ciil@eridani:~/vcs/nixpkgs % git log  --pretty=oneline | head -n 4
f9c41823dfcee731cf507c1cf249c0f79667fa91 (HEAD -> texlive2017) texlive: 2016 -> 2017
05ab1e0e48896063810cf6658847a9e6a5a4c454 Merge pull request #30065 from 4z3/brscan4
8bc5f04c06044ba6e7a328d5ee654c6fade41293 brscan4: 0.4.4-2 -> 0.4.4-4
b465d9c1fff4e92d6790e10dafc6a578c44ac98e Merge pull request #29460 from sifmelcara/add/rime
ciil@eridani:~/vcs/nixpkgs % nix-shell -p texlive.combined.scheme-full --verbose
evaluating file ‘/nix/store/jvx8pvvh4ycn7n5zispwwsqg1184cf3k-nix-1.11.15/share/nix/corepkgs/derivation.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/default.nix’
|   evaluating file ‘/home/ciil/vcs/nixpkgs/lib/minver.nix’
|   evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/top-level/impure.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/top-level/default.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/stdenv/booter.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/lib/default.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/lib/lists.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/stdenv/default.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/lib/trivial.nix’
evaluating file ‘/home/ciil/.config/nixpkgs/config.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/lib/systems/default.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/lib/attrsets.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/lib/systems/inspect.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/stdenv/linux/default.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/top-level/stage.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/lib/fixed-points.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/stdenv/adapters.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/build-support/trivial-builders.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/top-level/splice.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/top-level/all-packages.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/top-level/aliases.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/stdenv/generic/default.nix’
|   evaluating file ‘/home/ciil/vcs/nixpkgs/lib/customisation.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/lib/systems/parse.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/lib/types.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/lib/strings.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/tools/text/gawk/default.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/servers/x11/xorg/default.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/stdenv/generic/make-derivation.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/stdenv/generic/check-meta.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/lib/systems/platforms.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/tools/typesetting/tex/texlive/default.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/tools/typesetting/tex/texlive/pkgs.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/lib/meta.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/tools/typesetting/tex/texlive/combine.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/build-support/buildenv/default.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/tools/typesetting/tex/texlive/bin.nix’
evaluating file ‘/home/ciil/vcs/nixpkgs/pkgs/tools/typesetting/tex/texlive/fixedHashes.nix’
error: stack overflow (possible infinite recursion)

My /home/ciil/.config/nixpkgs/config.nix allows broken and unfree packages, nothing else.

@veprbl
Copy link
Member Author

veprbl commented Oct 12, 2017

@ciil Got it. Thank you!

@veprbl
Copy link
Member Author

veprbl commented Oct 12, 2017

It evaluates on macOS version of nix, but not on Linux, it seems.

edit: It also evaluates with nixUnstable on Linux.

@veprbl
Copy link
Member Author

veprbl commented Oct 12, 2017

scheme-small and scheme-medium now working. They also should be small enough to evaluate on Linux

@veprbl veprbl force-pushed the texlive2017 branch 4 times, most recently from 7078d9a to 762d908 Compare October 19, 2017 04:31
@veprbl veprbl force-pushed the texlive2017 branch 4 times, most recently from b0f4198 to 016dd54 Compare October 24, 2017 05:41
fmtutil has started to report number of failed formats in its return code. One
could regenerate the share/texmf/web2c/fmtutil.cnf to only include available
.ini files, but simpler solution is to ignore the return code.
@ciil
Copy link
Member

ciil commented Oct 25, 2017

Yeah, I can verify the build of scheme-full on NixOS with nix 1.12. And as long as it builds, everything seems to be in working order so far (at least all of my personal .tex scripts compile [mostly xelatex and pdflatex, some lualatex], but I've not tested more than that; also, I won't come around to try any more than that for at least the next three weeks).

As for serving the tex packages: @fpletz, could you possibly mirror a snapshot on nixos.community?

@veprbl
Copy link
Member Author

veprbl commented Oct 25, 2017

IPFS? Who said IPFS? Let the bikeshedding commence!

Meanwhile, if you are a bitswapper, please consider pinning QmRLK45EC828vGXv5YDaBsJBj2LjMjjA2ReLVrXsasRzy7.

The problem was in builtins.partition call. I've tried to rewrite it with
builtins.foldl', but that doesn't help. However replacing it with a pair of
builtins.filter calls works.

diff --git a/lib/lists.nix b/lib/lists.nix
--- a/lib/lists.nix
+++ b/lib/lists.nix
@@ -242,10 +242,10 @@ rec {
        => { right = [ 5 3 4 ]; wrong = [ 1 2 ]; }
   */
   partition = builtins.partition or (pred:
-    foldr (h: t:
+    builtins.foldl' (t: h:
       if pred h
-      then { right = [h] ++ t.right; wrong = t.wrong; }
-      else { right = t.right; wrong = [h] ++ t.wrong; }
+      then { right = t.right ++ [h]; wrong = t.wrong; }
+      else { right = t.right; wrong = t.wrong ++ [h]; }
     ) { right = []; wrong = []; });

   /* Merges two lists of the same size together. If the sizes aren't the same
@gebner
Copy link
Member

gebner commented Dec 7, 2017

Is there anything left to do before we can merge this PR?

I built it after rebasing it on top of the current master, and all my tex files work (I mainly use scheme-full, and pdflatex/xelatex).

@veprbl
Copy link
Member Author

veprbl commented Dec 9, 2017

gebner
I'm not aware of any problem with using this PR.

@vcunat, do you see what remains to be done to have this merged?

@gebner
Copy link
Member

gebner commented Dec 13, 2017

Merging since multiple people have successfully tested this PR, all known issues are fixed, and no further issues were raised in the last week.

@gebner gebner merged commit 8df38f6 into NixOS:master Dec 13, 2017
@vcunat
Copy link
Member

vcunat commented Dec 14, 2017

See #32661. I've been relatively out of time lately, not spending any on this PR.

@dtzWill
Copy link
Member

dtzWill commented Dec 14, 2017

(those following this PR, please take a look at my comment on the issue @vcunat linked above: #32661 (comment) )

@vcunat
Copy link
Member

vcunat commented Dec 15, 2017

Does someone have all the tarballs? I tried to add the IPFS pin and pre-fill with the current versions served upstream, but IPFS seems stuck, so it's likely that some of the texlive packages are currently not downloadable (via nixpkgs). If you have it in IPFS, it should be enough to start the daemon and mine should automatically re-mirror it AFAIK.

@vcunat
Copy link
Member

vcunat commented Dec 15, 2017

Well, the most common packages are there, on cache.nixos.org also by now, but some packages are unobtainable ATM, which is a bit awkward. /cc @veprbl

@gebner
Copy link
Member

gebner commented Dec 15, 2017

@vcunat I can build texlive.combined.scheme-full just fine. What packages are you missing?

@veprbl
Copy link
Member Author

veprbl commented Dec 15, 2017

@vcunat
ipfs get QmRLK45EC828vGXv5YDaBsJBj2LjMjjA2ReLVrXsasRzy7 works just fine for me right now. If you have trouble using IPFS, there is a mirror http://146.185.144.154/texlive-2017

@vcunat
Copy link
Member

vcunat commented Dec 15, 2017

Example: https://gateway.ipfs.io/ipfs/QmRLK45EC828vGXv5YDaBsJBj2LjMjjA2ReLVrXsasRzy7/texlive-2017/xmltex.tar.xz (the same if I try using IPFS directly). I could get scheme-medium at least...

vcunat added a commit that referenced this pull request Dec 15, 2017
/cc #30332.  Thanks to @vprbl for the http mirror.
@veprbl
Copy link
Member Author

veprbl commented Dec 15, 2017

Now I can confirm what @vcunat sees. The gateways are stuck, ipfs get is stuck for me now too.

I had two pins made. One on https://www.eternum.io and one on another less reliable host. I wasn't able to download xmltex.tar.xz (aka QmSaR1gEWG2QUWwZSeWdbtadS8WXP6S3sGYbPLczLVRGK4) even from eternum.io's own ipfs gateway [1]. I can easily download, say, xmltex.doc.tar.xz though. The problem went away after I started another node that had this pinned...

[1] https://www.eternum.io/ipfs/QmRLK45EC828vGXv5YDaBsJBj2LjMjjA2ReLVrXsasRzy7/texlive-2017/xmltex.tar.xz

@vcunat
Copy link
Member

vcunat commented Dec 15, 2017

OK, managed to pin it now, but my overall experience with IPFS is rather disappointing, in regard to stability and performance (and https://github.com/NixIPFS confirms that). I hope you don't mind that I put your mirror first and gateway.ipfs.io as fallback.

@veprbl
Copy link
Member Author

veprbl commented Dec 15, 2017

@vcunat
I must say that this is the first time I had a problem with this PR's download. At the same time it is clear to me that the technology is a bit hard to troubleshoot and this might be a show stopper.

There is no problem with using my mirror, but this undermines our ability to easily bump texlive packages which should have been possible with IPFS.

@vcunat
Copy link
Member

vcunat commented Dec 15, 2017

Ah, right, fast updates are undermined by that, due to the paths not changing names. I didn't know you intended to update more often than yearly.

@veprbl
Copy link
Member Author

veprbl commented Dec 17, 2017

I didn't have plans for any updates, but I remember seeing issues created about that. Even with yearly bumps, a contributor will need to publish the updated tarballs, so they would have to either negotiate with the existing mirror or set up their own mirror. With IPFS, any nixpkgs contributor can prepare a bump entirely on their own without making a commitment to hosting it.

I also got a response from guys at Eternum, they say that the file didn't get pinned on their end. From what I understood, the issue is with IPFS API that doesn't allow to get the status of the pin. If there is any flaky IPFS interaction (original node inaccessible), the pinning will fail and there will be no automatic retry. I guess, their service is not perfect because of that.

@vcunat
Copy link
Member

vcunat commented Dec 17, 2017

As discussed, we put all sources on tarballs.nixos.org periodically, but that way currently interacts badly with the way fixed-output derivations are done in TeX Live, apparently, and I can't immediately see a simple way around that without losing some guarantees.

Maybe it would be best to just let Hydra build scheme-full, getting outputs into the binary cache. Disadvantage: it wouldn't help those with non-standard nix store location (unless prooted), as even fixed-output builds do change hashes based on that, unfortunately.

@bhipple
Copy link
Contributor

bhipple commented Dec 22, 2017

It looks like this pull request broke the stable branch of nix.

$ git clone https://github.com/nixos/nix --branch 1.11-maintenance && cd nix
# Checkout the nixpkgs commit before this PR was merged
$ cd ~/src/nixpkgs && git checkout 2d3700edee4f1e0835ad4eb983b9fd8b44420044 && cd -
$ nix-build -I nixpkgs=$HOME/src/nixpkgs release.nix -A tarball
<success>

# Checkout nixpkgs with this commit merged, then
$ nix-build -I nixpkgs=$HOME/src/nixpkgs release.nix -A tarball
Build stdin.pdf
pdflatex failed
/nix/store/mxn366y3qhg17j10wvsblaz2pix113v9-dblatex-0.3.7/share/dblatex/latex/style/dbk_table.sty:32: Use of \@xmultirow doesn't match its definition.
/nix/store/mxn366y3qhg17j10wvsblaz2pix113v9-dblatex-0.3.7/share/dblatex/latex/style/dbk_table.sty:32: leading text: \expandafter{\@xmultirow{
/nix/store/mxn366y3qhg17j10wvsblaz2pix113v9-dblatex-0.3.7/share/dblatex/latex/style/dbk_table.sty:32: Missing \begin{document}.
/nix/store/mxn366y3qhg17j10wvsblaz2pix113v9-dblatex-0.3.7/share/dblatex/latex/style/dbk_table.sty:32: leading text: \expandafter{\@xmultirow{#1}[
/nix/store/mxn366y3qhg17j10wvsblaz2pix113v9-dblatex-0.3.7/share/dblatex/latex/style/dbk_table.sty:32: You can't use `macro parameter character #' in horizonta.
/nix/store/mxn366y3qhg17j10wvsblaz2pix113v9-dblatex-0.3.7/share/dblatex/latex/style/dbk_table.sty:32: leading text: \expandafter{\@xmultirow{#1}[#
/nix/store/mxn366y3qhg17j10wvsblaz2pix113v9-dblatex-0.3.7/share/dblatex/latex/style/dbk_table.sty:32: You can't use `macro parameter character #' in horizonta.
/nix/store/mxn366y3qhg17j10wvsblaz2pix113v9-dblatex-0.3.7/share/dblatex/latex/style/dbk_table.sty:32: leading text: \expandafter{\@xmultirow{#1}[#2]{#
/nix/store/mxn366y3qhg17j10wvsblaz2pix113v9-dblatex-0.3.7/share/dblatex/latex/style/dbk_table.sty:32: You can't use `macro parameter character #' in horizonta.
/nix/store/mxn366y3qhg17j10wvsblaz2pix113v9-dblatex-0.3.7/share/dblatex/latex/style/dbk_table.sty:32: leading text: \expandafter{\@xmultirow{#1}[#2]{#3}[#
/nix/store/mxn366y3qhg17j10wvsblaz2pix113v9-dblatex-0.3.7/share/dblatex/latex/style/dbk_table.sty:32: You can't use `macro parameter character #' in horizonta.
/nix/store/mxn366y3qhg17j10wvsblaz2pix113v9-dblatex-0.3.7/share/dblatex/latex/style/dbk_table.sty:32: leading text: \expandafter{\@xmultirow{#1}[#2]{#3}[#4]{#
/nix/store/mxn366y3qhg17j10wvsblaz2pix113v9-dblatex-0.3.7/share/dblatex/latex/style/dbk_table.sty:32: Too many }'s.
/nix/store/mxn366y3qhg17j10wvsblaz2pix113v9-dblatex-0.3.7/share/dblatex/latex/style/dbk_table.sty:32: leading text: \expandafter{\@xmultirow{#1}[#2]{#3}[#4]{#}
Unexpected error occured
Error: pdflatex compilation failed
Missing character &#x251c;
Missing character &#x2500;
Missing character &#x2500;
Missing character &#x2502;
Missing character &#x251c;
Missing character &#x2500;
Missing character &#x2500;
Missing character &#x2502;
Missing character &#x2502;
Missing character &#x2502;
Missing character &#x2502;
Missing character &#x2502;
Missing character &#x2502;
make: *** [doc/manual/local.mk:83: doc/manual/manual.pdf] Error 1
build time elapsed:  0m0.209s 0m0.081s 1m13.234s 0m1.561s
builder for '/nix/store/9mlmbz7l16agz5ydkkviygwyy9mzg3mn-nix-tarball-1.11.17pre1234_abcdef.drv' failed with exit code 2

It looks like the master branch's docs still build, though. Anyone seen this error before or know enough about latex to have a hunch how to patch a fix for it in the stable nix manual?

@dtzWill
Copy link
Member

dtzWill commented Dec 22, 2017

@bhipple

Looks like maybe we should patch dblatex? Or update?

EDIT: This is already done, see below! 👍

@veprbl
Copy link
Member Author

veprbl commented Dec 22, 2017

#32989

@bhipple
Copy link
Contributor

bhipple commented Dec 22, 2017

Well that explains why it doesn't fail in master :D

For some reason it didn't occur to me that dblatex itself was broken; I just assumed the very old stable manual needed some formatting updates for the 2017 version. Thanks for the patch @veprbl!

FRidh referenced this pull request Jan 1, 2018
@ghost ghost mentioned this pull request Feb 1, 2018
@veprbl veprbl deleted the texlive2017 branch December 1, 2020 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants