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

use ghcup on windows (clone of #192) #206

Merged
merged 19 commits into from
May 1, 2023
Merged

use ghcup on windows (clone of #192) #206

merged 19 commits into from
May 1, 2023

Conversation

andreasabel
Copy link
Member

@andreasabel andreasabel commented Mar 13, 2023

Rebased clone of #192 to run latest CI.

Please also consider the discussion at #192.

TODO (correctness):

TODO (features):

  • Bring back choco install method (by option and/or as fallback). E.g. we could have an input setup-method which is a list of install methods that are tried in order (if available for that platform). The default could be for now setup-method: [ghcup, choco, apt], but one could opt out of fallback by e.g. just setup-method: [ghcup].
    (Bikeshedding: method, install-method.)

Closes #70. Closes #97. Closes #112. Closes #191.

@andreasabel
Copy link
Member Author

andreasabel commented Mar 14, 2023

Atm, this PR also seems to destroy the apt installation method (fallback on linux): https://github.com/haskell/actions/actions/runs/4410084290/jobs/7727167607#step:3:146
We might give up apt soon when ubuntu-18.04 is removed at the end of the month:

Ubuntu-20.04 will only support a few legacy GHCs: relevant are 7.4.2 7.2.2 7.0.4 (and maybe 7.10.3). https://launchpad.net/~hvr/+archive/ubuntu/ghc?field.series_filter=focal

@andreasabel andreasabel added platform: windows re: ghcup Concerning setup using ghcup labels Mar 14, 2023
@andreasabel andreasabel marked this pull request as draft March 14, 2023 08:16
@andreasabel
Copy link
Member Author

Windows CI with cabal 3.0 and 3.2 fails with error cabal: symlinking feature not available on Windows. Not sure if this should be fixed in ghcup or whether the setup action needs to work around this problem.

@andreasabel andreasabel changed the title use ghcup from PATH on windows (clone of #192) use ghcup on windows (clone of #192) Mar 15, 2023
@andreasabel andreasabel added the help wanted Extra attention is needed label Mar 23, 2023
@ulysses4ever
Copy link
Contributor

The symlinking issue has a long history on cabal bugtracker (e.g. haskell/cabal#5748). Chocolatey fixes it here: https://github.com/Mistuke/CabalChoco/blob/656b693745acd0f91d2ef06b3ecfb2ab9051d65d/3.2.0.0/cabal/tools/chocolateyInstall.ps1#L286 If ghcup doesn't include the same fix, then either the action has to include it (it's simply a matter of cabal user-config update -a "install-method: copy") or just stop trying to fix this issue. I'm not sure how useful it is to support/patch earlier cabal-installs, so the second option doesn't sound too bad to me.

@andreasabel
Copy link
Member Author

haskell/cabal#5870

@ulysses4ever wrote

(it's simply a matter of cabal user-config update -a "install-method: copy")

Thanks for the pointers. It seems that these config file settings are available since cabal 3.2.0.0 only:

So it is good to test relevant cabal versions on Windows (3.0, 3.2). Added to CI.

@ulysses4ever
Copy link
Contributor

Good to see the progress here, thank you.

More generally, I wanted to share a doubt I was contemplating over the weekend after I learned a bit about the CabalChoco/GhcChoco repos. It looks like supporting Windows required a lot of downstream patching. The fact that CI caught the symlinking issue may be a sheer luck, and more issues may go unnoticed until the switch from Chocolatey to ghcup goes public. So, maybe the change in its current form is a bit radical. Maybe something more cautious like switching to ghcup only when newer cabals are requested (e.g. starting from 3.10 or something). It may also be easier to convince the ghcup maintainer to patch new releases when/if such a need pops up than it is for old releases.

This is just some rough thought, and it's up to the maintainers of respective facilities to decide, of course.

@andreasabel andreasabel marked this pull request as ready for review April 27, 2023 19:47
@andreasabel
Copy link
Member Author

I brought back Choco as default, for the sake of backwards compatibility.
CI passes, but I have some regression in the wild that could be caused by switching to ghcup:

@andreasabel andreasabel mentioned this pull request Apr 30, 2023
2 tasks
@andreasabel andreasabel self-assigned this May 1, 2023
@andreasabel andreasabel added this to the 2.3.8 milestone May 1, 2023
@andreasabel andreasabel merged commit b9ef230 into main May 1, 2023
@andreasabel andreasabel deleted the wz1000-ghcup branch May 1, 2023 18:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed platform: windows pr: squash-me re: ghcup Concerning setup using ghcup
Projects
None yet
4 participants