# Latexmk fails on Windows when output directory is specified

Latexmk does not generate the output PDF with XeLaTeX and biber when an output directory is specified.

I am using an output directory specified by -outdir called build to keep my root directory tidy.

I am running MikTeX on Windows 7 x64. Latexmk is version 4.54c.

Here is an MWE.

test.tex contains the following:

\documentclass{article}
\usepackage[backend=biber]{biblatex}
\begin{document}
\fullcite{InterestingArticle}
\end{document}


publications.bib contains the following:

@article{InterestingArticle,
author    = {Andrew Bate},
title     = {Interesting Article Title},
journal   = {Interesting Journal},
volume    = {999},
year      = {1984}
}


When I run latexmk -xelatex -silent -outdir=build I get the following output, but no PDF in the build directory:

Use of uninitialized value $separator in regexp compilation at C:\Program Files\MiKTeX 2.9\scripts\latexmk\latexmk.pl line 8553. Use of uninitialized value$separator in regexp compilation at C:\Program Files\MiKTeX 2.9\scripts\latexmk\latexmk.pl line 8554.
Use of uninitialized value $search_path_separator in concatenation (.) or string at C:\Program Files\MiKTeX 2.9\scripts\latexmk\latexmk.pl line 1882. Use of uninitialized value$search_path_separator in concatenation (.) or string at C:\Program Files\MiKTeX 2.9\scripts\latexmk\latexmk.pl line 2173.
Use of uninitialized value $print_cmd in string at C:\Program Files\MiKTeX 2.9\scripts\latexmk\latexmk.pl line 2713. Latexmk: Run number 1 of rule 'xelatex' This is XeTeX, Version 3.14159265-2.6-0.99998 (MiKTeX 2.9.6500 64-bit) entering extended mode Latexmk: fls file doesn't appear to have been made Latexmk: Non-existent bbl file 'build/test.bbl' No file test.bbl. Latexmk: ===For rule 'xelatex', actual output 'I:/bug-report/build/test.xdv' ======appears not to match expected output 'build/test.xdv' Latexmk: Summary of warnings: Latex failed to resolve 1 citation(s) Latexmk: Run number 1 of rule 'biber build/test' Latexmk: Run number 2 of rule 'xelatex' This is XeTeX, Version 3.14159265-2.6-0.99998 (MiKTeX 2.9.6500 64-bit) entering extended mode Latexmk: fls file doesn't appear to have been made Latexmk: ===For rule 'xelatex', actual output 'I:/bug-report/build/test.xdv' ======appears not to match expected output 'build/test.xdv' Latexmk: Run number 1 of rule 'bibtex I:/bug-report/build/test' For rule 'bibtex I:/bug-report/build/test', running '&run_bibtex( )' ... Latexmk: Directory in file name 'I:/bug-report/build/test.aux' for bibtex but it is not the output directory 'build' I found no \citation commands---while reading file I:/bug-report/build/test.aux I found no \bibdata command---while reading file I:/bug-report/build/test.aux I found no \bibstyle command---while reading file I:/bug-report/build/test.aux (There were 3 error messages) Collected error summary (may duplicate other messages): bibtex I:/bug-report/build/test: Bibtex errors: See file 'I:/bug-report/build/test.blg' Latexmk: Use the -f option to force complete processing, unless error was exceeding maximum runs of latex/pdflatex.  Removing the -silent flag makes no difference (but obviously the output is longer). If the -outdir flag is removed, then the PDF is generated correctly (but I would like to use an output directory). The above example works correctly running on Linux (Ubuntu 17.10) with TeX Live and with latexmk version 4.54c (the same version of latexmk I used on Windows). On Linux, it works both with and without -outdir specified. I am not using a .latexmkrc file. Note the 'Use of uninitialized value' warnings. These don't appear on Linux, but I do not know if this is related. Any help to get this working is greatly appreciated. Update 2018-01-14: The issue only occurs when the source files are located in a directory on another computer on the network (e.g., a Windows mapped network drive). The PDF is successfully generated when the source files are in a directory on the local filesystem. Upgrading from version 4.54c to 4.54d (released 10 January 2018) removes some of the 'Use of uninitialized value' warnings, but the PDF file is still not generated when the source files are located in a network directory. I have filed a bug with John Collins, the author of latexmk. • $search_path_separator seems to be the path separator (; under Windows and : on Unix-like systems). As far as I can tell, it's initialised in the operating system checks except in the elsif ( $^O eq "msys" ) block. My guess is that perhaps you're running latexmk using MSYS, and the separator variable isn't being set, which is breaking the path search. – Nicola Talbot Jan 9 '18 at 18:23 • @NicolaTalbot I just tested it again, and I'm getting the same output from both Windows Command Prompt and PowerShell. I also tried on a fresh install of Windows 10, and I get the same again. – Andrew Bate Jan 9 '18 at 18:40 • At least part of this is covered here tex.stackexchange.com/q/408783/56716 – ig0774 Jan 9 '18 at 19:36 • @AndrewBate I recommend you report it to latexmk's maintainer. The $search_path_separator variable isn't being set in the elsif ( \$^O eq "msys" ) block which is the cause of the Use of uninitialized value warnings. Since this variable is related to the search path I'm guessing that may be the cause of the failure to find the files, but it's possible there may be something else as well. (Presumably you have an MSYS version of Perl, but I don't know enough about Windows to give further details.) – Nicola Talbot Jan 10 '18 at 15:06
• Latexmk maintainer here. This is an actual bug in latexmk. I've uploaded a corrected version to personal.psu.edu/jcc8//latexmk/versions.html as v. 4.54d. Could you test it? I don't have access to a system with MSys, so I can't test it myself. (You'll need to unpack the distribution's zip file and put latexmk.pl where you can run it.) Contact me at my e-mail in the documentation if you need help. – John Collins Jan 10 '18 at 17:55

This bug is corrected in latexmk v. 4.55. So just upgrade to the latest version.