intellij-haskforce
intellij-haskforce copied to clipboard
Stack build
Currently, the stack builder can be a little inefficient. In order to get absolute paths to the source locations of errors, we must run stack build .
in each package directory, which is slower than just running stack build
at the project root.
Note that there is an open issue upstream to get absolute paths when using stack build
- https://github.com/commercialhaskell/stack/issues/1348
The issue upstream has been resolved, so a more efficient builder can now be implemented.
It seems to me that "Make project" and "Make module ..." works the same way: targets are computed, and the dependencies between them, then each each module/target will be built. The way I see it we have two options to avoid calling stack build .
in each module/target/package:
- Create a separate
StackBuilder
, sayStackBuilderAll
, that gets called when "Make project" is issued. I'm not sure if this is even possible? - Ignore the targets, and always do a
stack build
in the root directory, so all modules/targets/packages gets built, even if you've only asked that one module gets built by issuing a "Make module ..."
Is there something I'm missing? :)
~~And either way, since this landed in stack 1.0.4.2, we should keep the old way of doing it when using an older version of stack~~ never mind, it actually landed in v0.1.10.0, and in my opinion that's too old to support
Yeah, I think just doing stack build
for any request to build is probably "good enough" for now. We'd just want to confirm that it properly outputs absolute paths to the source locations.