TransWikia.com

MacTeX 2020: "unable to change to format path"

TeX - LaTeX Asked on June 20, 2021

I installed MacTeX 2020 and can’t get ConTeXt to work (does work on another machine where I upgraded from MacTeX 2019). The error is:

$ context file.tex
mtx-context     | warning: no format found, forcing remake (commandline driven)
[…] snip lots of lines
resolvers       | formats | changing to format path '/var/folders/rj/hfjmjx796q102y4v23vh038c0000gp/T/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9/formats/luatex'
resolvers       | formats | unable to change to format path '/var/folders/rj/hfjmjx796q102y4v23vh038c0000gp/T/luatex-cache/context/a86c089b384a3076dc514ba966a1fac9/formats/luatex'
mtx-context     | error, no format found with name: cont-en, aborting
system          | total runtime: 5.315 seconds

I read Running Mark IV from the wiki and tried running

context --make
context --make cont-en

but they quit with the same unable to change to format path message. I assume that is the core problem. After running those commands, I still get the same error when trying to build my PDF.

How can I fix this?

One Answer

I got the solution to this problem from the ConTeXt mailing list (link to thread), I'll quote from there:

These messages come from the middle of the file luat-fmt.lua (lines 180 and 183, respectively, on my system) when ConTeXt tries to change the working directory (that’s what “change” means in this context, just moving to another directory, as in cd or chdir). The relevant extract is

report_format("changing to format path %a",validformatpath)
lfs.chdir(validformatpath)
if dir.current() ~= validformatpath then
  return fatalerror(startupdir,"unable to change to format path %a",validformatpath)
end

In your case validformatpath is a subdirectory of $TMPDIR, under /var/folders/. However, if your Mac is anything like mine, /var is actually a symbolic link to /private/var, so that dir.current() reports a path starting with /private and the test fails.

You can work around that by setting TMPDIR to some other value, that doesn’t start with /var -- and not /tmp either because that’s also a symbolic link :-) It should work with a temporary directory in your home folder.

So what I'm doing is:

env TMPDIR=~/tmp context <file>

You could set this up as alias in your shell, for example I have this for fish:

function context
  env TMPDIR=~/tmp /Library/TeX/texbin/context $argv
end

Answered by flyx on June 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP