NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.41k stars 13.63k forks source link

TeXLive packages are missing a dependency on sed #150620

Closed alexshpilkin closed 2 years ago

alexshpilkin commented 2 years ago

Packages generated with <nixpkgs>.texlive.combine (all of them, as far as I can tell, whether the standard texlive.combined.* ones or custom ones) include a mktexmf script that depends on sed, but don’t declare a dependency on it.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Build a TeXLive package, e.g. texlive.combined.basic.
  2. Find the built package in the Nix store and look at share/texmf/scripts/texlive/mktexmf inside it.
  3. Observe sed invocations in the initial lines of the script.

Additional context

I initially observed this problem while trying to build a Cyrillic document on a Nix-on-Droid installation, but as far as I can tell this part of it is just taken verbatim from Nixpkgs (the maintainer there observes, though, that e.g. stdenv is intentionally not installed, but an implicit dependency is evil in any case).

I’m not including a more actionable reproduction because the only way I can actually get mktexmf to run is by requesting Cyrillic fonts in a LaTeX document, which requires a fairly extensive TeXLive environment. The mktexmf script is normally invoked (via mktextfm) for any (font, size) pair not previously used on the system, but the standard Latin-only Computer Modern fonts seem to come with metrics already.

Depending on how TeX packaging is intended to work in Nixpkgs (I’ve no idea), it might be that all font metrics are intended to be included in the packages and mktexmf is not intended to run at all after installation, in which case the bug is in a different place and I’ll need to post an example document after all.

A closer look at mktexmf reveals that all the sed invocations accomplish is the moral equivalent of basename and dirname, so in an ideal world somebody (me?) should probably just go bug upstream to get rid of them altogether.

(This report was initially filed as t184256/nix-on-droid#152.)

Notify maintainers

@veprbl @xworld21

Metadata

(This is the Nix-on-Droid environment I originally observed this in.)

bash-4.4$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"aarch64-linux"`
 - host os: `Linux 4.14.190-perf+`
 - multi-user?: `no`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.3.15`
 - channels(nix-on-droid): `"nix-on-droid-21.05, nixpkgs-21.05.3801.83667ff60a8"`
 - nixpkgs: `/data/data/com.termux.nix/files/home/.nix-defexpr/channels/nixpkgs`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
veprbl commented 2 years ago

MRE:

# env -i `which mktextfm` rsfs10
/nix/store/k74kiyaxbn5vnhwxpgyqn20fnh5p962z-texlive-texlive-scripts-58791/scripts/texlive/mktextfm: line 11: sed: command not found
/nix/store/k74kiyaxbn5vnhwxpgyqn20fnh5p962z-texlive-texlive-scripts-58791/scripts/texlive/mktextfm: line 14: sed: command not found
/nix/store/rw08g6pn4hh97lgbx5llcv991fsm0kxy-texlive-combined-full-2021.20210408/share/texmf/web2c/mktex.opt: line 32: uname: command not found
/nix/store/rw08g6pn4hh97lgbx5llcv991fsm0kxy-texlive-combined-full-2021.20210408/share/texmf/web2c/mktex.opt: line 62: mkdir: command not found
/nix/store/rw08g6pn4hh97lgbx5llcv991fsm0kxy-texlive-combined-full-2021.20210408/share/texmf/web2c/mktex.opt: line 1: rm: command not found