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

nix-shell "argument list too long" #75

Open
jedahu opened this issue Feb 6, 2018 · 1 comment
Open

nix-shell "argument list too long" #75

jedahu opened this issue Feb 6, 2018 · 1 comment

Comments

@jedahu
Copy link

jedahu commented Feb 6, 2018

Running into this issue (NixOS/nixpkgs#19581) when building a node package as a dependency of another derivation using nix-shell.

E.g.

mkDerivation {
  name = "foo-env";
  shellHook = ''
    ${some-node-package-with-a-million-dependencies}/bin/bar
  '';
}
$ nix-shell
Can't exec "/nix/store/<hash>-nix-1.11.16/bin/nix-store": Argument
list too long at ~/.nix-profile/bin/nix-shell line 270.

Is there a known workaround?

@sebastianblunt
Copy link
Contributor

When I ran into this it was because the compositionScript was being inherited and thus being inserted into the environment as an environment variable, and its size grows with the number of dependencies. Unsetting nodePackages.package.compositionScript resolved the error for me.

sebastianblunt added a commit to sebastianblunt/nix that referenced this issue Apr 11, 2022
Previously it only logged the builder's path, this changes it to log the
arguments at the same log level, and the environment variables at the
vomit level.

This helped me debug svanderburg/node2nix#75
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

No branches or pull requests

2 participants