conda-forge / miktex-feedstock

A conda-smithy repository for miktex.
BSD 3-Clause "New" or "Revised" License
3 stars 11 forks source link

latex package DB out of sync if used in multiple envs #1

Closed jankatins closed 8 years ago

jankatins commented 8 years ago

The problem: the latex pkg registry is actually getting shared between envs because the DB is in the extracted pkg <miniconda>\pkgs\miktex-2.9.5857-0\Library\miktex\miktex\data\le\mpm.fndb and is linked into each env. If an env installs a latex package, mpm updates the DB without unlinking it. In another env, the DB thinks a package is installed, but the files for that packages are only in the env which had that package installed.

I will investigate if there is a way to configure miktex to see he conda packages as a "net" install and then use user paths for the rest of the packages...

A short term measurement might be to copy the DB (as a file), remove the old DB (=unlink) and move the new file into that place -> But I'm not sure what happens during unlink of the package, if conda removes the file even if it does not point to the package included file... Anyway, in the worst case, the packages gets redownloaded again on the fly...

jankatins commented 8 years ago

This looks promising:

λ initexmf.bat --report
MiKTeX: 2.9
Invokers: ConEmu/ConEmuC64/cmd
SystemAdmin: no
PowerUser: no
OS: Windows 7 Professional, 64-bit, Service Pack 1, build 7601
Root 0: C:\portabel\miniconda\Library\miktex
UserInstall: C:\portabel\miniconda\Library\miktex
UserData: C:\portabel\miniconda\Library\miktex
UserConfig: C:\portabel\miniconda\Library\miktex
CommonInstall: C:\portabel\miniconda\Library\miktex
CommonData: C:\portabel\miniconda\Library\miktex
CommonConfig: C:\portabel\miniconda\Library\miktex
jankatins commented 8 years ago

Ok, after a "bit" of try and error and grepping around the miktex source:

Changing <miniconda>\Library\miktex\miktex\config\miktexstartup.ini to

;;; MiKTeX startup information

[Auto]
Config=Regular

[PATHS]
CommonInstall=..\..
CommonData=..\..
CommonConfig=..\..

Results in this:

Root 0: C:\Users\jschulz\AppData\Roaming\MiKTeX\2.9
Root 1: C:\Users\jschulz\AppData\Local\MiKTeX\2.9
Root 2: C:\portabel\miniconda\Library\miktex
UserInstall: C:\Users\jschulz\AppData\Roaming\MiKTeX\2.9
UserData: C:\Users\jschulz\AppData\Local\MiKTeX\2.9
UserConfig: C:\Users\jschulz\AppData\Roaming\MiKTeX\2.9
CommonInstall: C:\portabel\miniconda\Library\miktex
CommonData: C:\portabel\miniconda\Library\miktex
CommonConfig: C:\portabel\miniconda\Library\miktex

That looks about what we want: a common install/config/... directory in the package data (installed into each env) and then a user install/config stuff under %HOME%

jankatins commented 8 years ago

@ocefpaf The original build hasn't succeeded yet (is appveyor down?), what is the best way to submit this changes? As a number=0 build (and assume that older builds are canceled?) or should I increment that already?

ocefpaf commented 8 years ago

I can see the build in the queue. I guess we just need to wait.

jankatins commented 8 years ago

ok, this idea doesn't yet work: when I install it, it breaks all commands :-(

jankatins commented 8 years ago

Or it does: echo. isn't the same as echo ....