Skip to content

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

Closed
@recursion-ninja

Description

@recursion-ninja
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions