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

Does not use apt-get installed GHCs #80

Closed
sol opened this issue Nov 4, 2021 · 2 comments · Fixed by #83
Closed

Does not use apt-get installed GHCs #80

sol opened this issue Nov 4, 2021 · 2 comments · Fixed by #83

Comments

@sol
Copy link
Member

sol commented Nov 4, 2021

Here is a repro:

jobs:
  build:
    runs-on: ubuntu-18.04
    steps:
      - uses: actions/checkout@v2
      - uses: haskell/actions/setup@v1
        with:
          cabal-version: '3.4'
          ghc-version: '7.4.1'
      - run: ghc --version
@hazelweakly
Copy link
Collaborator

Oh this one is fun. Here's what's happening.

  1. First the action installs GHC (from the ppa) and adds it to the path.
  2. Then it installs cabal from ghcup, and adds it to the path.

The path looks like your-cabal-location:your-ghc-location:$PATH. But the problem is that ghcup installs cabal by default to ~/.ghcup/bin which contains... preinstalled GHCs for github actions. So ~/.ghcup/bin/ghc is v9.2.1 because that's what the github action runners installed last.

(This didn't come up before because almost always cabal and ghc come from the same source). I'll have to see if I can figure out an order-independent way to resolve this. I think the solution is going to be (for now) that I unset a few known things, but I'll have to be careful to not break stuff that's manually/pre-installed :)

@ncaq
Copy link

ncaq commented Nov 10, 2021

I had the same problem too.
My solution was to run the following command before setup.

- run: sudo rm -rf ~/.ghcup/bin/

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 a pull request may close this issue.

3 participants