mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 06:45:16 +01:00
pkgs.runCommand: passAsFile (buildCommand can be very long)
Close #15803. This avoids the error: while setting up the build environment: executing ‘/nix/store/7sb42axk5lrxqz45nldrb2pchlys14s1-bash-4.3-p42/bin/bash’: Argument list too long Note: I wanted to make it optional based on buildCommand length, but that seems pointless as I'm sure it's less performant. Amended by vcunat: https://github.com/NixOS/nixpkgs/pull/15803#issuecomment-224841225
This commit is contained in:
parent
46f22d89b9
commit
7a5b85cdda
2 changed files with 5 additions and 0 deletions
|
@ -8,6 +8,7 @@ rec {
|
|||
runCommand = name: env: buildCommand:
|
||||
stdenv.mkDerivation ({
|
||||
inherit name buildCommand;
|
||||
passAsFile = [ "buildCommand" ];
|
||||
} // env);
|
||||
|
||||
|
||||
|
|
|
@ -827,6 +827,10 @@ showPhaseHeader() {
|
|||
|
||||
|
||||
genericBuild() {
|
||||
if [ -f "$buildCommandPath" ]; then
|
||||
. "$buildCommandPath"
|
||||
return
|
||||
fi
|
||||
if [ -n "$buildCommand" ]; then
|
||||
eval "$buildCommand"
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue