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

HIE is not easily usable on Manjaro Linux #1721

Open
raxod502 opened this issue Apr 4, 2020 · 4 comments
Open

HIE is not easily usable on Manjaro Linux #1721

raxod502 opened this issue Apr 4, 2020 · 4 comments

Comments

@raxod502
Copy link

raxod502 commented Apr 4, 2020

It is often rather difficult to get HIE working on Manjaro Linux, for the following reason:

  • On Manjaro Linux, the only supported versions of software are the latest versions, and partial upgrades are unsupported.
  • Because Haskell libraries are dynamically linked on Manjaro Linux and because they do not maintain any binary compatibility, a partial upgrade which involves Haskell not only is unsupported, but also makes many libraries unusable due to dynamic linking errors.
  • As a result of the first two points, it is difficult (and unsupported) to install anything except the most recent version of GHC on Manjaro Linux.
  • HIE must be built using the same version of GHC as is installed on the system. (Is this actually true? Or is it possible to tell HIE to locally install and use the version of GHC that it itself was built with, via Stack?)
  • Adding support to HIE for a new version of GHC seems to take a lot of time and manual effort.
  • As a result, whenever a new version of GHC is released, the user of Manjaro Linux must refrain from performing a system upgrade until HIE is updated, which may take a long time. Furthermore, if the user already has GHC installed and wishes to set up HIE, this may be impossible without performing some dangerous and unsupported package-management operations.

The consequence of the above points is that there is no obvious way (that I know of) to use HIE on Manjaro Linux if a new release of GHC has recently come out. This is unfortunate for users of Manjaro Linux. Is there any way that using HIE on Manjaro Linux could be made easier?

@fendor
Copy link
Collaborator

fendor commented Apr 4, 2020

  • HIE must be built using the same version of GHC as is installed on the system. (Is this actually true? Or is it possible to tell HIE to locally install and use the version of GHC that it itself was built with, via Stack?)

I think in theory it would be possible to do it via stack build but since this package is neither on hackage nor stackage, it doesnt work. We will never bring this package to hackage or stackage either. For this workflow, you can give ghcide a try which I think can be used that way.

  • As a result, whenever a new version of GHC is released, the user of Manjaro Linux must refrain from performing a system upgrade until HIE is updated, which may take a long time. Furthermore, if the user already has GHC installed and wishes to set up HIE, this may be impossible without performing some dangerous and unsupported package-management operations.

Agreed, not ideal, but not much we can do about it.

The consequence of the above points is that there is no obvious way (that I know of) to use HIE on Manjaro Linux if a new release of GHC has recently come out. This is unfortunate for users of Manjaro Linux. Is there any way that using HIE on Manjaro Linux could be made easier?

The easiest work-around is to manage dependencies yourself, use ghcup to install GHC, and then using our installation script to install hie for the GHC version you need. Or use stack to install HIE, but dont use any system dependencies, so no pacman installed GHC.

@raxod502
Copy link
Author

raxod502 commented Apr 6, 2020

I have successfully installed HIE on Manjaro Linux by following this procedure:

  • Identify all Haskell packages that are installed on the system using pacman -Q | grep haskell.
  • Uninstall all of them using pacman -Rsc, including ghc, stack, and cabal. Make a note of which packages were explicitly installed (tracing dependencies and install reasons using pacman -Qi), because we still need to use some Haskell binaries.
  • Download https://get.haskellstack.org/stable/linux-x86_64-static.tar.gz and put it in ~/.local/bin. Make it executable.
  • Run stack upgrade --force-download because for some reason the official download says it's "unsupported". This downgrades Stack and solves the warning. Maybe this step could be bypassed by using the installer script?
  • Run stack install on all the packages that I need binaries from, like pandoc, shellcheck, etc. Note that some packages have different names than you would expect, e.g. ShellCheck must be capitalized when installing via Stack.
  • Now stack exec ghc -- --version shows me that I'm using a version of GHC that is older than the latest release, so it's supported by HIE.
  • Clone the HIE source code.
  • Run stack ./install.hs hie-8.6.5 (or equivalent for whatever GHC version) and then stack ./install.hs data.
  • All binaries have been installed to ~/.local/bin and my autocompletions work.

I propose that this information (or equivalent) be put in the README under Installation on Arch Linux. It would be a great improvement since the instructions that are currently there do not actually work (as per this issue report).

@raxod502
Copy link
Author

raxod502 commented Apr 7, 2020

Just for my own edification, why is it that adding support for a new GHC release to HIE takes so much developer effort, even when the release is only a patch version?

@fendor
Copy link
Collaborator

fendor commented Apr 7, 2020

See #1697.
Test-suite fails and no one figured out why, yet.

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

2 participants