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
@ -8,6 +8,7 @@ rec {
|
|||||||
runCommand = name: env: buildCommand:
|
runCommand = name: env: buildCommand:
|
||||||
stdenv.mkDerivation ({
|
stdenv.mkDerivation ({
|
||||||
inherit name buildCommand;
|
inherit name buildCommand;
|
||||||
|
passAsFile = [ "buildCommand" ];
|
||||||
} // env);
|
} // env);
|
||||||
|
|
||||||
|
|
||||||
|
@ -827,6 +827,10 @@ showPhaseHeader() {
|
|||||||
|
|
||||||
|
|
||||||
genericBuild() {
|
genericBuild() {
|
||||||
|
if [ -f "$buildCommandPath" ]; then
|
||||||
|
. "$buildCommandPath"
|
||||||
|
return
|
||||||
|
fi
|
||||||
if [ -n "$buildCommand" ]; then
|
if [ -n "$buildCommand" ]; then
|
||||||
eval "$buildCommand"
|
eval "$buildCommand"
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user