chore: Nix: fix depRoot with huge number of deps (#2179)

If `deps` or `depRoots` are too large, bash will carsh when executing
the modified script. This is because there are OS-level limits on the
size of environment variables. This commit changes the script so that
`deps` and `depRoots` are written to files instead of being passed as
environment variables.
This commit is contained in:
Enrico Borba 2023-03-31 21:45:38 -10:00 committed by GitHub
parent 742d053a97
commit 6d583284df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,12 +69,14 @@ with builtins; let
name = "${name}-depRoot";
inherit deps;
depRoots = map (drv: drv.LEAN_PATH) deps;
passAsFile = [ "deps" "depRoots" ];
buildCommand = ''
mkdir -p $out
for i in $depRoots; do
for i in $(cat $depRootsPath); do
cp -dru --no-preserve=mode $i/. $out
done
for i in $deps; do
for i in $(cat $depsPath); do
cp -drsu --no-preserve=mode $i/. $out
done
'';