jperon / lyluatex

Alternative à lilypond-book pour lualatex
MIT License
56 stars 11 forks source link

Can't compile on MacOS - bad argument #1 to 'rawget' #316

Open thelaumix opened 11 months ago

thelaumix commented 11 months ago

Hey,

I'm trying to include lylualatex into Texifier on MacOS (Lilypond v2.24.2 / homebrew), but despite my efforts, any attempt to compile even the most basic scores results in an error being thrown by LuaLaTeX.

(lyluatex)  Compiling score tmp-ly/8de58477103c654174a63450fab5a00f with LilyPond executable '/opt/homebrew/bin/lilypond'.
...23/texmf-dist/tex/lualatex/luaoptions/luaoptions-lib.lua:236: bad argument #1 to 'rawget' (table expected, got nil)
stack traceback:
    [C]: in function 'rawget'
    ...23/texmf-dist/tex/lualatex/luaoptions/luaoptions-lib.lua:236: in metamethod '__index'
    ...al/texlive/2023/texmf-dist/scripts/lyluatex/lyluatex.lua:802: in method 'lilypond_cmd'
    ...al/texlive/2023/texmf-dist/scripts/lyluatex/lyluatex.lua:1146: in method 'run_lilypond'
    ...al/texlive/2023/texmf-dist/scripts/lyluatex/lyluatex.lua:1110: in method 'process'
    [\directlua]:1: in main chunk.
\ly@compilescore ...directlua {ly.score:process()}

l.16 \end{lilypond}

I did already find some issues referring to a similar log output, but so far none of the solutions provided there have been able to resolve the problem. Does anyone know what might be causing this to happen?

Best regards

profejuanca commented 1 month ago

Same error in manjaro (in 3 different computers), using Gummy or another editor, but if I use a document without save them and autocompile option fron ram, this works perfectly, but is useless without saving option.

MacLotsen commented 1 day ago

Same for Ubuntu 22.04 with GNU LilyPond 2.24.3 and TeX Live (latest, not apt). MWE: lualatex lualatex --shell-escape myfile

\documentclass[11pt]{scrbook}
\usepackage{lyluatex}
\begin{document}
    \begin{lilypond}[quote,fragment,staffsize=26]
      c'4 d' e' f' g'2 g'
    \end{lilypond}
\end{document}

However, it does the same for any lilypond macro.

MacLotsen commented 1 day ago

It crashes on lyluatex.lua:802 while getting dist from lib.tex_engine. Somehow the metatable isn't simply returning nil. The check for MikTeX has to be re-implemented I suppose.