-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Reducing reliance on IFD #41
Comments
I agree this is quite annoying. I'm also using stacklock2nix on a project that has a large number of transitive deps, and the initial builds are really slow. The only good thing is that once you do at least once build, subsequent builds are fast. I think there are sort of two main problems here:
These are both closely related. stacklock2nix uses the stacklock2nix/nix/build-support/stacklock2nix/default.nix Lines 376 to 399 in 909a362
stacklock2nix/nix/build-support/stacklock2nix/default.nix Lines 401 to 424 in 909a362
stacklock2nix/nix/build-support/stacklock2nix/default.nix Lines 679 to 690 in 909a362
stacklock2nix/nix/build-support/stacklock2nix/default.nix Lines 307 to 315 in 909a362
These functions use IFD. The
A straight forward way to speed up stacklock2nix would be to reduce calls to As you can see with the An alternative might be to create a single derivation, where There would still be a problem of figuring out what to do with The forced use of IFD in stacklock2nix is also a problem. Since writing stacklock2nix, I've started thinking that the following architecture would be better:
This architecture is similar to the thinking behind The downside of this approach is that we likely wouldn't be able to reuse functions like I haven't started working on this at all, but personally I'll like to try to create a project like |
This blog post might be relevant, I found it when I also ran into the serial builds and wondered how it could be fixed: https://jade.fyi/blog/nix-evaluation-blocking/ The approach of |
Thanks @cdepillabout for your comprehensive response! If I can find some time, I'll try to look at the callHackage thing you mention, and if I have a bit more time, I'll give the generating json/nix stuff a go. I was thinking along similar lines as well, so I'm glad to hear we are on the same page. Your |
Thanks for that link @isomorpheme! It looks super helpful |
@isomorpheme Thanks for the link! That does sound exactly like what we need here :-) Let me ping @lf- in case she has any direct suggestions for us. |
I seem to recall I was contemplating putting some-cabal-hashes in nixpkgs. But yes I would suggest using my code for this ;) |
I'm trying to use this with a project that has approx 500 transitive dependencies. This means that initial builds are quite slow, since IFD causes things to happen in sequence. In particular
all-cabal-hashes-component-<package>
derivations seem to take quite a while. Each is quite cheap, but since they don't run in parallel, and nix wants to check if they exist on caches, they are quite slow. I'm also a bit worried that this makes caching dependencies tricky.I'm wondering if it would be possible to reduce our reliance on IFD. I think even if we could have a couple of bigger IFD derivations rather than lots of small ones, that would be good. Do you have any thoughts/plans about this?
The text was updated successfully, but these errors were encountered: