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?