Glibc issue with pdflatex that manifests with python and subprocess

Hi,

the issue is a bit specific but I’m suspecting there is a more general problem.

I’m experimenting with replit that offers nix.
At some point, in my Python code I’m calling pdflatex:

Compile the LaTeX file to PDF

subprocess.run([“pdflatex”, tex_file], shell=True)

But I got the following error message:

/home/runner/.nix-profile/bin/pdflatex: /nix/store/9bh3986bpragfjmr32gay8p95k91q4gy-glibc-2.33-47/lib/libc.so.6: version GLIBC_2.36' not found (required by /nix/store/ia1nj04xx5v5rbg349m6dpicl1j11cwi-cpplibs/lib/libstdc++.so.6) /home/runner/.nix-profile/bin/pdflatex: /nix/store/9bh3986bpragfjmr32gay8p95k91q4gy-glibc-2.33-47/lib/libc.so.6: version GLIBC_2.34’ not found (required by /nix/store/ia1nj04xx5v5rbg349m6dpicl1j11cwi-cpplibs/lib/libstdc++.so.6)
convert: /nix/store/9bh3986bpragfjmr32gay8p95k91q4gy-glibc-2.33-47/lib/libc.so.6: version GLIBC_2.34' not found (required by /nix/store/rympfmzvl838agp9xlkyi0w48wjb9p3a-glib-2.76.2/lib/libgio-2.0.so.0) convert: /nix/store/9bh3986bpragfjmr32gay8p95k91q4gy-glibc-2.33-47/lib/libc.so.6: version GLIBC_2.34’ not found (required by /nix/store/rympfmzvl838agp9xlkyi0w48wjb9p3a-glib-2.76.2/lib/libglib-2.0.so.0)
convert: /nix/store/9bh3986bpragfjmr32gay8p95k91q4gy-glibc-2.33-47/lib/libc.so.6: version GLIBC_2.34' not found (required by /nix/store/gzs13l92w3308ichywy2013bw2n6l413-libX11-1.8.4/lib/libX11.so.6) convert: /nix/store/9bh3986bpragfjmr32gay8p95k91q4gy-glibc-2.33-47/lib/libc.so.6: version GLIBC_2.36’ not found (required by /nix/store/ia1nj04xx5v5rbg349m6dpicl1j11cwi-cpplibs/lib/libstdc++.so.6)
convert: /nix/store/9bh3986bpragfjmr32gay8p95k91q4gy-glibc-2.33-47/lib/libc.so.6: version GLIBC_2.34' not found (required by /nix/store/ia1nj04xx5v5rbg349m6dpicl1j11cwi-cpplibs/lib/libstdc++.so.6) convert: /nix/store/9bh3986bpragfjmr32gay8p95k91q4gy-glibc-2.33-47/lib/libc.so.6: version GLIBC_2.34’ not found (required by /nix/store/rympfmzvl838agp9xlkyi0w48wjb9p3a-glib-2.76.2/lib/libgmodule-2.0.so.0)
convert: /nix/store/9bh3986bpragfjmr32gay8p95k91q4gy-glibc-2.33-47/lib/libc.so.6: version `GLIBC_2.34’ not found (required by /nix/store/k2b3xdkdflrv38wz8a311dhvac0v1rrb-libselinux-3.3/lib/libselinux.so.1)

What is strange is that pdflatex works like a charm, in the console!

So it’s really the interplay between Python system calls (via subprocess) and pdflatex that leads to this issue.

For the record here is the environment:

ix-env -iA nixpkgs.texlive.combined.scheme-small
installing ‘texlive-combined-small-2021.20210408’
building ‘/nix/store/i0qkvyvw74gs7dzbbnzzgph60azmkyzf-user-environment.drv’…
~/SquidDemoTikZ$ nix-env -iA nixpkgs.imagemagick
installing ‘imagemagick-7.1.0-4’
building ‘/nix/store/a4sfmd0jf8vx3skwd1bslwffd8xjjh2z-user-environment.drv’…
~/SquidDemoTikZ$ pdflatex
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021/NixOS.org) (preloaded format=pdflatex)
restricted \write18 enabled.
**
Please type the name of your input file.
**^C
~/SquidDemoTikZ$ nix-env --version
nix-env (Nix) 2.18.0pre20230808_c0e6466
nix-env -iA nixpkgs.glibc
installing ‘glibc-2.33-47’
building ‘/nix/store/sx87dj0mynab22g3apvy0hz0vdx6r43h-user-environment.drv’…

I’m suspecting nixpkgs.texlive.combined.scheme-small is not correctly packaged with glibc

Such mismatches normally happen only when using mesa from different version (not here I believe) or some $LD_LIBRARY_PATH.