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

Support GHC 9.2 #55

Closed
raehik opened this issue Apr 28, 2021 · 6 comments
Closed

Support GHC 9.2 #55

raehik opened this issue Apr 28, 2021 · 6 comments

Comments

@raehik
Copy link

raehik commented Apr 28, 2021

I noticed alpha releases of GHC 9.2 are rolling out. I use haskell/actions/setup for the hugely convenient setup it does. I was wondering whether I could use it to test 9.2 releases as well, so I had a go.

I tried adding it to my CI's GHC versions list, but the setup step fails. However, not before appearing to work (after falling back to ghcup). Here is the relevant part of a build log. (also copied below)

  Attempting to install ghc 9.2 using apt-get
  /usr/bin/sudo -- sh -c apt-get -y install ghc-9.2
  Reading package lists...
  Building dependency tree...
  Reading state information...
  E: Unable to locate package ghc-9.2
  E: Couldn't find any package by glob 'ghc-9.2'
  E: Couldn't find any package by regex 'ghc-9.2'
  Attempting to install ghc 9.2 using ghcup
  /opt/hostedtoolcache/ghcup/0.1.12/x64/ghcup install ghc 9.2
  [ Warn  ] New GHCup version available: 0.1.14.1. To upgrade, run 'ghcup upgrade'
  [ Info  ] downloading: https://downloads.haskell.org/~ghc/9.2.1-alpha2/ghc-9.2.0.20210422-x86_64-fedora27-linux.tar.xz
[snip]
  [ Info  ] verifying digest of: ghc-9.2.0.20210422-x86_64-fedora27-linux.tar.xz
  [ Info  ] Unpacking: ghc-9.2.0.20210422-x86_64-fedora27-linux.tar.xz to /tmp/ghcup-leiEoM
  [ Info  ] Installing GHC (this may take a while)
  [ Info  ] GHC installation successful
  /opt/hostedtoolcache/ghcup/0.1.12/x64/ghcup set ghc 9.2
  [ Warn  ] New GHCup version available: 0.1.14.1. To upgrade, run 'ghcup upgrade'
  [ Info  ] GHC 9.2.0.20210422 successfully set as default version
Error: All install methods for ghc 9.2 failed

GHC 9.2 appears to be successfully installed and set as default through ghcup, but the step then ends with an error. Is this intended? The only questionable thing I see is downloading the Fedora version while it's running Ubuntu, but I don't imagine any issues there.

@raehik
Copy link
Author

raehik commented May 27, 2021

I think the problem is isInstalled() not checking where ghcup is placing the installation. I can't see any ghcup-related tests on the CI workflow file. How does one go about testing a CI project (with a shell)?

@hazelweakly
Copy link
Collaborator

It checks ghcup and all other installs by pre-computing the path and checking that a binary exists there. This unfortunately assumes that GHC is named predictably, which for the alphas is not the case (eg ghcup install 9.2 gives you ghc-9.2.0.20210422)

It should theoretically be possible to be more dynamic with this by looking for ghc-9.2.0* but I'd have to do more investigation there.

The reason knowing the path is necessary is because I don't have a consistent way to query it's location in order to add it to github's env file. Particularly across multiple tools (chocolatey, ghcup, apt, etc) and multiple operating systems.

It's a bit difficult to make minimal assumptions yet still be quick in the happy path case, which are both things that are very important for keeping CI times and costs down :)


Long story short is I'm definitely open to the idea of being able to support alpha versions of ghc (which basically amounts to being more dynamic in figuring out the installed path, I believe)

@raehik
Copy link
Author

raehik commented Jun 14, 2021

I see, thanks. I don't think I'll have a go at it, not that keen on setting up a local CI environment and GHC 9.2 will get a release candidate sooner or later. Cheers for clearing up the situation.

@chris-martin
Copy link

chris-martin commented Sep 26, 2021

I think having Actions support for pre-releases could go a long way toward helping library maintainers get new base versions supported in a timely manner. If the purpose of release candidates is to get people testing them, then people need to be able to install it to test with it.

@larskuhtz
Copy link

larskuhtz#1 implements experimental support for ghc-9.2. It's a bit hacky, but works for me.

@hazelweakly
Copy link
Collaborator

As of November 7, chocolatey has GHC 9.2, so I can finally release 9.2 into the wild. Should "just work", now.

The next big update for this action, I suspect, is going to be finalizing integration with the preinstalled ghcup for Windows and using ghcup by default for stack, ghc, and cabal installs, falling back to chocolatey and/or the old PPA only when necessary.

But for now, 9.2.1 works. Have fun :)

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

4 participants