Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Workaround a PATH/ghc issue on macOS 11 VM #642

Closed
wants to merge 1 commit into from

Conversation

quark17
Copy link
Collaborator

@quark17 quark17 commented Nov 8, 2023

Homebrew has stopped providing pre-built packages for macOS 11, so packages are built from source, which requires installing any tools needed to build the source. Thus, ghc and cabal are now being installed in /usr/local/bin, which is earlier in the PATH than the ghcup bin directory, so the wrong GHC is found. This workaround unlinks the specific ghc and cabal-install packages. Another option would be to put ghcup earlier in the PATH.

Homebrew has stopped providing pre-built packages for macOS 11, so
packages are built from source, which requires installing any tools
needed to build the source.  Thus, ghc and cabal are now being
installed in /usr/local/bin, which is earlier in the PATH than the
ghcup bin directory, so the wrong GHC is found.  This workaround
unlinks the specific ghc and cabal-install packages.  Another option
would be to put ghcup earlier in the PATH.
@quark17
Copy link
Collaborator Author

quark17 commented Nov 8, 2023

FYI, the way to prepend a directory to the path (the option that I didn't go with) is the following:

echo "$HOME/.ghcup/bin" >> $GITHUB_PATH

This affects the path seen by subsequent actions in the job; it does not change the path used by the current action.

@quark17
Copy link
Collaborator Author

quark17 commented Nov 22, 2023

This was filed as issue 8738 in the actions/runner-images repo. It has been fixed there, by unlinking ghc and cabal in the Haskell provision script for the VM (for macos11). There's no need for our workflow to execute an unlink -- the packages should remain unlinked, regardless of any additional package installs that we might do. The fixed runner is now live on GitHub, so our CI is working again without this change. So I'm closing this PR without merging.

@quark17 quark17 closed this Nov 22, 2023
@quark17 quark17 deleted the macos11-ghc-workaround branch November 22, 2023 20:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant