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

use ghcup from PATH on windows #192

Closed
wants to merge 12 commits into from
Closed

Conversation

andreasabel
Copy link
Member

  • fix access to ghcup on windows
  • remove choco

@wz1000 : I picked this PR up from your fork proactively, because Windows setup is currently broken, and it would be good to have a solution.
Would you be willing to contribute here?
Is this code from your fork something we may and should merge?

Refs:

@andreasabel andreasabel added platform: windows re: ghcup Concerning setup using ghcup labels Feb 27, 2023
@andreasabel
Copy link
Member Author

andreasabel commented Feb 27, 2023

CI suggests that with this PR, on Windows the requested version of cabal or ghc is not installed. (Just uses the preinstalled versions.)

@wz1000
Copy link
Collaborator

wz1000 commented Feb 28, 2023

It is OK for you to use this code, it seems to be working to test GHC prereleases on windows for Haskell Language Server, which is all I really intended. We may go back to using the master branch of haskell/actions once GHC 9.6 is released.

I'm really not the best person to be maintaining this, I just tried to do the minimal amount of changes to achieve the aforementioned goal. It took me quite a while to figure out how to compile the typescript to javascript.

@wz1000
Copy link
Collaborator

wz1000 commented Feb 28, 2023

CI suggests that with this PR, on Windows the requested version of cabal or ghc is not installed. (Just uses the preinstalled versions.)

Right, I can reproduce this. I will attempt to fix.

@andreasabel
Copy link
Member Author

It took me quite a while to figure out how to compile the typescript to javascript.

I rely on husky git hooks here. Making a commit triggers the magic that will do the compilation. Trying to push will run the tests.

@hazelweakly
Copy link
Collaborator

I'm somewhat biased here towards not removing chocolatey and instead leaving it as a fallback. As long as chocolatey and the ppa remain fallbacks, their codepaths will only be triggered if ghcup doesn't work, and then we can guarantee some sort of backwards compatibility.

One reason I'm interested in the backwards compatibility is that this action does work on self hosted runners and I'm sure there are likely people out there who are running it with chocolatey installed and not much else. It also gives people the opportunity to pin to some of chocolatey's special ghc versions (like ghc 8.10.2.2) which fixed a few windows+chocolatey specific stuff.

If we're using ghcup from the path, we should do so for everything else as well, but we'll also need to fall back to installing the newest version of ghcup and trying that again, in case someone has a version of ghcup that's too old for the version of ghc or cabal that they're trying to install. So the fallback in that case would be:

  1. ghcup from path
  2. ghcup internally installed by the tool
  3. other fallback option

@wz1000
Copy link
Collaborator

wz1000 commented Mar 6, 2023

@FinleyMcIlwaine and I have got this working now, please feel free to take over to restore chocolatey as fallback.

@ulysses4ever
Copy link
Contributor

It's hard to follow the discussion about GHC on Windows in GitHub virtual environments scattered over this bug tracker, but I'll offer my 2c here... There is absolutely enough to have one way to set up GHC (on Windows or otherwise). If someone wants a particular method, they should set it up themselves. Otherwise, the 95% who are not interested in other methods will have to pay with the CI time.

@andreasabel
Copy link
Member Author

Rebasing this on latest CI.
@Mergifyio rebase

@andreasabel
Copy link
Member Author

@Mergifyio rebase

@mergify
Copy link

mergify bot commented Mar 13, 2023

rebase

❌ Pull request can't be updated with latest base branch changes

Mergify needs the author permission to update the base branch of the pull request.
@wz1000 needs to authorize modification on its head branch.
err-code: FBDE7

@andreasabel
Copy link
Member Author

@wz1000 : Could you please give authorization to rebase this PR, or maybe rebase it manually? I'd like to test it with latest CI.

@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

@wz1000
Copy link
Collaborator

wz1000 commented Mar 14, 2023

I can't authorize changes to this PR because I am not the one who opened it.

@andreasabel
Copy link
Member Author

andreasabel commented Mar 15, 2023

I can't authorize changes to this PR because I am not the one who opened it.

Ah sorry, I thought this was something with your local repo (PR source).

Then maybe let's continue on:

@wz1000 You already have write access to this repo.
@FinleyMcIlwaine I invited you to this repo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform: windows re: ghcup Concerning setup using ghcup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants