Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Stack is extremely slow for Cabal, due to custom setup script #1041
Stack uses runghc to run custom Setup scripts, which for Cabal means that builds are unusably slow as all of Cabal is interpreted. In these cases, I just stop having Cabal bootstrap itself because Stack is so slow in this case. I don't know, can Stack maybe build the script or something?
If Setup.hs only needed to be run once, then running it in the interpreter would be a clear win over compiling it. The issue isn't that interpreted Cabal is too slow - it isn't doing all that much heavy lifting. The issue is that it gets run multiple times, and it gets reloaded into the interpreter each time. Interpreting Cabal once to build it is going to be much faster than building it twice.
Here's an approach that's substantially faster way to build Cabal than either
I'm not sure if the complexity of managing interpreter processes is worth the performance gain, so I'm not really proposing this. Just pointing it out since I thought of it.
Anyway, one way or another I am in favor of doing something about this. It would be very nice for GHCJS, where the interpreter is still WIP. In that circumstance it's even worse, because Setup.hs gets compiled each time it's run. It only affects packages with custom scripts, but this is pretty bad.