From 0caf5bb8764401f14bbf54fc666cbc9949129218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 16 Jul 2024 22:51:24 +0200 Subject: [PATCH 1/5] ci: run macOS and iOS tests also on macOS 14 The macOS 14 runners are ARM64 (in the non "large" version) whereas macOS 13 runners are still x64, so keep that one around too. --- .github/workflows/CI-unix.yml | 12 ++++++++++-- .github/workflows/sanitizer.yml | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI-unix.yml b/.github/workflows/CI-unix.yml index 591c35cf97a..6a805e080cb 100644 --- a/.github/workflows/CI-unix.yml +++ b/.github/workflows/CI-unix.yml @@ -77,7 +77,11 @@ jobs: adb shell "cd /data/local/tmp/build ; env UV_TEST_TIMEOUT_MULTIPLIER=5 ./uv_run_tests_a" build-macos: - runs-on: macos-12 + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-13, macos-14] steps: - uses: actions/checkout@v4 - name: Envinfo @@ -112,7 +116,11 @@ jobs: make -C build-auto -j4 build-ios: - runs-on: macos-12 + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-13, macos-14] steps: - uses: actions/checkout@v4 - name: Configure diff --git a/.github/workflows/sanitizer.yml b/.github/workflows/sanitizer.yml index 9607b488ff5..58254327d2a 100644 --- a/.github/workflows/sanitizer.yml +++ b/.github/workflows/sanitizer.yml @@ -67,7 +67,7 @@ jobs: ./build-ubsan/uv_run_tests_a sanitizers-macos: - runs-on: macos-12 + runs-on: macos-13 steps: - uses: actions/checkout@v4 From 64f4502b9ba71b4a185ee702dde43f8e6f4841d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 16 Jul 2024 23:59:20 +0200 Subject: [PATCH 2/5] unix,win: map ENOEXEC errno --- include/uv.h | 1 + include/uv/errno.h | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/uv.h b/include/uv.h index 9e450c5110f..67a25f0c1e2 100644 --- a/include/uv.h +++ b/include/uv.h @@ -157,6 +157,7 @@ struct uv__queue { XX(ESOCKTNOSUPPORT, "socket type not supported") \ XX(ENODATA, "no data available") \ XX(EUNATCH, "protocol driver not attached") \ + XX(ENOEXEC, "exec format error") \ #define UV_HANDLE_TYPE_MAP(XX) \ XX(ASYNC, async) \ diff --git a/include/uv/errno.h b/include/uv/errno.h index 127278ef916..ac00778cfc5 100644 --- a/include/uv/errno.h +++ b/include/uv/errno.h @@ -474,4 +474,10 @@ # define UV__EUNATCH (-4023) #endif +#if defined(ENOEXEC) && !defined(_WIN32) +# define UV__ENOEXEC UV__ERR(ENOEXEC) +#else +# define UV__ENOEXEC (-4022) +#endif + #endif /* UV_ERRNO_H_ */ From a3abfbcb088e639acddfed2771d85426c3392fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 16 Jul 2024 23:48:26 +0200 Subject: [PATCH 3/5] test: skip multicast join test on ENOEXEC It happens due to the default firewall configuration on macOS >= 13. Note: GH action runners have their firewall disabled, and yet, the test fails all the same. Oh well... Closes: https://github.com/libuv/libuv/issues/4263 --- test/test-udp-multicast-join.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test-udp-multicast-join.c b/test/test-udp-multicast-join.c index 9e322dc579f..2dca600cbb9 100644 --- a/test/test-udp-multicast-join.c +++ b/test/test-udp-multicast-join.c @@ -160,6 +160,8 @@ TEST_IMPL(udp_multicast_join) { r = uv_udp_set_membership(&server, MULTICAST_ADDR, NULL, UV_JOIN_GROUP); if (r == UV_ENODEV) RETURN_SKIP("No multicast support."); + if (r == UV_ENOEXEC) + RETURN_SKIP("No multicast support (likely a firewall issue)."); ASSERT_OK(r); r = uv_udp_recv_start(&server, alloc_cb, cl_recv_cb); From e129cd7fdae0ffd04bc6939dddb384a7df8fa7c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 22 Oct 2024 09:53:58 +0200 Subject: [PATCH 4/5] ci: make sure the macOS firewall is disabled It seems to be disabled by default, for now, but let's log its status and disable it just in case. --- .github/workflows/CI-unix.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/CI-unix.yml b/.github/workflows/CI-unix.yml index 6a805e080cb..26f1e0e4154 100644 --- a/.github/workflows/CI-unix.yml +++ b/.github/workflows/CI-unix.yml @@ -86,6 +86,11 @@ jobs: - uses: actions/checkout@v4 - name: Envinfo run: npx envinfo + - name: Disable Firewall + run: | + /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate + sudo defaults write /Library/Preferences/com.apple.alf globalstate -int 0 + /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate - name: Setup run: | brew install ninja automake libtool From d4ab6fbba4669935a6bc23645372dfe4ac29ab39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 22 Oct 2024 10:01:43 +0200 Subject: [PATCH 5/5] darwin,test: squelch EBUSY error on multicast join The firewall was suspected to be the culprit, but the test intermittently fails in the CI, not locally. --- test/test-udp-multicast-join.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/test-udp-multicast-join.c b/test/test-udp-multicast-join.c index 2dca600cbb9..6d3bca5b3d7 100644 --- a/test/test-udp-multicast-join.c +++ b/test/test-udp-multicast-join.c @@ -36,10 +36,9 @@ static uv_udp_t client; static uv_udp_send_t req; static uv_udp_send_t req_ss; +static int darwin_ebusy_errors; static int cl_recv_cb_called; - static int sv_send_cb_called; - static int close_cb_called; static void alloc_cb(uv_handle_t* handle, @@ -128,6 +127,13 @@ static void cl_recv_cb(uv_udp_t* handle, #if !defined(__NetBSD__) r = uv_udp_set_source_membership(&server, MULTICAST_ADDR, NULL, source_addr, UV_JOIN_GROUP); +#if defined(__APPLE__) + if (r == UV_EBUSY) { + uv_close((uv_handle_t*) &server, close_cb); + darwin_ebusy_errors++; + return; + } +#endif ASSERT_OK(r); #endif @@ -177,6 +183,9 @@ TEST_IMPL(udp_multicast_join) { /* run the loop till all events are processed */ uv_run(uv_default_loop(), UV_RUN_DEFAULT); + if (darwin_ebusy_errors > 0) + RETURN_SKIP("Unexplained macOS IP_ADD_SOURCE_MEMBERSHIP EBUSY bug"); + ASSERT_EQ(2, cl_recv_cb_called); ASSERT_EQ(2, sv_send_cb_called); ASSERT_EQ(2, close_cb_called);