haskell-actions / haskell-actions/setup

Does this action reuse pre-installed versions of GHC and Cabal?

Open
#119 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
91
Forks
21
PR merge metrics
No merged PRs in 30d

Description

The README says:

The GitHub runners come with pre-installed versions of GHC and Cabal. Those will be used whenever possible.

But check out this workflow run:

Run cabal --version
  
cabal-install version 3.14.1.1
compiled using version 3.14.1.1 of the Cabal library

but

Resolved cabal latest to 3.14.1.1
Preparing ghc environment
Installing ghc version 9.8.4
Preparing cabal environment
Installing cabal version 3.14.1.1
  /opt/hostedtoolcache/ghcup/0.1.50.1/x64/ghcup whereis cabal 3.14.1.1
  [ Error ] [
  Attempting to access tool cabal at location /opt/cabal/3.14/bin
  Failed to access tool cabal at location /opt/cabal/3.14/bin
  Attempting to access tool cabal at location /home/runner/.ghcup/bin
  Succeeded accessing tool cabal at location /home/runner/.ghcup/bin
  /opt/hostedtoolcache/ghcup/0.1.50.1/x64/ghcup set cabal 3.14.1.1
  [ Error ] [
  /opt/hostedtoolcache/ghcup/0.1.50.1/x64/ghcup unset cabal
  [ Info  ] Cabal successfully unset
  Attempting to install cabal 3.14.1.1 using ghcup
  /opt/hostedtoolcache/ghcup/0.1.50.1/x64/ghcup install cabal 3.14.1.1
  [ Info  ] downloading: https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal/3.14.1.1/cabal-install-3.14.1.1-x86_64-linux-ubuntu22.04.tar.xz as file /usr/local/.ghcup/tmp/ghcup-4e6b75f5cebe0ee4/cabal-install-3.14.1.1-x86_64-linux-ubuntu22.04.tar.xz

It appears that the requested version match the pre-installed version, but then ghcup is still downloading and re-installing the same Cabal version. Am I reading this wrong? Or is this possibly a bug?

Workflow file (not quite minimal)
name: CI

on:
  push:
  pull_request:

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        ghc: ["9.4.8", "9.6.6", "9.8.4"]
        os: [ubuntu-22.04]
      # complete all jobs
      fail-fast: false
    name: GREASE - GHC v${{ matrix.ghc }}
    steps:
    - run: cabal --version

    - uses: haskell-actions/setup@v2
      with:
        ghc-version: ${{ matrix.ghc }}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the README section describing pre-installed GHC and Cabal versions, then inspect the linked workflow run and its setup step. Determine why ghcup downloads Cabal 3.14.1.1 despite that version appearing available, and document whether the behavior is expected or indicates a setup bug.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, haskell
Domain
build-system, ci-cd
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.