Skip to content

"cabal-hls-install ghcs" does not list all ghc versions available. #2285

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

Closed
dcastro opened this issue Oct 21, 2021 · 6 comments · Fixed by #2286
Closed

"cabal-hls-install ghcs" does not list all ghc versions available. #2285

dcastro opened this issue Oct 21, 2021 · 6 comments · Fixed by #2286
Labels
CI Continuous integration old_type: distribution type: enhancement New feature or request type: support User support tickets, questions, help with setup etc.

Comments

@dcastro
Copy link

dcastro commented Oct 21, 2021

I have ghc 8.10.4 installed (through ghcup). However, when I run ./cabal-hls-install ghcs, version 8.10.4 does not show up.

Your environment

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.10.4

$ where ghc
/home/dc/.ghcup/bin/ghc
/usr/bin/ghc
/bin/ghc

Ubuntu 20.04.3 LTS.

Steps to reproduce

  1. Checked out the latest master (1119def0f94598086f5c8b23c727a40f99cdd969)
  2. Run ./cabal-hls-install ghcs.

Expected behaviour

I expected GHC 8.10.4 to be listed.

Actual behaviour

$ ./cabal-hls-install ghcs

********************************************************************************
Found the following GHC paths: 
ghc-8.6.5: /usr/bin/ghc-8.6.5
ghc-8.8.3: /home/dc/.ghcup/bin/ghc-8.8.3
ghc-8.8.4: /home/dc/.ghcup/bin/ghc-8.8.4

********************************************************************************

Build completed in 0.00s
@jneira
Copy link
Member

jneira commented Oct 21, 2021

I am afraid that we dropped support for ghc-8.10.4 so we removed stack-8.10.4.yaml and it is the source for the supported ghcs list in the script. cabal-hls-install ghcs lists the supported ghcs in path so 8.10.4 is not shown.

The message has to be improved as it should note Found the following supported GHC paths:.

Possible solutions:

  • create a dummy stack-8.10.4.yaml, it could be empty if you are not gonna use stack. If you want install with stack, copying it from another 8.10.* and change the resolver might work (maybe with some deps tweaks)
  • if you are not using a custom version of hls, it can be installed from source using ghcup: ghcup compile hls -v 1.4.0 8.10.4
  • upgrade your ghc to a hls supported version 8.10.5, 8.10.6 or 8.10.7 (recommended)

@jneira jneira added CI Continuous integration old_type: distribution type: enhancement New feature or request type: support User support tickets, questions, help with setup etc. component: install labels Oct 21, 2021
@dcastro
Copy link
Author

dcastro commented Oct 21, 2021

Ah that makes sense, thanks @jneira !

I was indeed trying to install a custom version of hls (compiled with -dynamic in order to fix the issue described in #230 and #469), so I just upgraded to ghc 8.10.7.

@dcastro
Copy link
Author

dcastro commented Oct 21, 2021

Feel free to close the issue if you see fit.

@jneira
Copy link
Member

jneira commented Oct 21, 2021

I was indeed trying to install a custom version of hls (compiled with -dynamic in order to fix the issue described in #230 and #469), so I just upgraded to ghc 8.10.7.

It is possible with ghcup:

  • create a cabal.project.dyn with
package haskell-language-server
  ghc-options: -dynamic
  • run ghcup compile hls --cabal-project-local=cabal.project.dyn -v 1.4.0 ${ghcVersion}
  • disclaimer: i've no tested it

There is even an issue about automate it: https://gitlab.haskell.org/haskell/ghcup-hs/-/issues/245

@jneira
Copy link
Member

jneira commented Oct 21, 2021

Feel free to close the issue if you see fit.

#2285 will do, thanks for report the issue!

@dcastro
Copy link
Author

dcastro commented Nov 18, 2021

Thanks @jneira, ghcup compile worked!

Just wanted to point out to future readers that the correct syntax for the --cabal-project-local option is to use a file:// scheme, and that the command is missing a --ghc option.

ghcup compile hls --cabal-project-local="file://${fullPath}>/cabal.project.dyn" -v 1.4.0 --ghc ${ghcVersion}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous integration old_type: distribution type: enhancement New feature or request type: support User support tickets, questions, help with setup etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants