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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion nix-libs/nodeLib/buildNodePackage.nix
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,23 @@ let

# Define some environment variables that we will use in the build.
setVariables = ''
# In case this was set by an upstream derivation.
# In case these were set by an upstream derivation.
#
# Upstream unsets only `NODE_PATH`, we have added
# the unset of `NIX_LDFLAGS` because:
#
# With a large number of deps, these env vars can
# be large (>128k), such that leaving them exported and
# attempting to invoke shell commands can lead to
# misleading "Argument list too long" errors, which
# actually indicate that kernel-limited env space has
# been exceeded. If unsetting `NIX_LDFLAGS` is problematic
# or cannot be upstreamed, an alternate approach is to
# toggle the exported property on the large env variables
# and/or trying to use something like `passAsFile`.

unset NODE_PATH
unset NIX_LDFLAGS

# This creates a string for this package which is unique but
# deterministic. We can use it to create temporary directories
Expand Down