Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 22 additions & 16 deletions .github/workflows/win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@ jobs:
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0

- name: Set up Cygwin
uses: cygwin/cygwin-install-action@f61179d72284ceddc397ed07ddb444d82bf9e559 # v5
with:
packages: make
install-dir: C:\cygwin64
add-to-path: false

- name: Download Crystal source
uses: actions/checkout@v4

Expand All @@ -48,6 +41,16 @@ jobs:
libs/yaml.lib
libs/xml2.lib
key: win-libs-${{ hashFiles('.github/workflows/win.yml', 'etc/win-ci/*.ps1') }}-msvc
- name: Set up MSYS2
if: steps.cache-libs.outputs.cache-hit != 'true'
id: msys2
uses: msys2/setup-msys2@61f9e5e925871ba6c9e3e8da24ede83ea27fa91f # v2.27.0
with:
msystem: MSYS
update: true
path-type: inherit
install: >-
make
- name: Build libgc
if: steps.cache-libs.outputs.cache-hit != 'true'
run: .\etc\win-ci\build-gc.ps1 -BuildTree deps\gc -Version 8.2.8 -AtomicOpsVersion 7.8.2
Expand All @@ -59,7 +62,7 @@ jobs:
run: .\etc\win-ci\build-pcre2.ps1 -BuildTree deps\pcre2 -Version 10.45
- name: Build libiconv
if: steps.cache-libs.outputs.cache-hit != 'true'
run: .\etc\win-ci\build-iconv.ps1 -BuildTree deps\iconv -Version 1.18
run: .\etc\win-ci\build-iconv.ps1 -BuildTree deps\iconv -Version 1.18 -Msys2Root ${{ steps.msys2.outputs.msys2-location }}
- name: Build libffi
if: steps.cache-libs.outputs.cache-hit != 'true'
run: .\etc\win-ci\build-ffi.ps1 -BuildTree deps\ffi -Version 3.4.7
Expand Down Expand Up @@ -102,13 +105,6 @@ jobs:
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0

- name: Set up Cygwin
uses: cygwin/cygwin-install-action@f61179d72284ceddc397ed07ddb444d82bf9e559 # v5
with:
packages: make
install-dir: C:\cygwin64
add-to-path: false

- name: Download Crystal source
uses: actions/checkout@v4

Expand Down Expand Up @@ -136,6 +132,16 @@ jobs:
dlls/yaml.dll
dlls/libxml2.dll
key: win-dlls-${{ hashFiles('.github/workflows/win.yml', 'etc/win-ci/*.ps1') }}-msvc
- name: Set up MSYS2
if: steps.cache-dlls.outputs.cache-hit != 'true'
id: msys2
uses: msys2/setup-msys2@61f9e5e925871ba6c9e3e8da24ede83ea27fa91f # v2.27.0
with:
msystem: MSYS
update: true
path-type: inherit
install: >-
make
- name: Build libgc
if: steps.cache-dlls.outputs.cache-hit != 'true'
run: .\etc\win-ci\build-gc.ps1 -BuildTree deps\gc -Version 8.2.8 -AtomicOpsVersion 7.8.2 -Dynamic
Expand All @@ -147,7 +153,7 @@ jobs:
run: .\etc\win-ci\build-pcre2.ps1 -BuildTree deps\pcre2 -Version 10.45 -Dynamic
- name: Build libiconv
if: steps.cache-dlls.outputs.cache-hit != 'true'
run: .\etc\win-ci\build-iconv.ps1 -BuildTree deps\iconv -Version 1.18 -Dynamic
run: .\etc\win-ci\build-iconv.ps1 -BuildTree deps\iconv -Version 1.18 -Msys2Root ${{ steps.msys2.outputs.msys2-location }} -Dynamic
- name: Build libffi
if: steps.cache-dlls.outputs.cache-hit != 'true'
run: .\etc\win-ci\build-ffi.ps1 -BuildTree deps\ffi -Version 3.4.7 -Dynamic
Expand Down
7 changes: 6 additions & 1 deletion etc/win-ci/build-iconv.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
param(
[Parameter(Mandatory)] [string] $BuildTree,
[Parameter(Mandatory)] [string] $Version,
[string] $Msys2Root,
[switch] $Dynamic
)

Expand All @@ -12,9 +13,13 @@ tar -xzf libiconv.tar.gz
mv libiconv-* $BuildTree
rm libiconv.tar.gz

if ($Msys2Root -eq '') {
$Msys2Root = 'C:\msys64'
}

Run-InDirectory $BuildTree {
$env:CHERE_INVOKING = 1
& 'C:\cygwin64\bin\bash.exe' --login "$PSScriptRoot\cygwin-build-iconv.sh" "$Version" "$(if ($Dynamic) { 1 })"
& "$Msys2Root\usr\bin\bash.exe" --login "$PSScriptRoot\cygwin-build-iconv.sh" "$Version" "$(if ($Dynamic) { 1 })"
if (-not $?) {
Write-Host "Error: Failed to build libiconv" -ForegroundColor Red
Exit 1
Expand Down
Loading