Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added TEXMF variable to environment for tex wrappers, fixes #19279 #47370

Closed
wants to merge 1 commit into from

Conversation

olynch
Copy link
Contributor

@olynch olynch commented Sep 25, 2018

Motivation for this change

See issue #19279

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@Mic92
Copy link
Member

Mic92 commented Sep 25, 2018

cc @veprbl

@xeji
Copy link
Contributor

xeji commented Sep 25, 2018

Please rebase this on the staging branch as it triggers a mass rebuild.

@@ -155,7 +155,8 @@ in buildEnv {
rm "$link"
makeWrapper "$target" "$link" \
--prefix PATH : "$out/bin:${perl}/bin" \
--prefix PERL5LIB : "$out/share/texmf/scripts/texlive"
--prefix PERL5LIB : "$out/share/texmf/scripts/texlive" \
--prefix TEXMF : "$out/share/texmf"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, this is definitely not a case for --prefix. Maybe --suffix or --set-default.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also learned that they also use ; for separator.

@veprbl
Copy link
Member

veprbl commented Sep 26, 2018

It seems like there is already all the paths defined in share/texmf/web2c/texmf.cnf and mtxrun manages to ignore those. Enabling --verbose output I get https://pastebin.com/QPjn0hJS , which indicates that it indicates empty TEXMFCNF. I don't mind applying the workaround, but we might want to report this upstream as well.

@veprbl
Copy link
Member

veprbl commented Sep 26, 2018

Turns out the problem is that mtxrun requires cache being present for paths defined in texmfcnf.lua. Setting TEXMF makes it not require cache anymore. The proper solution is to generate the cache. Please try this:

diff --git a/pkgs/tools/typesetting/tex/texlive/combine.nix b/pkgs/tools/typesetting/tex/texlive/combine.nix
index 8a01ac74414..a5a25a9a6dd 100644
--- a/pkgs/tools/typesetting/tex/texlive/combine.nix
+++ b/pkgs/tools/typesetting/tex/texlive/combine.nix
@@ -235,6 +235,17 @@ in buildEnv {
         ln -s -t . ../texmf/doc/"$d"/*
       )
     done
+  '' +
+  # MkIV uses its own lookup mechanism and we need to initialize
+  # caches for it. Unsetting TEXMFCNF is needed to let mtxrun
+  # determine it from kpathsea so that the config path is given with
+  # "selfautodir:" as it will be in runtime. This is important because
+  # the cache is identified by a hash of this path.
+  ''
+    (
+      unset TEXMFCNF
+      mtxrun --generate
+    )
   ''
     + bin.cleanBrokenLinks
   ;

@veprbl veprbl mentioned this pull request Sep 27, 2018
9 tasks
veprbl added a commit to veprbl/nixpkgs that referenced this pull request Sep 27, 2018
@xeji
Copy link
Contributor

xeji commented Sep 27, 2018

fixed in #47426 (which is in staging now and will take some time to hit master)

@xeji xeji closed this Sep 27, 2018
dtzWill pushed a commit to dtzWill/nixpkgs that referenced this pull request Oct 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants