-
Notifications
You must be signed in to change notification settings - Fork 6
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
Remove duplicate compilation #80
Conversation
… OOM I've seen GHC require >16GB of RES while GitHub runners only have 7GB of RAM.
We're noticing that on #79 GHC requires massive amounts of memory to build certain modules (`IC.Test.Agent` being the worst offender requiring more than 13GB while GitHub Runners only have 7GB causing OOM kills). What's worse is that multiple components in the cabal file require the same modules causing the same module to be build multiple times, often in parallel exacerbating the memory problem. This fixes the duplicate compilation issue by letting the components in the cabal file only depend on the ic-hs library. This might be deterimental to ghcid as mentioned in the cabal file. But the associated ticket has been closed so the problem is hopefully fixed in an upcoming GHC release.
@nomeata is the ghcid issue still a problem these days? |
Yes, multi-packages support in GHC has not reached all the tools, I believe. One could do a very elaborate .cabal file with flags where there are internal libraries during normal compilation, and Maybe the massive memory consumption can be avoided instead, which would be beneficial in any case, by splitting a module or a suitable compiler flag. And not building in parallel. What I'd also love to do is to use a better CI system than the slow runners we get for free, if we aren't that cheap. Hooking this up to nixbuilds.net should be simple and if dfinity crates an account there, I can do the setup. |
I hope we can get the cabal file as simple as possible. What about the alternative you mentioned in the cabal file:
Would that work for you? If so, I can push it to this PR.
Yes, I was already planning to start splitting up modules. But need to find some time for it.
Thanks for the offer to set it up! I'm for it and will propose this in our team. |
Yeah, I guess that is a valid work-around. What I don’t like about that is that now all binaries depend on all modules, but I guess we can’t have it all :-) |
@nomeata I setup a What's your public SSH key? Then I'll add that to the account so you can start setting it up. |
Thanks!
Sorry that I forgot that they may not support darwin. But maybe customer demand will fix that :-) I’ll also use this to speed up Motoko CI; they share the same nix cache anyways. It might be a few days or a week before I’ll get to it, though. |
When adding your key I'm getting the error:
We prioritised ic-hs in our team so I'll go ahead and start integrating nixbuild. |
…and nixbuild/nixbuild-action
… again since it didn't work
This reverts commit 3dc3072.
due to rethab/bindings-dsl#38 Originally dfinity-lab/ic-ref@c6ae6a9
…in/ecdsa-sig-remove-duplicate-compilation
@nomeata I'm not a ghcid user so I would like to understand that use case a bit better. How are you actually using ghcid, or ghci for that matter, in ic-hs? When I try to load (BTW note that I created symlinks to all binaries in
How do you work around that? |
Here is how I use ghcid:
this loads |
We're noticing that on #79 GHC
requires massive amounts of memory to build certain
modules (
IC.Test.Agent
being the worst offender requiring more than13GB while GitHub Runners only have 7GB causing OOM kills).
What's worse is that multiple components in the cabal file require the
same modules causing the same module to be build multiple times, often
in parallel exacerbating the memory problem.
This fixes the duplicate compilation issue by letting the components
in the cabal file only depend on the ic-hs library.
This might be deterimental to ghcid as mentioned in the cabal
file. But the associated ticket has been closed so the problem is
hopefully fixed in an upcoming GHC release.