frangio / netlify-latex

🗞️ A Netlify template for LaTeX projects.
https://latex.netlify.app
MIT License
21 stars 6 forks source link

repository keys expired #4

Closed paultopia closed 4 years ago

paultopia commented 4 years ago

Hi there,

I had integrated this script into my netlify build process until just recently, when, all of a sudden, the build process started failing with:

12:36:50 PM: [build.sh] Installing TeX Live...
12:36:51 PM: Automated TeX Live installation using profile: /dev/fd/63
12:36:53 PM: Loading http://mirrors.ibiblio.org/pub/mirrors/CTAN/systems/texlive/tlnet/tlpkg/texlive.tlpdb
12:36:54 PM: install-tl-20191006/install-tl: unexpected return value from verify_checksum: -5

After doing some investigation, this seems to be happening because the keys for either tlcontrib or the main texlive repository, or both, have expired. See this SO and also this one.

but the fixes and workarounds for these all seem to rely on tlmgr being used, whereas this seems to be happening inside the install-tl script --- I think before tlmgr gets installed? So I'm guessing that install-tl needs to be updated.

paultopia commented 4 years ago

Update: after replacing the existing install-tl-unx.tar.gz with the one downloaded from here, the build process still fails with:

1:31:23 PM: [build.sh] Installing TeX Live...
1:31:25 PM: Profile  not readable or not a file, continuing in interactive mode.
1:31:26 PM: Loading http://mirror.las.iastate.edu/tex-archive/systems/texlive/tlnet/tlpkg/texlive.tlpdb
1:31:29 PM: Installing TeX Live 2020 from: http://mirror.las.iastate.edu/tex-archive/systems/texlive/tlnet (verified)
1:31:29 PM: Platform: x86_64-linux => 'GNU/Linux on x86_64'
1:31:29 PM: Distribution: net  (downloading)
1:31:29 PM: Using URL: http://mirror.las.iastate.edu/tex-archive/systems/texlive/tlnet
1:31:29 PM: Directory for temporary files: /tmp/TSAa6IyNsI
1:31:29 PM: TERM environment variable not set.
1:31:29 PM: ======================> TeX Live installation procedure <=====================
1:31:29 PM: ======>   Letters/digits in <angle brackets> indicate   <=======
1:31:29 PM: ======>   menu items for actions or customizations      <=======
1:31:29 PM:  Detected platform: GNU/Linux on x86_64
1:31:29 PM:  <B> set binary platforms: 1 out of 16
1:31:29 PM:  <S> set installation scheme: scheme-full
1:31:29 PM:  <C> set installation collections:
1:31:29 PM:      40 collections out of 41, disk space required: 6979 MB
1:31:29 PM:  <D> set directories:
1:31:29 PM:    TEXDIR (the main TeX directory):
1:31:29 PM:      !! default location: /usr/local/texlive/2020
1:31:29 PM:      !! is not writable or not allowed, please select a different one!
1:31:29 PM:    TEXMFLOCAL (directory for site-wide local files):
1:31:29 PM:      /usr/local/texlive/texmf-local
1:31:29 PM:    TEXMFSYSVAR (directory for variable and automatically generated data):
1:31:29 PM:      /usr/local/texlive/2020/texmf-var
1:31:29 PM:    TEXMFSYSCONFIG (directory for local config):
1:31:29 PM:      /usr/local/texlive/2020/texmf-config
1:31:29 PM:    TEXMFVAR (personal directory for variable and automatically generated data):
1:31:29 PM:      ~/.texlive2020/texmf-var
1:31:29 PM:    TEXMFCONFIG (personal directory for local config):
1:31:29 PM:      ~/.texlive2020/texmf-config
1:31:29 PM:    TEXMFHOME (directory for user-specific files):
1:31:29 PM:      ~/texmf
1:31:29 PM:  <O> options:
1:31:29 PM:    [ ] use letter size instead of A4 by default
1:31:29 PM:    [X] allow execution of restricted list of programs via \write18
1:31:29 PM:    [X] create all format files
1:31:29 PM:    [X] install macro/font doc tree
1:31:29 PM:    [X] install macro/font source tree
1:31:29 PM:    [ ] create symlinks to standard directories
1:31:29 PM:  <V> set up for portable installation
1:31:29 PM: Actions:
1:31:29 PM:  <I> start installation to hard disk
1:31:29 PM:  <P> save installation profile to 'texlive.profile' and exit
1:31:29 PM:  <H> help
1:31:29 PM:  <Q> quit
1:31:29 PM: Enter command:
1:31:29 PM: [build.sh] Installed TeX Live.
1:31:29 PM: build.sh: line 75: tlmgr: command not found

The same error occurs if I go through the build.sh file and replace every reference to 2019 with 2020. And it also occurs if I clear the netlify cache and re-deploy.

paultopia commented 4 years ago

Ok, second update! I think I have a fix. I guess the 2020 installer doesn't want the contents of the installation profile passed to it as a string? Before calling the installer script, I stuck in a

echo "$TEXLIVE_PROFILE" > texlive.profile

and then changed the line in build.sh that calls it to

"$INSTALL_TL_VERSION"/install-tl --profile=texlive.profile

and that seems to have gotten it going.

So, in summary, steps to fix:

  1. swap out the old installer for the new one.

  2. change every reference in build.sh from 2019 to 2020.

  3. change the texlive profile from a string passed to the installer via echo to a file.

  4. Just to be on the safe side, stick a --verify-repo=none into every call to tlmgr (as suggested by one of the linked SOs from the first comment in this issue)

and things are working again.

frangio commented 4 years ago

Thanks for looking into this! Can you submit a PR?

Regarding --verify-repo=none, I haven't thought about the implications of this but it may not be a good idea.

paultopia commented 4 years ago

Sure thing, I'll put together a PR in a bit, and also figure out whether it works without --verify-repo=none