You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 5, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Jan 5, 2024. It is now read-only.
This will fail on windows only, because 8.10.7 isn't in choco yet. It's quite confusing, because different installers with different release schedules are used under the hood.
I think the windows images from GitHub still use chocolatey under the hood, so I would still default to that (for fastest setup time in the cloud), but I'm looking forward to being able to fall back to ghcup on Windows and possibly even switch to using it first if the action images start using ghcup for windows too.
PRs are more than welcome for the functionality, but otherwise I'll try to get around to it when time permits over the next few weeks :)
(Edit: in case it wasn't clear, I deeply appreciate the windows support in ghcup. It's something I've been looking forward to for a long time and I'm super stoked about it. Thanks for all your work in the Haskell tooling space!)
linux/macos uses the package manager (ppa/hvr) for ghc and ghcup for cabal, it seems the ghc installed by ghcup is bigger than the other one (???):
I'm not sure how that's relevant to the windows discussion?
(The reason is that the apt repository has debug symbols and documentation separate. The GHC build system doesn't allow that split. It has to be done manually.)
Well if linux/macos already would use ghcup for ghc (even as fallback) it would be more appealing for gha unify all the three os's through ghcup
I don't understand. I thought haskell/actions already does use ghcup for linux and mac. I have no idea about actions/virtual-environments and currently don't have plans to use it. This ticket is about this action only.
hmm actions/virtual-environments are the actual vms where gha (so haskell/actions) are being run. Afaik (maybe @jared-w could correct me if i am wrong) those vms have already installed the haskell toolchain and haskell/actions does a fallback over such preinstalled toolchain (as it can be obsolete for some time)
hmm actions/virtual-environments are the actual vms where gha (so haskell/actions) are being run.
Ah. I wasn't aware. Well, then my suggestion is to simply tell ghcup where the pre-installed msys2 is. Then the installation will take only a couple of seconds.
Also it does not install all ghc versions, only 2 latest Haskell Major.Minor versions so haskell/action installs the other ones if requested. But the build would be faster if you use the preinstalled ones and they will be more up to date if they use ghcup :-)
Also worth considering that Chocolatey is fairly unreliable. For example, I just witnessed this failure on Windows:
Run haskell/actions/setup@v1
Preparing to setup a Haskell environment
Installing ghc version 8.10.4
Attempting to install ghc 8.10.4 using chocolatey
::stop-commands::SetupHaskellStopCommands
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe choco install ghc --version 8.10.4 -m --no-progress -r
Installing the following packages:
ghc
By installing you accept licenses for the packages.
[NuGet] Could not connect to the feed specified at 'https://community.chocolatey.org/api/v2/'. Please verify that the package source (located in the Package Manager Settings) is valid and ensure your network connectivity.
ghc not installed. An error occurred during installation:
Unable to resolve dependency 'cabal (≥ 3.2.0.0)'.
ghc package files install completed. Performing other installation steps.
The install of ghc was NOT successful.
ghc not installed. An error occurred during installation:
Unable to resolve dependency 'cabal (≥ 3.2.0.0)'.
Chocolatey installed 0/1 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Failures
- ghc (exited 1) - ghc not installed. An error occurred during installation:
Unable to resolve dependency 'cabal (≥ 3.2.0.0)'.
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe choco install ghc --version 8.10.4 -m --no-progress -r --pre
Installing the following packages:
ghc
By installing you accept licenses for the packages.
ghc not installed. An error occurred during installation:
The operation has timed out
ghc package files install completed. Performing other installation steps.
The install of ghc was NOT successful.
ghc not installed. An error occurred during installation:
The operation has timed out
Chocolatey installed 0/1 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Failures
- ghc (exited 1) - ghc not installed. An error occurred during installation:
The operation has timed out
::SetupHaskellStopCommands::
Error: All install methods for ghc 8.10.4 failed
I still think use ghcup in this action would make sense. You can also use chocolatey or hvr/ppa outside this action but it allows workflows abstract away from the concrete channels and the future changes in them.
It will make handling across all os's more uniform.
This CI does not demonstrate caching of dependencies. How do communicate the cabal store directory in a stable way without setup-haskell?
This would be a typical caching phase:
It seems to me that the incoming cabal status could give that info: haskell/cabal#7500
An usual workaround is tell cabal use a specific store dir, changing the global config using cabal init and use that specific path in the cache step. Not ideal but you have to do it for windows anyways to workaround the max path length issue.
This CI does not demonstrate caching of dependencies. How do communicate the cabal store directory in a stable way without setup-haskell? This would be a typical caching phase:
Activity
hasufell commentedon Aug 30, 2021
Here's an example workflow:
hazelweakly commentedon Sep 1, 2021
I think the windows images from GitHub still use chocolatey under the hood, so I would still default to that (for fastest setup time in the cloud), but I'm looking forward to being able to fall back to ghcup on Windows and possibly even switch to using it first if the action images start using ghcup for windows too.
PRs are more than welcome for the functionality, but otherwise I'll try to get around to it when time permits over the next few weeks :)
(Edit: in case it wasn't clear, I deeply appreciate the windows support in ghcup. It's something I've been looking forward to for a long time and I'm super stoked about it. Thanks for all your work in the Haskell tooling space!)
hasufell commentedon Sep 1, 2021
Good point. I timed that and from my tests ghcup is twice as fast: https://github.com/hasufell/shortbytestring/runs/3487178253?check_suite_focus=true#step:3:1
Takes 2m5s and installs ghcup, cabal, ghc and msys2
Takes 3m59s and installs cabal, ghc and msys2
Does the haskell action do anything different that would make chocolatey faster?
jneira commentedon Sep 3, 2021
confirmed: https://github.com/actions/virtual-environments/blob/main/images/win/scripts/Installers/Install-Haskell.ps1
linux/macos uses the package manager (ppa/hvr) for ghc and ghcup for cabal, it seems the ghc installed by ghcup is bigger than the other one (???):
https://github.com/actions/virtual-environments/blob/ec9ac010f114131adacb246cf87c8127c19aa0d9/images/linux/scripts/installers/haskell.sh#L33
I think @maerwald will find that interesting 😉
hasufell commentedon Sep 3, 2021
I'm not sure how that's relevant to the windows discussion?
(The reason is that the apt repository has debug symbols and documentation separate. The GHC build system doesn't allow that split. It has to be done manually.)
jneira commentedon Sep 3, 2021
Well if linux/macos already would use ghcup for ghc (even as fallback) it would be more appealing for gha unify all the three os's through ghcup
jneira commentedon Sep 3, 2021
In fact upstreaming the actual haskell actions ghc/cabal/stack setup logic to gha vms would be great by itself
hasufell commentedon Sep 3, 2021
I don't understand. I thought
haskell/actionsalready does use ghcup for linux and mac. I have no idea aboutactions/virtual-environmentsand currently don't have plans to use it. This ticket is about this action only.jneira commentedon Sep 3, 2021
hmm
actions/virtual-environmentsare the actual vms where gha (sohaskell/actions) are being run. Afaik (maybe @jared-w could correct me if i am wrong) those vms have already installed the haskell toolchain andhaskell/actionsdoes a fallback over such preinstalled toolchain (as it can be obsolete for some time)but yeah we can ignore upstream 🙂
hasufell commentedon Sep 3, 2021
Ah. I wasn't aware. Well, then my suggestion is to simply tell ghcup where the pre-installed msys2 is. Then the installation will take only a couple of seconds.
jneira commentedon Sep 3, 2021
Also it does not install all ghc versions, only
2 latest Haskell Major.Minor versionsso haskell/action installs the other ones if requested. But the build would be faster if you use the preinstalled ones and they will be more up to date if they use ghcup :-)hasufell commentedon Sep 3, 2021
So we can use the pre-installed msys2 via:
This takes 15 seconds to install ghcup: https://github.com/hasufell/shortbytestring/runs/3506845639?check_suite_focus=true#step:3:1
hasufell commentedon Sep 3, 2021
actions/runner-images#4016
newhoggy commentedon Sep 5, 2021
Also worth considering that Chocolatey is fairly unreliable. For example, I just witnessed this failure on Windows:
Reliability trumps installation speed in CI.
jneira commentedon Sep 5, 2021
yeah in hls we experienced that issue with choco lately 😕
21 remaining items
jneira commentedon Mar 10, 2022
I still think use ghcup in this action would make sense. You can also use chocolatey or hvr/ppa outside this action but it allows workflows abstract away from the concrete channels and the future changes in them.
It will make handling across all os's more uniform.
andreasabel commentedon Mar 15, 2022
@hasufell
This CI does not demonstrate caching of dependencies. How do communicate the cabal store directory in a stable way without
setup-haskell?This would be a typical caching phase:
newhoggy commentedon Mar 15, 2022
I feel like
cabalshould have a command to print where the cabal store is since it already knows where it is.andreasabel commentedon Mar 15, 2022
Is there already a cabal issue for this? If not please report, linking here!
jneira commentedon Mar 15, 2022
It seems to me that the incoming
cabal statuscould give that info: haskell/cabal#7500An usual workaround is tell cabal use a specific store dir, changing the global config using
cabal initand use that specific path in the cache step. Not ideal but you have to do it for windows anyways to workaround the max path length issue.https://github.com/haskell/cabal/blob/906a8bcabc307c6c607cf1b9826a6b329e3ceb7f/.github/workflows/windows.yml#L37
However chocolatey already sets the store dir in C:\sr and ghcup in X:\cabal\store and the setup action gives it to you.
hasufell commentedon Mar 15, 2022
I would actually suggest using https://github.com/haskell-works/cabal-cache ...it allows syncing to a directory (instead of S3). Then you would tell
actions/cache@v2to just cache that directory. That may also save some cache space, because it only caches the needed libraries from the resolution.I can code up an example if I have a bit more time.
andreasabel commentedon Feb 18, 2023
Work on this is going on in a fork: main...wz1000:actions:wip/783
andreasabel commentedon Mar 23, 2023
WIP PR: