From 55bc0c0e04fe4b4c6be6130f08df4c3220484cd7 Mon Sep 17 00:00:00 2001 From: Daijiro Fukuda Date: Mon, 13 May 2024 18:19:24 +0900 Subject: [PATCH 1/2] Windows: Fix build error incompatible pointer types On GitHub workflows, building the native extensions for `cool.io` fails as follows: ../libev/ev.c: In function 'evpipe_write': ../libev/ev.c:2484:19: error: assignment to 'char *' from incompatible pointer type 'WSABUF *' [-Wincompatible-pointer-types] 2484 | buf.buf = &buf; | ^ * Runner: windows-2022 (20240421.1.0) * Use `ruby/setup-ruby v1` to set up Ruby * https://github.com/actions/setup-ruby * Dependency: `cool.io` v1.8.0 The type of `buf` member of `WSABUF` is `char *`: * https://learn.microsoft.com/en-us/windows/win32/api/ws2def/ns-ws2def-wsabuf On `libev` upstream, this was already fixed on v4.25: http://cvs.schmorp.de/libev/ev.c?r1=1.484&r2=1.485&pathrev=rel-4_25 Maybe we should try to update the overall `libev` version, but that could be difficult. So, this commit intends to fix this error first. --- ext/libev/ev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/libev/ev.c b/ext/libev/ev.c index 1ed4726..8759ee5 100644 --- a/ext/libev/ev.c +++ b/ext/libev/ev.c @@ -2481,7 +2481,7 @@ evpipe_write (EV_P_ EV_ATOMIC_T *flag) #ifdef _WIN32 WSABUF buf; DWORD sent; - buf.buf = &buf; + buf.buf = (char *)&buf; buf.len = 1; WSASend (EV_FD_TO_WIN32_HANDLE (evpipe [1]), &buf, 1, &sent, 0, 0, 0); #else From 0b0749c3de45a4261fb0aedd074a3a53a6e7ceca Mon Sep 17 00:00:00 2001 From: Daijiro Fukuda Date: Mon, 13 May 2024 18:46:43 +0900 Subject: [PATCH 2/2] CI: Add Windows In addition, add `fail-fast: false` to ensure that all jobs are executed. --- .github/workflows/test.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d92113e..5ed5231 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,10 +15,12 @@ jobs: continue-on-error: ${{matrix.experimental}} strategy: + fail-fast: false matrix: os: - ubuntu - macos + - windows ruby: - "3.0"