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

sh: xindy: not found #32

Closed
jy95 opened this issue May 9, 2020 · 15 comments
Closed

sh: xindy: not found #32

jy95 opened this issue May 9, 2020 · 15 comments
Labels
upstream Upstream Issue

Comments

@jy95
Copy link

jy95 commented May 9, 2020

Hello,

Thanks for your good Github Actions : I have a problem when using xindy with glossaries (I need that to sort my glossary entries with accents) with your action ( I have no problem with that in local with MiKTeX)

image

For my .latexmkrc, I use the glossary_latexmkrc from https://www.ctan.org/tex-archive/support/latexmk/example_rcfiles.

\usepackage[
  toc,
  nonumberlist,
  nogroupskip,
  nopostdot,
  xindy
]{glossaries}
\usepackage{glossary-longbooktabs}
\makeglossaries

I checked and in Tex Live, xindy is installed but it seems makeglossaries use perl (which one cannot find it)

Any ideas ?

@xu-cheng
Copy link
Owner

xu-cheng commented May 9, 2020

This seems to be an issue of TeXLive that it does not offer xindy binaries for Linux musl environment. The package xindy.x86_64-linuxmusl is missing.

Could you try the following workaround?

- uses: xu-cheng/latex-action@v2
  with:
    pre_compile: | 
      ln -sf /opt/texlive/texdir/texmf-dist/scripts/xindy/xindy.pl /opt/texlive/texdir/bin/x86_64-linuxmusl/xindy
      ln -sf /opt/texlive/texdir/texmf-dist/scripts/xindy/texindy.pl /opt/texlive/texdir/bin/x86_64-linuxmusl/texindy
    root_file: main.tex

@xu-cheng xu-cheng added the upstream Upstream Issue label May 9, 2020
@jy95
Copy link
Author

jy95 commented May 9, 2020

Tested just now :
image

@xu-cheng
Copy link
Owner

xu-cheng commented May 9, 2020

How about:

- uses: xu-cheng/latex-action@v2
  with:
    pre_compile: | 
      ln -sf /opt/texlive/texdir/texmf-dist/scripts/xindy/xindy.pl /opt/texlive/texdir/bin/x86_64-linuxmusl/xindy
      ln -sf /opt/texlive/texdir/texmf-dist/scripts/xindy/texindy.pl /opt/texlive/texdir/bin/x86_64-linuxmusl/texindy
      wget https://sourceforge.net/projects/xindy/files/xindy-source-components/2.4/xindy-kernel-3.0.tar.gz
      tar xf xindy-kernel-3.0.tar.gz
      cd xindy-kernel-3.0/src
      apk add make
      apk add clisp --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community
      make
      cp -f xindy.mem /opt/texlive/texdir/bin/x86_64-linuxmusl/
      cd ../../
    root_file: main.tex

@xu-cheng
Copy link
Owner

xu-cheng commented May 9, 2020

The root issue is that xindy.x86_64-linuxmusl is missing. So you may want to submit to an issue to TeXLive.

@jy95
Copy link
Author

jy95 commented May 9, 2020

@xu-cheng It seems we forgot to cd to the working directory so cannot test yet.
(maybe create a temporary release tag for that)

image

