-
-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkgs.runCommand: passAsFile (buildCommand can be very long) #15803
Conversation
FWIW I did similar work for buildEnv: I used a somewhat arbitrary limit there to achieve two points: hopefully better performance and (more important) no mass rebuild. |
@abbradar well how does that work? See my updated PR. BTW, this is the current workaround:
|
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.
5ce72cf
to
f42761f
Compare
https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/buildenv/builder.pl#L139 tl;dr: check for |
I wonder if |
I wonder that too -- I think it was more cargo-culted than decided objectively at that time. EDIT: (if you don't take mass rebuild into consideration) |
Hm, thinking more about it, we could not have avoided mass rebuild because we were, well, changing |
Right :) I'm testing if this works, will report tomorrow. |
Added a http://sscce.org/ in the description. |
Seems fine to me. |
@vcunat could you pull this into staging on next mass-rebuild? |
eval "$(cat $buildCommandPath)" @domenkozar: this seems a strange way to do it. Why not use the following instead? . "$buildCommandPath" To me it seems cleaner and likely more efficient, but perhaps I'm missing something? |
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: #15803 (comment)
@vcunat not sure if all the escaping/quoting logic stays the same, but sure. Thanks! |
The escaping logic is just what seems cleaner with |
This avoids the error:
Here is a http://sscce.org/:
Note: I wanted to make it optional based on
buildCommand
length,but that seems pointless as I'm sure it's less performant.
This doesn't work yet, because stdenv has to be changed, but I'd like to know if in general it's something that can be generally used.
cc @edolstra if this is a bad idea (for performance reasons)