Open alanz opened 4 years ago
See sample files in https://github.com/haskell/haskell-ide-engine/pull/1533
Is there any specification for both of these formats?
I suspect it is a case of reading the code. Best case is it will be in the documentation, but I am not holding my breath.
Couldn't find it in the documentation but relevant code can be found here (stack, cabal). From what I understand, a stack build target can be specified in these ways:
package_name
package_name_with_version
:component_name
package_name:lib
package_name:[test|bench|exe]:component_name
while cabal uses the following syntax:
component_name
component_kind:component_name
component_name:module_or_file_name
component_kind:component_name:module_or_file_name
component_name
that was written for a cabal cradle and we change it to stack. In that case, we can't decide if we want to interpret it as package_name
or :component_name
(user wants this).@sureyeaah nice resume, i will use for reference too 😄
For completeness, i think that component_kind
== [lib|test|bench|exe]
@jneira thanks, would be great to document this somewhere. I could share this via a blog post maybe after I understand it more. Also Cabal lets you use the component kind "flib" for foreign libraries IIUC.
Well, it is documented but it seems it is not easily discoverable:
Also Cabal lets you use the component kind "flib" for foreign libraries IIUC
Oh yeah i forgot them (i've never used them)
It's good to document this but I'm still not convinced it's something which needs to be "fixed" in the library.
I'd rather it was fixed in stack/cabal, but given how easy it is to shim between them, seems useful to have in hie-bios so people can experiment with stack/cabal quickly without running into the obvious bug.
@jneira I should have searched the docs a bit better. Still got to read some code :)
Well, at least some validation would be great ("you are using wrong syntax for targets, see [link] of [build-tool] for reference"), even if translation ends up being tricky
The hie-bios README gives the following two examples
They are both referring to the library component in
haskell-ide-engine
, but stack and cabal have different naming conventions for them.If I have a complex multi-cradle, such as
I would ideally like to just replace
stack
withcabal
on the second line and have it continue to work.Can we do some kind of implicit name translation for this case?