haskell / actions

Github actions for Haskell CI
146 stars 54 forks source link

Non-existing cabal-install 3.10.1.1??? #280

Closed phadej closed 1 year ago

phadej commented 1 year ago
  A newer version of cabal (v3.10.1.1) is already installed.

But there isn't such version on https://hackage.haskell.org/package/cabal-install (and therefore it doesn't exist on MacOS), so

      - name: Set up Haskell
        id: setup-haskell
        uses: haskell/actions/setup@v1
        with:
          ghc-version: ${{ matrix.ghc }}
          cabal-version: '3.10.1.1'

fails on macOS.

What is this 3.10.1.1 version? @Mistuke, @Mikolaj does anyone know, what is this mixup about?


If i use 3.10.1.0, macOS job fails with

  Attempting to install cabal 3.10.1.1 using ghcup
  /Users/runner/hostedtoolcache/ghcup/0.1.17.6/x64/ghcup install cabal 3.10.1.1
  [ Warn  ] New GHCup version available: 0.1.19.4. To upgrade, run 'ghcup upgrade'
  [ Warn  ] New cabal version available. To upgrade, run 'ghcup install cabal 3.10.1.0'
  [ Warn  ] New stack version available. To upgrade, run 'ghcup install stack 2.11.1'
  [ Error ] (Unable to find a download for the requested version/distro.,
  [ ...   ]  The version 3.10.1.1 of the tool cabal is not installed.)
  [ Error ] Also check the logs in /Users/runner/.ghcup/logs

And if I use 3.10.1.0, Windows fails with:

 cabal
  By installing, you accept licenses for the packages.
  A newer version of cabal (v3.10.1.1) is already installed.
   Use --allow-downgrade or --force to attempt to install older versions.

  Chocolatey installed 0/1 packages. 1 packages failed.
   See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

  Failures
   - cabal - A newer version of cabal (v3.10.1.1) is already installed.
   Use --allow-downgrade or --force to attempt to install older versions.
  C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe choco install cabal --version 3.10.1.0 -m --no-progress -r --pre
  Installing the following packages:
  cabal
  By installing, you accept licenses for the packages.
  A newer version of cabal (v3.10.1.1) is already installed.
   Use --allow-downgrade or --force to attempt to install older versions.

  Chocolatey installed 0/1 packages. 1 packages failed.
   See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

  Failures
   - cabal - A newer version of cabal (v3.10.1.1) is already installed.
   Use --allow-downgrade or --force to attempt to install older versions.
  ::***::
phadej commented 1 year ago

A workaround seems to be to not specify cabal-install version at all and pray for getting some working one. That is not a proper solution as CI setup is way less reproducible and crucial component version may change at any moment, breaking the builds.

EDIT: In fact, I'll be somewhat happy if cabal-version: 3.8.1.0 worked, but it fails similarly as chocolatey doesn't allow the downgrade, but I said I want specific version, so it should downgrade.

Mistuke commented 1 year ago

@phadej cabal uses all 4 version triple of a version string. So when I need to Add packaging fixes, for instance when cabal broke config files i need to add a new version so I increase the minor version.

Normally actions maps the versions internally, so 3.10.1.0 will map to 3.10.1.1 and it's only a problem is people specifically ask for the bugfix version

Mistuke commented 1 year ago

Version 3.10.1.0 is DOA and shouldn't be used. Once you go to it you can't go back due to the backwards incompatible change it males to the global cabal file. 3.10.1.1 works around it by stripping the nix config changes that don't work on windows anyway

phadej commented 1 year ago

So there are two bugs:

Mistuke commented 1 year ago

The mapping should happen already, maybe your actions is old? The second one is a long standing issue that'll break with chocolatey 2.0.

Action should install cabal before ghc. That way the dependency is already satisfied by the time ghc is to be installed and it won't try to install cabal unless the version that's installed is not compatible.

So basically just flip the order

phadej commented 1 year ago

The mapping should happen already, maybe your actions is old?

Let me try @v2. I was using @v1 as it worked, and I was completely unaware of v2. There is no changelog, so I wonder what breaks.

andreasabel commented 1 year ago

I continued the tradition here to only use changelogs in association with github releases. They can be found under: https://github.com/haskell/actions/releases

phadej commented 1 year ago

I continued the tradition here to only use changelogs in association with github releases.

That is not helpful in thsi case, as v2.0.0 tag doesn't have anything in the message https://github.com/haskell/actions/releases/tag/v2.0.0 nor there are associated release.

In other words, I have no idea what changed in v2 which made then-maintainers do major version bump. Probably something substantial?

andreasabel commented 1 year ago

I suppose the bump from node 12 to 16: https://github.com/haskell/actions/compare/v1.2.11...v2.0.0 Although, for this release you get an especially bad collection of commits (which should have been squashed), this has been complained about in this issue: