Change:
# libfaketime fixes non-determinism related to timestamps ignoring FORCE_SOURCE_DATE # we cannot fix further randomness caused by luatex; for further details, see # https://salsa.debian.org/live-team/live-build/-/blob/master/examples/hooks/reproducible/2006-reproducible-texlive-binaries-fmt-files.hook.chroot#L52 <del> FORCE_SOURCE_DATE=1 TZ= faketime -f '@1980-01-01 00:00:00 x0.001' fmtutil --sys --all | grep '^fmtutil' # too verbose </del> <ins> # note that calling faketime and fmtutil is fragile (faketime uses LD_PRELOAD, fmtutil calls /bin/sh, causing potential glibc issues on non-NixOS) # so we patch fmtutil to use faketime, rather than calling faketime fmtutil substitute "$out/bin/fmtutil" fmtutil  --replace 'my $cmdline = "$eng -ini ' 'my $cmdline = "faketime -f '"'"'@1980-01-01 00:00:00 x0.001'"'"' $eng -ini ' FORCE_SOURCE_DATE=1 TZ= perl fmtutil --sys --all | grep '^fmtutil' # too verbose </ins> #texlinks "$out/bin" && wrapBin # do we need to regenerate format links? # Disable unavailable map files

Discussion:
Regression caused by : on non-NixOS (in my case, Ubuntu 22.04), building the formats causes the following error Steps to reproduce the behavior: nix and nixpkgs on a Ubuntu 22.04 on some custom collection of packages. : call (after adjusting , because is not currently wrapped). Whereas calling seems to work fine, thus it's really the call to that messes up things. Formats should build, of course, and there should not be any mention of the impure ! also I don't know how to fix this one! Please run and paste the result. `
Yeah, I don't think we can fix this. I suggest a revert and patch properly.
In the meanwhile, I discovered my nix install (via the Debian package) couldn't sandbox properly. After removing the Debian package and installing nixpkgs proper, I could sandbox the build and avoid the issue. So this is in part a bug of the Debian nix package (because it does not sandbox properly). My suspicions are also on the function in perl, which calls (hardcoded!). That's my current best guess as to why the impure linker is involved. Maybe the correct solution to compile perl with the correct , if that's even possible... ? In the meanwhile, if non-sandboxed builds must be supported, we should definitely revert before 23.05 branches off.
Quick note: I am fairly convinced now that is causing problem because preloading libfaketime causes a glibc conflict. We should probably patch , or , in the perl Configure script so that perl calls a nix shell. if you know the appropriate person to cc for perl stuff, please do, I don't think I can patch perl correctly on my own.
The fact that the system function executes /bin/sh is governed by glibc. I remember this was discussed before, and there were issues with hardcoding in there.
Presumably a cycling dependency bash -glibc -bash, at a minimum. The lesson: is fragile and must be handled with care. Better patch fmtutil locally, like we do for mtxrun, to add faketime in front of the format calls. (Changing the perl configuration might still be doable, though, regardless of whether it changes the behaviour of . I'll give it a try.)
This issue has been mentioned on NixOS Discourse. There might be relevant details there: