[Tex/LaTex] Updating to Beta Builds of ConTeXt / LuaTeX from tlcontrib breaks MacTeX

installingluatex

[What follows is my question, re-written with better information and condensed.]

I might be missing something really simple and I might be overcomplicating something really easy.

To Be Extremely Brief

Prior to updating a fresh MacTeX install (with up-to-date packages installed from one of the main repositories), ConTeXt worked will, even in MK IV, except that I couldn't get font selection to work. It seamed to ignore it or show garbage (Palatino). So I updated with the tlcontrib packages using tlmgr and now, even after doing what I can to rebuild hashes/–generate (mtxtools) etc, luatools always returns MTXrun | unknown script 'base.lua' or 'mtx-base.lua'.

Question 1: What's wrong?

Question 1 MK II: 🙂 Is there something called mtx-base.lua or base.lua, or is this some script not getting a variable name and just putting base in there, because that's the constant… or something? Anyway, I cannot find either file, so I'm in the same boat as luatools.lua. 🙂

To Be Kind of Brief

  1. I installed MacTeX 2010 fresh, after a failed attempt at using updated ConTeXt files. (resolved from an In an earlier question)
  2. I updated all packages using the normal trees.
  3. I changed my TEXMFHOME variable in /usr/local/texlive/2010/texmf.cnf to ~/src/texmf-trms, which is where I keep my custom modules/templates/packages. (This is normally within our github source control, but hasn't been yet.) and moved the content from the old directory to the new.
  4. I was beating my head against the wall, trying to make font selection work using typescriptfile/typescript as well as simplefont. The closest I could get was with simplefont and Palatino spewing garbage text into the PDF. While it's not the main topic of this post, if it's helpful, typing sudo mtxrun --script fonts --list --name --pattern=*' always resulted inzsh: no matches found: –pattern=*`.
  5. I decided to try http://tlcontrib with tlmgr using:

    sudo tlmgr –repository http://tlcontrib.metatex.org/2010 update -all

  6. I sudo texconfig rehashed (seemed okay), sudo mtxrun --generate (seemed okay). Then I sudo luatools --generate and got something that ended with MTXrun | unknown script 'base.lua' or 'mtx-base.lua'

  7. Just typing luatools results in: MTXrun | unknown script 'base.lua' or 'mtx-base.lua'
  8. As per my attempt to solve this and some reading on the Interweb, I tried editing the two texmfcnf.lua files that I found (in /usr/texlive/2010/ and /usr/texlive/2010/texmf/web2c`) with:

    return {
    content = {
    TEXMFCACHE = '~/Library/texlive/2010/texmf-var',
    TEXMFHOME = '~/src/texmf-trms',
    },
    TEXMFCACHE = '~/Library/texlive/2010/texmf-var',
    }

This had no effect and, quite probably, has nothing to do with anything, as someone has helpfully pointed out.

Outputs From Some Commands That I Tried

Compile a document with luatools:

MTXrun | warning: no format found, forcing remake (commandline driven)
MTXrun | running command: luatools --generate
MTXrun | unknown script 'base.lua' or 'mtx-base.lua'

MTXrun | running command: luatools --make --compile cont-en
MTXrun | unknown script 'base.lua' or 'mtx-base.lua'

MTXrun | error, no format found with name: cont-en, aborting
MTXrun | total runtime: 0.321

Output from sudo luatex --generate --verbose:

MTXrun | resolvers: variable 'SELFAUTOLOC' set to
'/usr/local/texlive/2010/bin/x86_64-darwin'
MTXrun | resolvers: variable 'SELFAUTODIR' set to '/usr/local/texlive/2010/bin'
MTXrun | resolvers: variable 'SELFAUTOPARENT' set to '/usr/local/texlive/2010'
MTXrun | resolvers: variable 'TEXMFCNF' set to ''
MTXrun | resolvers: variable 'TEXMF' set to ''
MTXrun | resolvers: variable 'TEXOS' set to 'bin'
MTXrun | resolvers
MTXrun | resolvers: loading configuration file
'/usr/local/texlive/2010/texmfcnf.lua'
MTXrun | resolvers
MTXrun | resolvers: loading configuration file
'/usr/local/texlive/2010/texmf/web2c/texmfcnf.lua'
MTXrun | resolvers
MTXrun | resolvers: locating list of '/Users/andrew/src/texmf-trms' (runtime)
MTXrun | resolvers: handler 'tree:////Users/andrew/src/texmf-trms' ->
'locators' -> 'path=/Users/andrew/src/texmf-trms | noscheme=false |
query= | scheme=tree | original=tree:////Users/andrew/src/texmf-trms |
fragment= | authority='
MTXrun | resolvers: hash 'tree:////Users/andrew/src/texmf-trms' appended
MTXrun | resolvers: skipping list of
'/usr/local/texlive/2010/texmf-project' (cached)
MTXrun | resolvers: skipping list of
'/usr/local/texlive/2010/texmf-fonts' (cached)
MTXrun | resolvers: skipping list of
'/usr/local/texlive/2010/texmf-local' (cached)
MTXrun | resolvers: skipping list of
'/usr/local/texlive/2010/texmf-context' (cached)
MTXrun | resolvers: locating list of '/usr/local/texlive/2010/texmf' (cached)
MTXrun | resolvers: tex locator '/usr/local/texlive/2010/texmf' found
MTXrun | resolvers: hash '/usr/local/texlive/2010/texmf' appended
MTXrun | resolvers: locating list of
'/usr/local/texlive/2010/texmf-dist' (cached)
MTXrun | resolvers: tex locator '/usr/local/texlive/2010/texmf-dist' found
MTXrun | resolvers: hash '/usr/local/texlive/2010/texmf-dist' appended
MTXrun | resolvers
MTXrun | resolvers: handler 'tree:////Users/andrew/src/texmf-trms' ->
'hashers' -> 'path=/Users/andrew/src/texmf-trms | noscheme=false |
query= | scheme=tree | original=tree:////Users/andrew/src/texmf-trms |
fragment= | authority='
MTXrun | resolvers: scanning path '/Users/andrew/src/texmf-trms'
MTXrun | resolvers: 596 files found on 114 directories with 62
uppercase remappings
MTXrun | resolvers: loading 'files' for
'/usr/local/texlive/2010/texmf' from
'/Users/andrew/Library/texlive/2010/texmf-var/luatex-cache/context/210a81d6dcb1059dc80fab3f5470ab7a/trees/1240e363db2f4c53de58379d2b0c6f6b'
MTXrun | resolvers: loading 'files' for
'/usr/local/texlive/2010/texmf-dist' from
'/Users/andrew/Library/texlive/2010/texmf-var/luatex-cache/context/210a81d6dcb1059dc80fab3f5470ab7a/trees/26993469c6208234eef0d0acf8456c4d'
MTXrun | resolvers: using suffix based filetype 'lua'
MTXrun | resolvers: using suffix based filetype 'lua'
MTXrun | resolvers: remembering file 'mtx-base.lua'
MTXrun | resolvers: using suffix based filetype 'lua'
MTXrun | unknown script 'base.lua' or 'mtx-base.lua'

Best Answer

Mica is almost correct, but I couldn't convey the edits in a comment, so if it is more appropriate, he can edit his and I'll remove my answer...

The current MacTeX needs the following line in the /usr/local/texlive/2010/texmfcnf.lua file:

return { TEXMFCACHE = '$HOME/Library/texlive/2010/texmf-var' }

Sweet! But, this does not work for the beta builds on tlcontrib! Mica's solution should work, except that there is an issue with how the betas deal with the ~ that is beyond my brain capacity. So, instead, one needs to edit the file to say:

return {content={ TEXMFCACHE = '$HOME/Library/texlive/2010/texmf-var',
                  TEXMFHOME = '$HOME/src/texmf-trms'}, 
          TEXMFCACHE='$HOME/Library/texlive/2010/texmf-var'
       }

...instead. Notice the absent coma after the last TEXMFCACHE and notice the use of $HOME instead of ~.

To speed things up, I made two files. One called /usr/local/texlive/2010/texmfcnf-tlcontrib.lua which has the new code and another called /usr/local/texlive/2010/texmfcnf-mactex.lua which has the standard MacTeX installation code.

Then, in my zsh profile (I think bash is the same) I added the following utility commands:

alias tlc="sudo tlmgr --repository http://tlcontrib.metatex.org/2010"
function tlcontext {
  sudo cp -f -v /usr/local/texlive/2010/texmfcnf-tlcontrib.lua /usr/local/texlive/2010/texmfcnf.lua;
  sudo tlmgr --repository http://tlcontrib.metatex.org/2010 update context luatex metapost;
}

function tlmactex {
  sudo cp -f -v /usr/local/texlive/2010/texmfcnf-mactex.lua /usr/local/texlive/2010/texmfcnf.lua;
  sudo tlmgr install context luatex metapost --reinstall;  
}

function tlun { sudo tlmgr $1 --reinstall; }

tlcontext seems to do everything that I need to move to the newest ConTeXt build. tlmactex appears to bring me back. I'll let all ya'all know if I'm wrong, but it appears that this works perfectly.