-
-
Notifications
You must be signed in to change notification settings - Fork 14.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
Feature/no more haskell libs #43713
Feature/no more haskell libs #43713
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this change very much. Removing the lib
hierarchy goes against all kinds of common practices that we have in the Unix world in general and the Nix world in particular. I am sorry, but I'd have to say that I'm against this change.
@peti, I'm find with this not being merged. I've only split #43559 apart. And I do need this fix (or a comparable one) right now. I believe @domenkozar is in the same camp, where a fix right now is needed an |
My favorite solutions are (in order of preference):
And those options are not mutually exclusive, i.e. we might conveivable want to do all three of those. |
@peti What's your estimate on how much work it is to implement this preferred solution? Can we just modify the generic builder or would that make many Haskell packages fail? For my work on #43795 I would love to have a good long-term solution available (right now I have cherry-picked this PR). |
FWIW strictDeps should already be enabled for cross everywhere. So at least (3) is not going to change anything for cross mingw. @angerman At what point (setup or build) & on what platform (linux or darwin) are you hitting ARG_MAX? |
@matthewbauer I'm not him but I can tell you my case: When building |
@nh2,
I think it's quite easy. We just replace the shell loop that collects all propagated dependencies by Nix code that does the same thing at evaluation time with
I believe the change would make no difference with respect to what compiles and what doesn't. In fact, packages that don't compile after that modification are broken already, we just didn't notice. |
@matthewbauer I see this when cross compiling macOS -> Windows with nix. But it's really just a function of the transitive dependencies. macOS ARG_MAX is lower than that on Linux usually. Which is why you need more dependencies to see it on linux as well. In any case the underlying reason is the explosion of Library Search paths, and that we don't use response files. Even then though GCC has only recently been fixed to pass them internally via response files. This is very closely related to the LOAD COMMAND SIZE limit on macOS that haskell used to hit, and the MAX_ARG issue you hit easily on windows when building haskell applications natively. Even though this reduces the number of arguments passed, you could potentially still exceed the ARG_MAX by blowing up your transitive dependency closure. |
While I think this could be worth it in the long run- currently at least closePropagation is broken. It doesn't do the same things the setup.sh now does. We probably want to fix it in the long run but that makes this solution a little more difficult right now. |
Can you be more specific, please? What exactly is broken about closePropagation? |
This is a new flag that is checked to prevent the wrappers from adding CFLAGS & LDFLAGS. It should be used sparingly but in the case of Haskell packages, it is necessary to avoid hitting ARG_MAX limits. Haskell has its own way of handling deps which is done in generic-builder.nix. Skipping the {C,LD}FLAGS is a harmless way to reduce ARG_MAX. Related to PR NixOS#43713. /cc @angerman @Ericson2314 @peti
It hasn't been updated with the new setup.sh. It's technically deprecated and I don't think anyone has changed it in 5+ years (3fbd694). It's possible that it will work for most cases - just we will need some changes for things introduced like depsTargetTargetPropagated, depsBuildBuildPropagated, depsBuildTargetPropagated, depsHostHostPropagated. |
I have opened #43825 which I am hoping will be avoid some of the issues raised with this PR. It should have a similar effect to this - but avoid moving any directories around. |
I suppose one could argue I also want |
How come This all seems very weird to me. Anyhow, I've decided that I'll be neutral w/r to these changes. Please go ahead and do whatever you feel is best. |
I would suggest merging #43825 for now. Then in staging do what @dezgeg suggests in matthewbauer@110b5e0#r29781349. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am pretty sure this will break with-packages-wrapper.nix logic. https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/with-packages-wrapper.nix#L59
This was fixed in #43825. |
Motivation for this change
Broken out of #43559
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)