Skip to content
New issue

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

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

Already on GitHub? # to your account

MinGW-w64 / MSYS2 support #650

Open
HertzDevil opened this issue Oct 24, 2024 · 4 comments
Open

MinGW-w64 / MSYS2 support #650

HertzDevil opened this issue Oct 24, 2024 · 4 comments

Comments

@HertzDevil
Copy link
Contributor

HertzDevil commented Oct 24, 2024

As part of crystal-lang/crystal#6170, it makes sense to test Shards on MSYS2 and package Shards for it as well. The bad news is that all the resolvers are problematic on MSYS2:

  • Mercurial is only available from the MSYS environment, and installs /usr/bin/hg, a Python script with a shebang, which Process.run doesn't handle. Nor is running the script with Python expected on Windows, since Mercurial packages hg.exe using PyOxidizer; the specs will pass if this executable is exposed inside MSYS2 with something like PATH="$(cygpath $PROGRAMFILES)/Mercurial:$PATH".
  • Fossil has a UCRT64 build but it is completely broken. It is a single executable, so downloading the official Windows build somewhere to $PATH would work. (If obtained via WinGet, it should be available at $(cygpath $LOCALAPPDATA)/Microsoft/WinGet/Links.)
  • No specs are affected by MSYS Git, but it has its own issues.

Everything else seems to work fine.

@straight-shoota
Copy link
Member

I understand these issues are predominantly for setting up CI testing on MSYS2? It's not so much a problem for using it?

@HertzDevil
Copy link
Contributor Author

It affects the check step within a PKGBUILD file too, since tests running on MSYS2's own CI naturally depend only on other MSYS2 packages. Basically we have to add skip_fossil=1 skip_hg=1 to make test; perhaps we could add a special case for hg when $MSYSTEM is defined, but I don't know if that is worth the effort (even as a patch exclusive to the MSYS2 package repository).

@ysbaddaden
Copy link
Contributor

I assume the same issues will arise for normal usages too.

@HertzDevil
Copy link
Contributor Author

Also this spec is failing inside MSYS2:

it "fails when git is missing" do
metadata = {dependencies: {web: "*"}}
with_shard(metadata) do
ex = expect_raises(FailedCommand) { run "shards install --no-color", env: {"PATH" => File.expand_path("../../bin", __DIR__), "SHARDS_CACHE_PATH" => ""} }
ex.stdout.should contain "Error missing git command line tool. Please install Git first!"
end
end

The reason is that the temporary $PATH contains none of Shards itself's dependent DLLs, so running anything gives the exit code 0xC0000135 without an error message.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants