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

Consider including GHC version in executable name #23

Open
seagreen opened this issue Mar 20, 2019 · 2 comments
Open

Consider including GHC version in executable name #23

seagreen opened this issue Mar 20, 2019 · 2 comments
Assignees

Comments

@seagreen
Copy link
Contributor

My understanding is that the GHC version used to build haskell-code-explorer needs to match the GHC version of the project you're indexing (eg see #16 (comment)).

This wasn't initially clear to me when initially trying to get haskell-code-indexer working, and using a haskell-code-indexer built with the wrong version of GHC lead to confusing error messages, eg

2019-03-20 17:18:19.736738839 EDT : [error] Error while indexing component li
KSLx7jSwdIM:
    MonadRandom-0.5.1.1-9vmCiRoafqTKSLx7jSwdIM is unusable due to missing dep
      primitive-0.6.4.0-1mvPxVOk6Q6KOkWCZxqESf transformers-0.5.5.0 transform
    (use -v for more information)

Because of this, would it make sense to adopt Haskell IDE Engine's convention for executable naming? They append each executable with the GHC version used to build it, eg:

$ ls hie*
hie      hie-8.2.1  hie-8.4    hie-8.4.3  hie-8.6    hie-8.6.2
hie-8.2  hie-8.2.2  hie-8.4.2  hie-8.4.4  hie-8.6.1  hie-wrapper

As you can see they also build one version of hie without the GHC version appended, but I'm not sure we even need that.

This would also make it really easy to have lots of different versions of haskell-code-indexer on your machine at once.

@alexwl
Copy link
Owner

alexwl commented Mar 22, 2019

My understanding is that the GHC version used to build haskell-code-explorer needs to match the GHC version of the project you're indexing

That's correct. It should be mentioned in the README (I will update it).

Currently, haskell-code-indexer doesn't check if its version of GHC matches the version that was used to build the project you're indexing. As a result of this, GHC version mismatch causes GHC itself to fail with an unhelpful error message (the message "*** is unusable due to missing dependencies" comes from the GHC: https://github.com/ghc/ghc/blob/610ec224a49e092c802a336570fd9613ea15ef3c/compiler/main/Packages.hs#L1164).

I will implement a GHC version check in haskell-code-indexer. It should be simple because the first line of the setup-config file from the dist directory of each Cabal package contains the version of GHC, e.g., "Saved package config for haskell-code-explorer-0.1.0.0 written by Cabal-2.4.0.1 using ghc-8.6".

I agree it makes sense to adopt Haskell IDE Engine's convention for executable naming.

@seagreen
Copy link
Contributor Author

Executables with GHC version appended merged in #29

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