intellij-haskforce icon indicating copy to clipboard operation
intellij-haskforce copied to clipboard

Stack build

Open carymrobbins opened this issue 9 years ago • 4 comments

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

carymrobbins avatar Nov 20 '15 07:11 carymrobbins

The issue upstream has been resolved, so a more efficient builder can now be implemented.

carymrobbins avatar Nov 28 '15 05:11 carymrobbins

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:

  1. Create a separate StackBuilder, say StackBuilderAll, that gets called when "Make project" is issued. I'm not sure if this is even possible?
  2. 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? :)

tobiasgwaaler avatar Mar 13 '16 20:03 tobiasgwaaler

~~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

tobiasgwaaler avatar Mar 13 '16 21:03 tobiasgwaaler

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.

carymrobbins avatar Mar 14 '16 03:03 carymrobbins