Skip to content

Split Windows library build scripts from CI#13478

Merged
straight-shoota merged 8 commits intocrystal-lang:masterfrom
HertzDevil:refactor/windows-ci-libs
May 24, 2023
Merged

Split Windows library build scripts from CI#13478
straight-shoota merged 8 commits intocrystal-lang:masterfrom
HertzDevil:refactor/windows-ci-libs

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
@HertzDevil HertzDevil marked this pull request as ready for review May 18, 2023 19:26
@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