Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component target syntax for a single executable builds all executables instead of the targeted one. #3059

Closed
recursion-ninja opened this issue Mar 14, 2017 · 4 comments

Comments

@recursion-ninja
Copy link

recursion-ninja commented Mar 14, 2017

me@box:~$ stack --version
Version 1.3.2

I have a .cabal with one library and 3 executables defined in it. Without loss of generality, let's name the library libraryName and the three executables executableOne, executableTwo, and executableThree.

Let's say that libraryName, executableOne and executableTwo type check but executableThree fails to type check.

I ran all of the following:

stack build :executableOne
stack build libraryName:executableOne
stack build libraryName:exe:executableOne

On each run stack attempted to build the library and all three executables.

  • executableOne build successfully, great that's what I asked for.
  • executableTwo build successfully, not what I asked from but no harm no foul.
  • executableThree failed to build, and executableOne and executableTwo both were not installed because executableThree failed to build.

What I expected to happen:

  • executableOne build to successfully.
  • executableTwo not attempted to be built even though it could be built successfully.
  • executableThree not attempted to be built because it could be built successfully.
  • executableOne to be installed because it built successfully and other failing builds were not attempted.

According to the documentation on components and on target syntax this is not the expected behavior.

Isn't the whole use case for this feature to build certain explicit components of a project when other components won't build? Seems to be failing.

@recursion-ninja
Copy link
Author

Here's an example project to reproduce the error.

Reproduce with:
stack build :target-executable

@sjakobi
Copy link
Member

sjakobi commented Mar 15, 2017

Looks like a duplicate of #1406.

@recursion-ninja
Copy link
Author

Maybe they should remove this feature from the documentation until it's been reimplemented. Accoring to the other issue referenced by @sjakobi, it has been over a year since this feature worked.

mgsloan added a commit that referenced this issue Mar 16, 2017
@mgsloan
Copy link
Contributor

mgsloan commented Mar 16, 2017

Indeed, closing as a duplicate. I agree that it sucks, unfortunately we are blocked on Cabal here. Despite haskell/cabal#3022 getting merged more than a year ago, it hasn't made it into a released version of Cabal.

I've added a note to the docs about this, good idea.

@mgsloan mgsloan closed this as completed Mar 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants