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

Add CI workflow for cross-compiling Crystal on MSYS2 #15110

Merged

Conversation

HertzDevil
Copy link
Contributor

@HertzDevil HertzDevil commented Oct 21, 2024

Cross-compiles a MinGW-w64-based Crystal compiler from Ubuntu, then links it on MSYS2's UCRT64 environment. Resolves part of #6170.

The artifact includes the compiler, all dependent DLLs, and the source code only. It is not a complete installation since it is missing e.g. the documentation and the licenses, but it is sufficient for bootstrapping further native compiler builds within MSYS2.

The resulting binary is portable within MSYS2 and can be executed from anywhere inside an MSYS2 shell, although compilation requires mingw-w64-ucrt-x86_64-cc, probably mingw-w64-ucrt-x86_64-pkgconf, plus the respective development libraries listed in #15077. The DLLs bundled under bin/ are needed to even start Crystal since they are dynamically linked at load time; they are not strictly needed if Crystal is always run only within MSYS2, but that is the job of an actual PKGBUILD file.

@HertzDevil HertzDevil added kind:feature topic:infrastructure/ci platform:windows-gnu Windows support based on the MinGW-w64 toolchain + MSYS2 labels Oct 21, 2024
@straight-shoota straight-shoota added this to the 1.15.0 milestone Oct 21, 2024
@straight-shoota straight-shoota merged commit f2a6628 into crystal-lang:master Oct 23, 2024
69 checks passed
@HertzDevil HertzDevil deleted the feature/mingw-w64-ci branch October 24, 2024 08:01
CTC97 pushed a commit to CTC97/crystal that referenced this pull request Nov 9, 2024
)

Cross-compiles a MinGW-w64-based Crystal compiler from Ubuntu, then links it on MSYS2's UCRT64 environment. Resolves part of crystal-lang#6170.

The artifact includes the compiler, all dependent DLLs, and the source code only. It is not a complete installation since it is missing e.g. the documentation and the licenses, but it is sufficient for bootstrapping further native compiler builds within MSYS2.

The resulting binary is portable within MSYS2 and can be executed from anywhere inside an MSYS2 shell, although compilation requires `mingw-w64-ucrt-x86_64-cc`, probably `mingw-w64-ucrt-x86_64-pkgconf`, plus the respective development libraries listed in crystal-lang#15077. The DLLs bundled under `bin/` are needed to even start Crystal since they are dynamically linked at load time; they are not strictly needed if Crystal is always run only within MSYS2, but that is the job of an actual `PKGBUILD` file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:feature platform:windows-gnu Windows support based on the MinGW-w64 toolchain + MSYS2 topic:infrastructure/ci
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants