Skip to content
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

prefer cabal when there is a cabal.project.{local, freeze} #10

Closed
fommil opened this issue Jul 4, 2019 · 6 comments
Closed

prefer cabal when there is a cabal.project.{local, freeze} #10

fommil opened this issue Jul 4, 2019 · 6 comments

Comments

@fommil
Copy link

fommil commented Jul 4, 2019

I propose that cabal-install be the preferred backend if there is a cabal.project.local or cabal.project.freeze file, even if there is a stack.yaml, as this implies that the user has taken steps to prefer cabal.

Generally it would be good to allow the user to provide an envvar to choose the preference when there is ambiguity. e.g. many simple projects have a stack.yaml because somebody requested it. An envvar might just be the simplest option all around instead of getting into complex rules.

@mpickering
Copy link
Collaborator

A configuration file should be specified if the automatic configuration fails. The cabal configuration is ranked below the other configuration options as cabal has the worst support for working out which component you need to start the repl (ie, there's no way to map a filepath to a component). If you use cabal it is likely you have to specify a config file anyway to specify the right component.

@fommil
Copy link
Author

fommil commented Jul 4, 2019

I assume you've seen http://hackage.haskell.org/package/cabal-helper ?

@mpickering
Copy link
Collaborator

Yes, cabal-helper needs to be integrated into hie-bios but hie-bios was created to avoid depending on only cabal-helper.

@fommil
Copy link
Author

fommil commented Jul 4, 2019

btw my usecase is for the batch compiler not the repl. I would like to be able to launch tools that have access to ghc-lib (i.e. to see .hi files, source code bases, and in the future .hie files).

@fommil
Copy link
Author

fommil commented Aug 9, 2019

there's no way to map a filepath to a component

I'm confused about this. Cabal is available with every ghc installation and, given a file, it's a matter of looking up the corresponding .cabal (and possibly cabal.project{.local}) and build plan and then doing some library calls.

Admitedly this is not readily available as a single command but it's certainly doable without leaving the land of Haskell. Are there problems beyond this that you can see?

@mpickering
Copy link
Collaborator

Yes. The guiding principal behind hie-bios is to not link against any specific library. This shifts the responsibility for describing the right environment to the build tool rather than the tooling author.

Anyone can write their own tool using whatever libraries they like and provide a suitable command line interface to query.

@fommil fommil closed this as completed Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants