-
Notifications
You must be signed in to change notification settings - Fork 80
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
haskell_cabal_binary allow target name and executable to differ #1303
Conversation
@aherrmann is there precedent for |
Come to think of it, having an |
@mboes The problem is collision between library and executable components. Take the The approach I'm suggesting so far would be
If we want to call the binary |
Arguably binaries should go in a separate namespace, because their names could clash with a library name. I'd have,
Which is easier to remember than any mangling of the binary name. Now, you could ask, what happens if two packages export a binary with the same name? That's a situation Cabal doesn't handle well, but we can do better. For some reason that I don't remember, we chose to have
Doesn't look so nice. But how about,
Is there an issue associated to this feature, where we could continue the design discussion? |
I've created #1306 to continue the discussion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with this. However @mboes suggested an interesting discussion.
As discussed in #1306 this is required for executable support in |
@Mergifyio rebase |
Command
|
Adds an optional attribute
exe_name
tohaskell_cabal_binary
. If set then the componentexe:<exe_name>
will be built, instead of the defaultexe:<name>
. This is similar to thepackage_name
attribute forhaskell_cabal_library
.Converts
tests/haskell_cabal_package
into a test-case for this feature,tests/haskell_cabal_binary
serves as a test-case that doesn't useexe_name
.The motivation for this is to lay the ground to enable
stack_snapshot
to build executable components as well as library components. E.g. in a case likeghcide
where the target nameghcide
is already taken by the library component, the executable component cannot be calledghcide
as well.