Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

force a project type #963

Closed
teto opened this issue Nov 30, 2018 · 7 comments
Closed

force a project type #963

teto opened this issue Nov 30, 2018 · 7 comments
Milestone

Comments

@teto
Copy link

teto commented Nov 30, 2018

Using hie on nix, because there is .cabal file and/or dist/ subfolder, hie/ghc-mod will use the cabal mode which fails with import errors (for packages installed via nix, I suppose ghc-mod would expect these packages to have been installed via cabal instead). If I remove the .cabal file, hie/ghc-mod falls back "to plain GHC project" which works.
My problem is that I use haskdogs to generate haskell tags and this needs the cabal file to work. Thus I would like to force hie to use a "plain GHC project" but I don't know how.

@benkolera
Copy link
Contributor

benkolera commented Dec 1, 2018 via email

@alanz
Copy link
Collaborator

alanz commented Dec 1, 2018

This is something I have considered doing for a while now, especially on hie itself where you are working with multiple stack.yaml files and need to be able to specify a particular one. Or sometimes testing stack, sometimes new-build, etc,

@teto
Copy link
Author

teto commented Dec 6, 2018

@benkolera I might have had a discrepancy between my cabal file and what was installed via nix as I was experimenting.
Anyway it seems like I always have some kind of missing import as in
import qualified Data.Map as Map => daemon.hs|34 col 1 error| Could not find module ‘Data.Map’ Use -v to see a list of the files searched for.

I added
exposed-modules: Data.ByteString
to my cabal file and it seems to make the error disappear.

@alanz alanz added this to the 2019-01 milestone Dec 24, 2018
@alanz alanz modified the milestones: 2019-01, 2019-02 Feb 2, 2019
@alanz alanz modified the milestones: 2019-02, 2019-03 Mar 2, 2019
@alanz alanz modified the milestones: 2019-03, 2019-04 Apr 6, 2019
@alanz alanz modified the milestones: 2019-04, 2019-05 May 4, 2019
@alanz alanz modified the milestones: 2019-05, 2019-06 Jun 1, 2019
@colonelpanic8
Copy link
Contributor

@alanz I'd like to add this, but what is the preferred approach here? Should it be a cl flag? What should be provided with the flag? Compiler version to use? Whether or not to use slack?

@colonelpanic8
Copy link
Contributor

@alanz ping.

In #942 you write:

Closing in favour of #963 which is a more general solution

but this issue doesn't really seem to describe any particular solution. It seems like having

--with-compiler and --stack-yaml flags seems like about as good as a solution as one could hope for.

It might also be nice to have something like a --default-ghc to explicitly override stack usage without needing to specify the compiler.

@jneira
Copy link
Member

jneira commented Jan 14, 2020

Now hie has the option to force using one build tool using explicit hie.yaml files: https://github.com/haskell/haskell-ide-engine#configuration
An there is an issue about forcing it with a cli arg: #1432

@jneira jneira closed this as completed Jan 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants