You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a package with both a library and an executable (which depends on the library). Whenever I try to build just the library (so that I can restart my stack ghci process for the executable to develop against the changes I've made) the executable section is built as well.
As an example I'm going to take my jbi project (as I first noticed this on an internal project).
Steps to reproduce
Clone jbi src
echo "resolver: lts-9.4" >> stack.yaml
echo "blah" >> src/Main.hs
Try to build the library only: stack build jbi:lib.
Expected
Library is built successfully. Executable is not touched.
Actual
Library is built, then stack attempts to build the executable as well and fails. As such, the entire build fails.
(Run once already to get dependencies downloaded, library built, etc. thus minimising noise.)
Hmm, it should only build the executable the first time. Once it's built, it should be possible to build just the library component. See #3229
Are you getting different behavior? Once stack switches to doing per-component builds (Cabal 2.0 feature), it will hopefully no longer even require the initial build of the executable.
@ivan-m Ahah! The issue is that the fix in #3229 came after the release of 1.5.0, and 1.5.1 was just a small patch atop 1.5.0. So, you need to use the master version of stack to get the fix for this.
I realize the fix is not really ideal, but it seems like an ok enough workaround until the proper per-component builds stuff is used.
General summary/comments (optional)
I have a package with both a library and an executable (which depends on the library). Whenever I try to build just the library (so that I can restart my
stack ghci
process for the executable to develop against the changes I've made) the executable section is built as well.As an example I'm going to take my jbi project (as I first noticed this on an internal project).
Steps to reproduce
jbi
srcecho "resolver: lts-9.4" >> stack.yaml
echo "blah" >> src/Main.hs
stack build jbi:lib
.Expected
Library is built successfully. Executable is not touched.
Actual
Library is built, then stack attempts to build the executable as well and fails. As such, the entire build fails.
(Run once already to get dependencies downloaded, library built, etc. thus minimising noise.)
Note the following line from the logs above:
Run as-is this fails; remove the "exe:jbi" (that shouldn't be there) and it succeeds.
Stack version
Method of installation
The text was updated successfully, but these errors were encountered: