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

Split Windows library build scripts from CI #13478

Merged

Conversation

HertzDevil
Copy link
Contributor

@HertzDevil HertzDevil commented May 17, 2023

This PR extracts the build scripts for the various third-party libraries in the Windows CI jobs into individual PowerShell scripts.

These scripts can be run from any directory. They all require CMake and Git; setup.ps1 will try to detect them from several common locations, even if they aren't present in %PATH%. Additionally, building PCRE requires 7-Zip, and building OpenSSL requires NASM and Strawberry Perl.

All those scripts support static and dynamic builds; the latter adds -dynamic to the names of all import libraries, in accordance with #13473. To build the libraries as DLLs, start from the MSVC developer prompt: (Strawberry Perl adds a lot of things to %PATH%, so it is a good idea to use the portable installation and keep %PATH% intact outside building OpenSSL)

> powershell
PS> .\etc\win-ci\build-gc.ps1 -BuildTree deps\gc -Version 8.2.2 -AtomicOpsVersion 7.8.0 -Dynamic
PS> .\etc\win-ci\build-pcre.ps1 -BuildTree deps\pcre -Version 8.45 -Dynamic
PS> .\etc\win-ci\build-pcre2.ps1 -BuildTree deps\pcre2 -Version 10.42 -Dynamic
PS> .\etc\win-ci\build-iconv.ps1 -BuildTree deps\iconv -Dynamic
PS> .\etc\win-ci\build-ffi.ps1 -BuildTree deps\ffi -Version 3.3 -Dynamic
PS> .\etc\win-ci\build-z.ps1 -BuildTree deps\z -Version 1.2.13 -Dynamic
PS> .\etc\win-ci\build-mpir.ps1 -BuildTree deps\mpir -Dynamic
PS> .\etc\win-ci\build-yaml.ps1 -BuildTree deps\yaml -Version 0.2.5 -Dynamic
PS> .\etc\win-ci\build-xml2.ps1 -BuildTree deps\xml2 -Version 2.11.3 -Dynamic
PS> exit
> ...\strawberry-perl\portableshell.bat /SETENV
> powershell
PS> .\etc\win-ci\build-openssl.ps1 -BuildTree deps\openssl -Version 3.1.0 -Dynamic

This will place all the import libraries inside .\libs and all the DLLs inside .\dlls. To build static libraries simply remove the -Dynamic; static and dynamic builds should use separate build trees to avoid surprising behavior.

This PR also upgrades libxml2 from 2.10.3 to 2.11.3, and OpenSSL from 3.0.7 to 3.1.0.

Eventually the scripts will be moved to a completely different place where all the libraries (and possibly the installer too) will be published as a single artifact.

@HertzDevil HertzDevil added topic:infrastructure kind:refactor platform:windows Windows support based on the MSVC toolchain / Win32 API labels May 17, 2023
.github/workflows/win.yml Outdated Show resolved Hide resolved
@HertzDevil HertzDevil marked this pull request as ready for review May 18, 2023 19:26
.github/workflows/win.yml Outdated Show resolved Hide resolved
etc/win-ci/build-gc.ps1 Outdated Show resolved Hide resolved
etc/win-ci/setup.ps1 Outdated Show resolved Hide resolved
@straight-shoota straight-shoota added this to the 1.9.0 milestone May 23, 2023
@straight-shoota straight-shoota merged commit b45504f into crystal-lang:master May 24, 2023
@HertzDevil HertzDevil deleted the refactor/windows-ci-libs branch May 24, 2023 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:refactor platform:windows Windows support based on the MSVC toolchain / Win32 API topic:infrastructure/ci
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants