Overleaf fails to compile project while latexmk by itself works
Steps to Reproduce
- Install a custom package under
/usr/local/texlive/texmf-local/ - Ensure it is installed properly by manually compiling a file inside the docker container using
latexmk - Open that same file using overleaf and hit compile
Expected Behaviour
The compilation finishes successfully and produces the same output as compiling manually.
Observed Behaviour
The compilation fails with a "file not found" error, while using latexmk inside the container produces a correct pdf without issuing any warnings.
Context
I've just updated by overleaf server to 5.0.1 from 4.1 and projects using my custom texlive packages no longer compile.
At first, I assumed that I didn't install the packages properly, but kpsewhich, pdftex, xetex and latexmk seem to have no problem finding and building them.
Technical Info
I've been using a testing file like
\documentclass{mybook}
\usepackage{blindtext}
\begin{document}
\blindtext
\end{document}
where mybook is provided by a custom package.
Weirdly, for one package, the error given by overleaf is about the .cls file itself, while for another, it is about a .tex file included by the .cls file.
The logs show the compiler successfully finds and reads that second .cls file and only fails when it encounters \RequirePackage used to load a .tex file that is also part of the package.
If I observe the exact latexmk command overleaf makes with ps, clean the temporary files and rerun the exact same command that failed for overleaf, it works fine and produces a correct pdf.
If this is a configuration issue, I'm not sure where overleaf could set any options that aren't applied when running latexmk manually. I've dumped the environment variables of overleaf's latexmk processes and they don't seem to contains any suspect configuration options.