-
Notifications
You must be signed in to change notification settings - Fork 22
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
Break up JSDOM.Types #5
Comments
what are the compiler version and tools/settings you use to cause this? in a normal build on my system, GHC 8.2.2, macOS 10.13.2, latest XCode tools, (edit: my "normal" build meaning |
This is with GHC 8.0.2 and ghcjs-0.2.1-8.0.2 on macOS 10.11.6. If you look closely at the above output, it says |
Just to follow up, we've also tried to build this on a machine with 32 gigs of RAM and it still runs out of memory. IMO you should definitely consider breaking this module up. This is a huge problem. |
CC @luigy, who was running out of memory on linux-only. |
GHC's own memory usage looks reasonable. This is caused by the C compiler compiling the temporary file declaring all cost centres. GCC 5.4.0 seems to cope, clang 3.7 doesn't. The file is around 100k lines with contents like this: extern CostCentreStack jsaddlezmdomzm0zi9zi1zi0zm523c3ILQYauIbqrzzngOY1D_JSDOMziTypes_gTypeGObject_CAF_cc_ccs[];
REGISTER_CCS(jsaddlezmdomzm0zi9zi1zi0zm523c3ILQYauIbqrzzngOY1D_JSDOMziTypes_gTypeGObject_CAF_cc_ccs);
extern CostCentreStack jsaddlezmdomzm0zi9zi1zi0zm523c3ILQYauIbqrzzngOY1D_JSDOMziTypes_gTypeGObject1_CAF_cc_ccs[];
REGISTER_CCS(jsaddlezmdomzm0zi9zi1zi0zm523c3ILQYauIbqrzzngOY1D_JSDOMziTypes_gTypeGObject1_CAF_cc_ccs);
extern CostCentreStack jsaddlezmdomzm0zi9zi1zi0zm523c3ILQYauIbqrzzngOY1D_JSDOMziTypes_gTypeGObject2_CAF_cc_ccs[];
REGISTER_CCS(jsaddlezmdomzm0zi9zi1zi0zm523c3ILQYauIbqrzzngOY1D_JSDOMziTypes_gTypeGObject2_CAF_cc_ccs); This has been fixed in GHC 8.4.1. A workaround for earlier versions is removing any see |
Any chance we can side step this problem easily by just breaking up the module? |
"just" breaking up the module seems like a tad more work than adding a GHC flag. Why make major changes to the code if we already have a workaround and proper upstream fix? Now that we know the problem, I think we should first figure out if there should be a workaround in the package itself, perhaps a GHC version dependent (with CPP) |
good call @luite removing |
workaround for GHC issue implemented in pull request #6 I'm not the package maintainer. @hamishmack merge if you think this looks ok. |
I am experiencing a similar issue with ghc 8.4.3 (not with 8.2.2). Even without profiling the build does not complete on my 8 GB machine. I filed a ghc issue: https://ghc.haskell.org/trac/ghc/ticket/15455#comment:1 Is anyone else experiencing this? |
This is still an issue for me on ghc-8.0.2 and using the |
@eskimor I experience a similar issue with ghc883, see link in comment here. |
I also have trouble compiling JSDOM.Types. I split the module by hand; with one hour work, the new modules build in 5 minutes with 8GB RAM. The main thing stopping me from just making a PR is that the split is sort of random, and maybe you'd rather fix whatever script is generating JSDOM.Types instead of messing with the generated file manually. Feel free to leave suggestions to put it into a reviewable state. |
I second the request to split up JSDOM.Types. Even with current GHC's this still need a huge amount of RAM, and takes quite a while to compile. Moreover, it prevents downstream packages from easily using CI systems [1,2]. This has a cost as well, since it does not easily allow authors to make sure their package builds using the latest versions of the packages on hackage. (Indeed, reflex-dom currently no longer builds, thus causing me as yet another downstream package author to figure out why). Are there reasons why we would particularly like to keep this single huge types module? [1] e.g. reflex-dom's testsuite fails due to out of memory errors when compiling jsaddle-dom (see e.g. https://github.com/reflex-frp/reflex-dom/runs/4629811019?check_suite_focus=true ) |
Among other issues, the huge module makes the Hackage docs very slow to load. |
When I build jsaddle-dom I get the following error:
It sits on the JSDOM.Types module for tens of minutes, possibly more than an hour before failing. I'm running macOS on a machine with 16 gigs of RAM. The fact that I can't build jsaddle-dom on a machine this big seems like a problem. Is it possible to break this module up to make it buildable on normal size systems?
The text was updated successfully, but these errors were encountered: