Closed andreasabel closed 1 year ago
@sol Thanks for the pointer! (Which makes me think why I am maintaining another setup action; maybe it is more general by allowing to pick a cabal
or stack
version, but I am not sure how useful this is; I do need the output cabal-store
, though, how do you get the value of this in your workflows?)
You seem to have solved the same problems, and in a nice way; I was thinking of using the https://www.npmjs.com/package/compare-versions library for comparing versions, and maybe also its satisfies
function, so that one could also write ghc-version: >= 9.4
etc.
@sol Thanks for the pointer! (Which makes me think why I am maintaining another setup action; maybe it is more general by allowing to pick a
cabal
orstack
version, but I am not sure how useful this is
It's possible to install what you need with ghcup
directly (I think @hasufell has made this point elsewhere before).
The main reason why I rolled my own back then was that I needed old versions of GHC that need to be apt install
ed + that this was notoriously broken here.
That, and the fact that this repo includes multiple actions, which is broken in its own way (not only can't you publish anything to the marketplace, but it also makes it hard to version those actions independently).
the output
cabal-store
, though, how do you get the value of this in your workflows?
As of now, I do set it manually (https://github.com/sol/hpack/blob/21480fd93c0538bf010bff1bc6d6f9d2f19f8653/.github/workflows/build.yml#L51), which is not ideal.
so that one could also write
ghc-version: >= 9.4
Given that the runner images already provide the latest version of GHC (which satisfies constraints of that form), I am puzzled when you would actually need something like this.
Say the user requests stack-version: 2.1 this will atm resolve to 2.1.3
ghcup install stack 2.9
already works.
However, once we add stack version
2.11.1
,
Sooner than expected, the calamity strikes us: https://discourse.haskell.org/t/ann-stack-2-11-1/6287
Trying to add stack 2.11.1
breaks the internal testsuite.
Expected: "2.1.3"
Received: "2.11.1"
Great to have the testsuite!
https://github.com/haskell/actions/blob/1c618fb42f876960599b42b9d385fc7af930cafb/setup/src/opts.ts#L97-L99
Say the user requests
stack-version: 2.1
this will atm resolve to2.1.3
, according to the action's current consciousness about versions: https://github.com/haskell/actions/blob/1c618fb42f876960599b42b9d385fc7af930cafb/setup/src/versions.json#L53-L63However, once we add stack version
2.11.1
, requesting2.1
will resolve to2.11.1
. Ooops!I suppose the proper ("Haskell") way to fix this to use a datatype for versions rather than mocking around with strings.