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

test: install and use latexmk #17

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Conversation

muzimuzhi
Copy link
Owner

for https://github.com/teatimeguest/setup-texlive-action/issues/252

@muzimuzhi
Copy link
Owner Author

On Windows, latexmk -lualatex [-jobname=...] "simple.tex" hangs in both bash and pwsh shells.
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell

@muzimuzhi muzimuzhi force-pushed the self/install-latexmk branch from ef4ca76 to d158c5b Compare May 11, 2023 19:06
@muzimuzhi
Copy link
Owner Author

muzimuzhi commented May 11, 2023

On Windows, latexmk -lualatex [-jobname=...] "simple.tex" hangs in both bash and pwsh shells. https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell

After hanging for ~8 min (link), it succeeded, see https://github.com/muzimuzhi/hello-github-actions/actions/runs/4948656780/jobs/8855447360.

Thu, 11 May 2023 18:03:00 GMT Transcript written on simple-windows-luatex.log.
Thu, 11 May 2023 18:10:52 GMT Latexmk: Getting log file 'simple-windows-luatex.log'

A second run is as fast as expected, see https://github.com/muzimuzhi/hello-github-actions/actions/runs/4951590205/jobs/8856767579. Related to luatex cache? GitHub Actions status?

@muzimuzhi muzimuzhi closed this May 11, 2023
@muzimuzhi muzimuzhi reopened this May 11, 2023
@muzimuzhi muzimuzhi closed this May 11, 2023
@muzimuzhi muzimuzhi deleted the self/install-latexmk branch May 11, 2023 19:28
@muzimuzhi muzimuzhi restored the self/install-latexmk branch May 11, 2023 22:36
@muzimuzhi muzimuzhi reopened this May 11, 2023
@muzimuzhi
Copy link
Owner Author

Let's trigger the workflow again, with setup-texlive-action cache for Win deleted.

@muzimuzhi
Copy link
Owner Author

muzimuzhi commented May 11, 2023

Another pair of run attempts:

Differences:

  • In slow run, latexmk found a rerun is needed because file $(kpsewhich --var-value TEXMFVAR)/luatex-cache/generic/fonts/otl/lmroman10-regular.lua is created or modified.
  • In quick run and all other quick cases in slow run, no rerun happened.
Thu, 11 May 2023 22:41:40 GMT Output written on simple-windows-luatex.pdf (1 page, 2993 bytes).
Thu, 11 May 2023 22:41:40 GMT Transcript written on simple-windows-luatex.log.
Thu, 11 May 2023 22:48:36 GMT Latexmk: Getting log file 'simple-windows-luatex.log'
Thu, 11 May 2023 22:48:36 GMT Latexmk: Examining 'simple-windows-luatex.fls'
Thu, 11 May 2023 22:48:36 GMT Latexmk: ============== Inequiv cwd_fls cwd 'D:/a/hello-github-actions/hello-github-actions/latex-examples' '/d/a/hello-github-actions/hello-github-actions/latex-examples'
Thu, 11 May 2023 22:48:36 GMT Latexmk: Examining 'simple-windows-luatex.log'
Thu, 11 May 2023 22:48:36 GMT Latexmk: Log file says output to 'simple-windows-luatex.pdf'
Thu, 11 May 2023 22:48:36 GMT Latexmk: applying rule 'lualatex'...
Thu, 11 May 2023 22:48:36 GMT Rule 'lualatex':  Reasons for rerun
Thu, 11 May 2023 22:48:36 GMT Changed files or newly in use/created:
Thu, 11 May 2023 22:48:36 GMT   D:/a/_temp/setup-texlive/2023/texmf-var/luatex-cache/generic/fonts/otl/lmroman10-regular.lua

Also from the downloaded artifact, in simple-windows-luatex.fdb_latexmk created by rerun, only **/lmroman10-regular.luc, the compiled **/lmroman10-regular.lua, is listed.

I guess somehow latexmk triggered sth similar to luaotfload --update. Does latexmk support executing user commands just before reruns?


The TeX Live Guide says

3.4.4 "System font configuration for XeTeX and LuaTeX"
https://tug.org/texlive/doc/texlive-en/texlive-en.html#x1-330003.4.4

The luaotfload font name index may need to be rebuilt for new fonts; this is triggered automatically when trying to load a font which isn’t known yet.

@muzimuzhi muzimuzhi force-pushed the self/install-latexmk branch from 680a8d6 to 41d208f Compare May 12, 2023 00:05
@muzimuzhi muzimuzhi force-pushed the self/install-latexmk branch from 41d208f to 26d340d Compare May 12, 2023 00:26
@muzimuzhi
Copy link
Owner Author

muzimuzhi commented May 12, 2023

From https://github.com/muzimuzhi/hello-github-actions/actions/runs/4954707699, it seems that setup-texlive-action didn't generate LuaTeX font cache on Windows only, or the cache was generated in a wrong directory.

Two evidences:

Remaining

  • Next step: test if running luaotfload --update ahead solves the problem, and how long it takes.
    8 min for generating font cache in a rather slim texlive 2023 is incredibly inefficient.
  • Why Windows?
  • Why latexmk?
    Simple lualatex simple.tex runs fast. Caused by -recorder?
  • Any chances that on Windows the font caches were created in another directory?

cc: @teatimeguest

@muzimuzhi
Copy link
Owner Author

Wait a minute. I only deleted GitHub Actions cache for win, so the observation could be totally wrong.

@muzimuzhi
Copy link
Owner Author

I think this paragraph in manpage for luaotfload explains quite something (https://github.com/latex3/luaotfload/blob/main/doc/luaotfload-tool.rst#files, also texdoc luaotfload, Appx. "Manual of luaotfload-tool"):

FILES
The font name database is usually located in the directory texmf-var/luatex-cache/generic/names/ ($TEXMFCACHE as set in texmf.cnf) of your TeX Live distribution as a zlib-compressed file luaotfload-names.lua.gz. The experimental lookup cache will be created as luaotfload-lookup-cache.lua in the same directory. These Lua tables are not used directly by Luaotfload, though. Instead, they are compiled to Lua bytecode which is written to corresponding files with the extension .luc in the same directory. When modifying the files by hand keep in mind that only if the bytecode files are missing will Luaotfload use the plain version instead. Both kinds of files are safe to delete, at the cost of regenerating them with the next run of LuaTeX.

So the second run of LuaTeX matters.

I feel close to file an issue to setup-texlive-action asking for pre-generating luatex font cache by running luaotfload-tool --update.

@muzimuzhi
Copy link
Owner Author

muzimuzhi commented May 12, 2023

I think this paragraph in manpage for luaotfload explains quite something [...]

Nope. latexmk -lualatex ... reruns lualatex on all OS and executing luaotfload-tool --update on Win is rather fast.
https://github.com/muzimuzhi/hello-github-actions/actions/runs/4955112169

@muzimuzhi muzimuzhi added the discovery What? Why? How? label Sep 6, 2024
@muzimuzhi muzimuzhi force-pushed the main branch 2 times, most recently from 7b24b71 to e7379f1 Compare September 16, 2024 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discovery What? Why? How?
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant