Skip to content
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

Unset NIX_LDFLAGS, stop-gap fixing "Argument list too long" errors #136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ixmatus
Copy link
Collaborator

@ixmatus ixmatus commented May 18, 2018

I suspect this doesn't correctly fix #132 but I did want to open a PR with our (Awake Security) temporary workaround so that anyone else with this problem can discover this solution and so that we can discuss whether this suffices or if we want to approach solving this with the suggested passAsFile approach.

Credit for this workaround goes entirely to @intractable (Joel Stanley).

I suspect this doesn't correctly fix adnelson#132 but I did want to open a PR
with our (Awake Security) temporary workaround so that anyone else
with this problem can find the temporary solution and so that we can
discuss whether this suffices or if we want to approach solving this
with the suggested `passAsFile` approach.

Credit for this workaround goes entirely to @intractable (Joel
Stanley).
@adnelson
Copy link
Owner

adnelson commented May 18, 2018

So at Narrative Science we ran into this issue but specifically with NODE_PATH. We found that just unsetting the environment variable doesn't always work, if the environment is already too large by the time the unset line is encountered, and the place where this happens is in the addNodePath bash function, which is defined as a setup hook for nodejs (and therefore invoked by all node packages).

So the solution we came up with was to patch ${stdenv}/setup with one that specifically ignored the addNodePath function, and add a builder argument to mkDerivation which invoked the patched version instead. Roundabout, but it got the job done... not sure if it would fix this behavior as well or if it's something desirable to do all the time.

@adnelson
Copy link
Owner

adnelson commented Jun 5, 2018

Can we get an example derivation (or set thereof) that causes this error? If I have some time I'd like to dive in and see what's going on.

@ixmatus
Copy link
Collaborator Author

ixmatus commented Jun 5, 2018

I can concoct a failing case similar to the one we see with our project, I will have time to do that probably this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Argument list too long" error occurs when building a package with a large dependency set
2 participants