Internal libraries does not work if there's no main library #3787
General summary/comments (optional)
Internal libraries does not work.
Steps to reproduce
it to build fine.
The text was updated successfully, but these errors were encountered:
I am very surprised that this would be valid. What's the point of a sublibrary if there are no executables or libraries depending on it? Does cabal-install build it?
Perhaps change the title of your issue to "internal libraries don't work if there's no main library"
Gotcha. Not sure when I'll have time to fix this. Seems like it should be a matter of finding that error message in the code and making it accept that condition. Might be tricky though, remains to be seen. Want to have a try at fixing it? PRs are appreciated!
Just a message to anyone running into this problem. This happens when you give your library a name. If your package only has one library, you should not give it a name, and it will automatically get the name from the cabal file. Giving it a name apparently makes it 'internal', which is something stack doesn't support yet apparently :)
Yeah, I think it's just a matter of removing the assumption that you'll have a main library if there are internal libraries. Not sure how to resolve this, it is not a usecase I currently care about.
I'm actually not sure why internal libraries are useful. It's for backpack, right?
@mgsloan my usecase is as follows: my package is an executable and should not export a library but I need my code to be a hidden library for my tests. I think this should be a common case.
@RyanGlScott I believe internal libraries without a main library worked for you in Stack, right? do you remember which Stack version did you use?