Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Add --version CLI option #106

Merged
merged 3 commits into from
Sep 23, 2019
Merged

Add --version CLI option #106

merged 3 commits into from
Sep 23, 2019

Conversation

jacg
Copy link
Contributor

@jacg jacg commented Sep 20, 2019

  • where can more precise GHC version information be found?
  • where is the single source of wisdom on ghcide version?

Closes #103.

@ndmitchell
Copy link
Collaborator

See https://downloads.haskell.org/~ghc/7.8.3/docs/html/users_guide/options-phases.html 4.12.3 for the things GHC gives you to get the version. Unfortunately it doesn't have enough info. However, there is a base version which forms a 1:1 mapping with GHC version. https://wiki.haskell.org/Base_package#Versions has a partial map, but someone seems to have forgotten to define it recently.

I suggest we add System.Info.Extra.compilerVersionFull :: Version which gives us what we need. We then propose that for addition to GHC at some point. We would build it using base versions. It's a pain since it needs updating on every point release.

@jacg
Copy link
Contributor Author

jacg commented Sep 21, 2019

So should we just merge this as is, to provide --version, and leave the more precise GHC version info for a separate PR?

@ndmitchell
Copy link
Collaborator

Makes sense, yep.

@ndmitchell
Copy link
Collaborator

I looked into adding precise GHC version in extra, but I only have the base version available, and that's insufficient as there are multiple GHC versions with the same base.

However, Cabal predefines:

#define VERSION_ghc "8.6.5"

So just using CPP should be sufficient.

@jacg jacg marked this pull request as ready for review September 22, 2019 20:17
Copy link
Collaborator

@cocreature cocreature left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, thank you!

@cocreature cocreature merged commit c24ef1c into haskell:master Sep 23, 2019
@jacg jacg deleted the version-cli-opt branch September 23, 2019 07:05
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Add --version CLI option

* Extract ghcide version from cabal

* Extract precise GHC version from cabal preprocessor macro
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Add --version CLI option

* Extract ghcide version from cabal

* Extract precise GHC version from cabal preprocessor macro
pepeiborra pushed a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
* Add --version CLI option

* Extract ghcide version from cabal

* Extract precise GHC version from cabal preprocessor macro
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No --version flag and version information is not precise
3 participants