Skip to content

Comments

Allow using msys2 instead of cygwin#857

Open
tobil4sk wants to merge 7 commits intoocaml:masterfrom
tobil4sk:feature/msys2
Open

Allow using msys2 instead of cygwin#857
tobil4sk wants to merge 7 commits intoocaml:masterfrom
tobil4sk:feature/msys2

Conversation

@tobil4sk
Copy link
Contributor

@tobil4sk tobil4sk commented Sep 5, 2024

This patch provides support for using msys2 instead of cygwin as the environment for windows. It can be enabled with:

with:
  windows-environment: msys2

Otherwise, it still defaults to cygwin.

It will use the msys2 installation specified as follows:

  1. The one specified by the MSYS2_ROOT environment variable
  2. If pacman is present in PATH, it will use the installation that the pacman binary belongs to.
  3. Finally, if neither of those exist, then it uses the default installation path: C:\msys64 (available in the windows image for github actions: https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md#msys2).

It does not cache the msys2 install, but it should be possible for setup-msys2 to handle that: https://github.com/msys2/setup-msys2.

This closes #846.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • .github/workflows/workflow.yml: Evaluated as low risk
  • action.yml: Evaluated as low risk
Comments suppressed due to low confidence (2)

packages/setup-ocaml/src/constants.ts:101

  • The error message 'unrecognized value for windows-environment' could be more descriptive. Consider specifying the acceptable values, e.g., 'Unrecognized value for windows-environment. Accepted values are "cygwin" or "msys2".'
core.error("unrecognized value for windows-environment");

packages/setup-ocaml/src/constants.ts:89

  • Ensure that the new behavior introduced by the 'WINDOWS_ENVIRONMENT' constant is covered by tests.
export const WINDOWS_ENVIRONMENT: "cygwin" | "msys2" = (() => {

tobil4sk and others added 2 commits January 1, 2025 13:06
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Halbaroth
Copy link

This PR was submitted over a year ago. Is there a reason why it hasn't been merged yet?

elefthei pushed a commit to FStarLang/FStar that referenced this pull request Feb 3, 2026
The ocaml/setup-ocaml action has a hardcoded Cygwin mirror
(mirrors.kernel.org) that frequently fails with connection errors
(12002) and signature verification failures from GitHub Actions' IPs.

Switch to MSYS2 using:
1. msys2/setup-msys2@v2 to set up the MSYS2 environment
2. tobil4sk/setup-ocaml@feature/msys2 fork that supports MSYS2

MSYS2 is pre-installed on GitHub runners and doesn't have the
same connectivity issues as the Cygwin mirrors.

See: ocaml/setup-ocaml#1038
See: ocaml/setup-ocaml#857
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.

MSYS2 support

2 participants