rityzmon
rityzmon

Reputation: 1965

How to make Stack only build one executable? stack build :exe1 doesn't work?

I have multiple executables in one of my Stack projects:

executable m1
  hs-source-dirs:      src
  main-is:             Main1.hs
  default-language:    Haskell2010
  build-depends:       base >= 4.7 && < 5

executable m2
  hs-source-dirs:      src
  main-is:             Main2.hs
  default-language:    Haskell2010
  build-depends:       base >= 4.7 && < 5

I would like to build only one of them at a time. From the documentation and this other question, it would seem that the following command should work:

stack build :m2

but what actually happens is that both executables, m1 and m2, are always built regardless of whether I include the package name, the package type, etc.

What could be causing this?

Upvotes: 6

Views: 605

Answers (1)

phadej
phadej

Reputation: 12123

It's not possible at the moment. See https://github.com/commercialhaskell/stack/issues/1406

Upvotes: 4

Related Questions