diff options
author | Bas van Dijk <v.dijk.bas@gmail.com> | 2020-02-17 11:45:44 +0100 |
---|---|---|
committer | Bas van Dijk <v.dijk.bas@gmail.com> | 2020-02-17 11:45:44 +0100 |
commit | 4e0a6bc4be0e5fb516e92f932b52572244e95f4b (patch) | |
tree | 96d603660e60a6d0ea69160f3b1863d35fb2bc2a /pkgs/build-support | |
parent | fc592a52cacfbf5f22e6479a22263983f5346ea6 (diff) |
symlinkJoin: fix "bash: Argument list too long" error
When the `paths` argument is too big `symlinkJoin` will fail with: ``` while setting up the build environment: executing '/nix/store/rm1hz1lybxangc8sdl7xvzs5dcvigvf7-bash-4.4-p23/bin/bash': Argument list too long ``` This is fixed by passing `paths` as a file instead of as an environment variable.
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/trivial-builders.nix | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix index 5210b7d7ba203..e107db2db5c99 100644 --- a/pkgs/build-support/trivial-builders.nix +++ b/pkgs/build-support/trivial-builders.nix @@ -255,11 +255,14 @@ rec { }: let args = removeAttrs args_ [ "name" "postBuild" ] - // { inherit preferLocalBuild allowSubstitutes; }; # pass the defaults + // { + inherit preferLocalBuild allowSubstitutes; + passAsFile = [ "paths" ]; + }; # pass the defaults in runCommand name args '' mkdir -p $out - for i in $paths; do + for i in $(cat $pathsPath); do ${lndir}/bin/lndir -silent $i $out done ${postBuild} |