Feel free to submit an issue to TeXLive : It is the middle of the night in my timezone (and the Morpheus' arms are close) ^^
Honestly, I found strange this xindy.x86_64-linuxmusl is missing (even no alpine package whereas there is one in ubuntu ...)

@xu-cheng
Copy link
Owner

xu-cheng commented May 9, 2020

You can just cd it back in the end of precompile script.

I don’t use xindy by myself. So I will close this issue for now.

@xu-cheng xu-cheng closed this as completed May 9, 2020
@jy95
Copy link
Author

jy95 commented May 9, 2020

I think it may be useful to at least mention this weird behaviour some where (as glossaries package is often mentionned with xindy )
Do you mind sending a report to TeXLive (or suggest them to create an package on Alpine (tutorial) ) ?

Thanks for the help anyway.

@xu-cheng
Copy link
Owner

xu-cheng commented May 9, 2020

I now added a mention to this in the README.

I will not report an issue to TeXLive or Alpine, but you are free to do so.

@jy95
Copy link
Author

jy95 commented May 9, 2020

@xu-cheng I send them an issue : let's see how it goes.
I would like to suggest you a cleaner solution :

workflow.yml:

    steps:
      - name: Set up Git repository
        uses: actions/checkout@v2
      # For weird reasons, xindy binaries are not available in Tex Live (xindy.x86_64-linuxmusl) 
      # Github Actions set-output/set-env truncates Multiline Strings so ...
      # https://github.com/xu-cheng/latex-action/issues/32#issuecomment-626086551
      # https://github.community/t5/GitHub-Actions/set-output-Truncates-Multiline-Strings/td-p/37870
      - name: Workaround script for xindy
        run: |
          content="$(tail -n +3 .github/workflows/texlive_workaround.sh)"
          content="${content//'%'/'%25'}"
          content="${content//$'\n'/'%0A'}"
          content="${content//$'\r'/'%0D'}"
          echo "::set-env name=TEXLIVE_WORKAROUND::$content"
      - name: Compile LaTeX document
        uses: xu-cheng/latex-action@v2
        with:
          pre_compile: | 
            ${{ env.TEXLIVE_WORKAROUND }}
          root_file: main.tex

texlive_workaround.sh :

#!/bin/sh
set -e

ln -sf /opt/texlive/texdir/texmf-dist/scripts/xindy/xindy.pl /opt/texlive/texdir/bin/x86_64-linuxmusl/xindy
ln -sf /opt/texlive/texdir/texmf-dist/scripts/xindy/texindy.pl /opt/texlive/texdir/bin/x86_64-linuxmusl/texindy
wget https://sourceforge.net/projects/xindy/files/xindy-source-components/2.4/xindy-kernel-3.0.tar.gz
tar xf xindy-kernel-3.0.tar.gz
cd xindy-kernel-3.0/src
apk add make
apk add clisp --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community
make
cp -f xindy.mem /opt/texlive/texdir/bin/x86_64-linuxmusl/
cd ../..

@goerz
Copy link

goerz commented Dec 27, 2020

The workaround results in the following error for me:

...
Executing busybox-1.31.1-r19.trigger
OK: 406 MiB in 160 packages
fetch http://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
  clisp (missing):
    required by: world[clisp]

@jy95
Copy link
Author

jy95 commented Dec 27, 2020

@goerz Here was the answer I received from TeXLive team. Maybe it will help you ...

@goerz
Copy link

goerz commented Dec 27, 2020

Thanks! I'm not really sure what to do with that, though. I worked around the problem by avoiding latexmk, and calling lualatex directly (twice). I'm actually not even sure why latexmk was trying to invoke xindy. My document doesn't have an index.

Wouldn't it be easier to switch the Docker image from Alpine Linux to some other Linux distribution that's fully supported by texlive (using the standard GNU stdlib)?

@xu-cheng
Copy link
Owner

xu-cheng commented Dec 28, 2020

@goerz Please try the updated workaround. The issue is caused due to clisp changing its repo in apk.

I worked around the problem by avoiding latexmk, and calling lualatex directly (twice). I'm actually not even sure why latexmk was trying to invoke xindy. My document doesn't have an index.

It should be able to disable xindy in latexmk by creating a .latexmkrc file. Please refer latexmk's doc on how to do it.

Wouldn't it be easier to switch the Docker image from Alpine Linux to some other Linux distribution that's fully supported by texlive (using the standard GNU stdlib)?

The reason Alpine is used is because its smaller size. Unfortunately, we cannot easily change the image without causing breakage to existing workflows.

@cathaysia

This comment has been minimized.

@xu-cheng

This comment has been minimized.

Repository owner locked as resolved and limited conversation to collaborators Mar 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
upstream Upstream Issue
Projects
None yet
Development

No branches or pull requests

4 participants