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

Allow using msys2 instead of cygwin #857

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

tobil4sk
Copy link

@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 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" = (() => {

} catch {
// finally check the default msys directory
const defaultRoot = "C:\\msys64";
testMsys2Installation(defaultRoot);
Copy link
Preview

Copilot AI Dec 29, 2024

Choose a reason for hiding this comment

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

The function testMsys2Installation should be awaited to handle the promise correctly. Change it to await testMsys2Installation(defaultRoot);.

Suggested change
testMsys2Installation(defaultRoot);
await testMsys2Installation(defaultRoot);

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
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
1 participant