From 9d65f650e778fd38bea37e5c29218147ff0c9ac2 Mon Sep 17 00:00:00 2001 From: Chris Rawnsley Date: Sat, 15 Feb 2025 10:40:27 +0000 Subject: [PATCH 1/6] libuv-devel: update to 1.50.0 --- devel/libuv/Portfile | 22 ++-- .../libuv/files/patch-libuv-legacy-devel.diff | 109 ++++++++---------- ...-libuv-unix-core-close-nocancel-devel.diff | 41 +++++++ 3 files changed, 97 insertions(+), 75 deletions(-) create mode 100644 devel/libuv/files/patch-libuv-unix-core-close-nocancel-devel.diff diff --git a/devel/libuv/Portfile b/devel/libuv/Portfile index 583bcd06d67f8..f6a4ee9f323da 100644 --- a/devel/libuv/Portfile +++ b/devel/libuv/Portfile @@ -21,14 +21,13 @@ subport libuv-devel { legacysupport.newest_darwin_requires_legacy 15 github.setup \ - libuv libuv 1.47.0 v - # Change github.tarball_from to 'releases' or 'archive' next update - github.tarball_from tarball + libuv libuv 1.50.0 v + github.tarball_from archive revision 0 - checksums rmd160 6510cd246bb2062874a5cb37e92a1c727a7d2655 \ - sha256 72a187104662b47f2a2b204da39d2acb05cf22a4fcb13ceaebe3b0ed0c0e2e43 \ - size 1654769 + checksums rmd160 c8e0059ab5028b19ae7459e9f33b8f17f77dc9e1 \ + sha256 c42c51d4e630f95dcefcafff95bf003ea52939e312d5e6584e7d9e102ead3e9e \ + size 1686246 } set domain libuv.org @@ -48,17 +47,18 @@ long_description \ ${name} is a multi-platform support library with a focus on \ cross-platform asynchronous I/O. -patchfiles-append \ - patch-libuv-unix-core-close-nocancel.diff - if {${subport} eq ${name}} { # RELEASE - patchfiles-append patch-libuv-legacy.diff + patchfiles-append \ + patch-libuv-unix-core-close-nocancel.diff \ + patch-libuv-legacy.diff conflicts libuv-devel } else { # DEVEL - patchfiles-append patch-libuv-legacy-devel.diff + patchfiles-append \ + patch-libuv-unix-core-close-nocancel-devel.diff \ + patch-libuv-legacy-devel.diff conflicts libuv diff --git a/devel/libuv/files/patch-libuv-legacy-devel.diff b/devel/libuv/files/patch-libuv-legacy-devel.diff index 3b046ae8e2d30..f4e6f8990c46d 100644 --- a/devel/libuv/files/patch-libuv-legacy-devel.diff +++ b/devel/libuv/files/patch-libuv-legacy-devel.diff @@ -1,47 +1,15 @@ -From 97b062503185cbafaf80cb5ec1da1c1c953411e1 Mon Sep 17 00:00:00 2001 -From: barracuda156 -Date: Tue, 8 Aug 2023 19:03:03 +0800 -Subject: [PATCH] Fix libuv - ---- - src/unix/darwin-proctitle.c | 2 ++ - src/unix/fs.c | 2 +- - src/unix/process.c | 10 +++++++--- - src/unix/tty.c | 2 +- - src/unix/udp.c | 2 ++ - 5 files changed, 13 insertions(+), 5 deletions(-) - -diff --git src/unix/darwin-proctitle.c src/unix/darwin-proctitle.c -index 5288083e..c1aa0531 100644 ---- src/unix/darwin-proctitle.c -+++ src/unix/darwin-proctitle.c -@@ -41,9 +41,11 @@ static int uv__pthread_setname_np(const char* name) { - strncpy(namebuf, name, sizeof(namebuf) - 1); - namebuf[sizeof(namebuf) - 1] = '\0'; - -+#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) - err = pthread_setname_np(namebuf); - if (err) - return UV__ERR(err); -+#endif - - return 0; - } -diff --git src/unix/fs.c src/unix/fs.c -index 6b051c12..18e274cf 100644 ---- src/unix/fs.c +--- src/unix/fs.c.orig +++ src/unix/fs.c -@@ -84,7 +84,8 @@ - - #if defined(__CYGWIN__) || \ - (defined(__HAIKU__) && B_HAIKU_VERSION < B_HAIKU_VERSION_1_PRE_BETA_5) || \ -- (defined(__sun) && !defined(__illumos__)) -+ (defined(__sun) && !defined(__illumos__)) || \ -+ (defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED < 101400) - #define preadv(fd, bufs, nbufs, off) \ - pread(fd, (bufs)->iov_base, (bufs)->iov_len, off) - #define pwritev(fd, bufs, nbufs, off) \ -@@ -1410,7 +1411,7 @@ static void uv__to_stat(struct stat* src, uv_stat_t* dst) { +@@ -1079,7 +1079,7 @@ + return -1; + } + /* sendfile() on iOS(arm64) will throw SIGSYS signal cause crash. */ +-#elif (defined(__APPLE__) && !TARGET_OS_IPHONE) \ ++#elif (defined(__APPLE__) && (!TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050))) \ + || defined(__DragonFly__) \ + || defined(__FreeBSD__) + { +@@ -1458,7 +1458,7 @@ dst->st_blksize = src->st_blksize; dst->st_blocks = src->st_blocks; @@ -50,23 +18,20 @@ index 6b051c12..18e274cf 100644 dst->st_atim.tv_sec = src->st_atimespec.tv_sec; dst->st_atim.tv_nsec = src->st_atimespec.tv_nsec; dst->st_mtim.tv_sec = src->st_mtimespec.tv_sec; -diff --git src/unix/process.c src/unix/process.c -index dd58c18d..35aa9b1b 100644 ---- src/unix/process.c +--- src/unix/process.c.orig +++ src/unix/process.c @@ -36,7 +36,9 @@ #include #if defined(__APPLE__) --# include -+# if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 -+# include -+# endif ++#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 + # include ++#endif # include # include # include -@@ -407,7 +409,7 @@ static void uv__process_child_init(const uv_process_options_t* options, - } +@@ -387,7 +389,7 @@ + #endif -#if defined(__APPLE__) @@ -74,7 +39,7 @@ index dd58c18d..35aa9b1b 100644 typedef struct uv__posix_spawn_fncs_tag { struct { int (*addchdir_np)(const posix_spawn_file_actions_t *, const char *); -@@ -608,9 +610,11 @@ static int uv__spawn_set_posix_spawn_file_actions( +@@ -588,9 +590,11 @@ } } @@ -86,7 +51,7 @@ index dd58c18d..35aa9b1b 100644 err = posix_spawn_file_actions_adddup2(actions, use_fd, fd); assert(err != ENOSYS); if (err != 0) -@@ -859,7 +863,7 @@ static int uv__spawn_and_init_child( +@@ -839,7 +843,7 @@ int exec_errorno; ssize_t r; @@ -95,24 +60,20 @@ index dd58c18d..35aa9b1b 100644 uv_once(&posix_spawn_init_once, uv__spawn_init_posix_spawn); /* Special child process spawn case for macOS Big Sur (11.0) onwards -diff --git src/unix/tty.c src/unix/tty.c -index d099bdb3..899e3a66 100644 ---- src/unix/tty.c +--- src/unix/tty.c.orig +++ src/unix/tty.c -@@ -85,7 +85,7 @@ static int uv__tty_is_slave(const int fd) { +@@ -85,7 +85,7 @@ int dummy; result = ioctl(fd, TIOCGPTN, &dummy) != 0; -#elif defined(__APPLE__) -+#elif defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050) ++#elif defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 char dummy[256]; result = ioctl(fd, TIOCPTYGNAME, &dummy) != 0; -diff --git src/unix/udp.c src/unix/udp.c -index c2814512..cba9e821 100644 ---- src/unix/udp.c +--- src/unix/udp.c.orig +++ src/unix/udp.c -@@ -892,6 +892,7 @@ static int uv__udp_set_membership6(uv_udp_t* handle, +@@ -938,6 +938,7 @@ !defined(__ANDROID__) && \ !defined(__DragonFly__) && \ !defined(__QNX__) && \ @@ -120,7 +81,7 @@ index c2814512..cba9e821 100644 !defined(__GNU__) static int uv__udp_set_source_membership4(uv_udp_t* handle, const struct sockaddr_in* multicast_addr, -@@ -1083,6 +1084,7 @@ int uv_udp_set_source_membership(uv_udp_t* handle, +@@ -1131,6 +1132,7 @@ !defined(__ANDROID__) && \ !defined(__DragonFly__) && \ !defined(__QNX__) && \ @@ -128,3 +89,23 @@ index c2814512..cba9e821 100644 !defined(__GNU__) int err; union uv__sockaddr mcast_addr; +--- test/test-fs.c.orig ++++ test/test-fs.c +@@ -1477,7 +1477,7 @@ + ASSERT_OK(uv_fs_fstat(NULL, &req, file, NULL)); + ASSERT_OK(req.result); + s = req.ptr; +-# if defined(__APPLE__) ++# if defined(__APPLE__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050) + ASSERT_EQ(s->st_birthtim.tv_sec, t.st_birthtimespec.tv_sec); + ASSERT_EQ(s->st_birthtim.tv_nsec, t.st_birthtimespec.tv_nsec); + # elif defined(__linux__) +@@ -1518,7 +1518,7 @@ + ASSERT_EQ(s->st_size, (uint64_t) t.st_size); + ASSERT_EQ(s->st_blksize, (uint64_t) t.st_blksize); + ASSERT_EQ(s->st_blocks, (uint64_t) t.st_blocks); +-#if defined(__APPLE__) ++# if defined(__APPLE__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050) + ASSERT_EQ(s->st_atim.tv_sec, t.st_atimespec.tv_sec); + ASSERT_EQ(s->st_atim.tv_nsec, t.st_atimespec.tv_nsec); + ASSERT_EQ(s->st_mtim.tv_sec, t.st_mtimespec.tv_sec); diff --git a/devel/libuv/files/patch-libuv-unix-core-close-nocancel-devel.diff b/devel/libuv/files/patch-libuv-unix-core-close-nocancel-devel.diff new file mode 100644 index 0000000000000..89edc1685368b --- /dev/null +++ b/devel/libuv/files/patch-libuv-unix-core-close-nocancel-devel.diff @@ -0,0 +1,41 @@ +--- src/unix/core.c.orig ++++ src/unix/core.c +@@ -597,18 +597,31 @@ + * will unwind the thread when it's in the cancel state. Work around that + * by making the system call directly. Musl libc is unaffected. + */ ++ ++#if defined(__GNUC__) ++# define GCC_VERSION \ ++ (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) ++#endif ++#if defined(__clang__) || (defined(GCC_VERSION) && (GCC_VERSION >= 40500)) ++/* gcc diagnostic pragmas available */ ++# define GCC_DIAGNOSTIC_AVAILABLE ++#endif + int uv__close_nocancel(int fd) { +-#if defined(__APPLE__) +-#pragma GCC diagnostic push +-#pragma GCC diagnostic ignored "-Wdollar-in-identifier-extension" +-#if defined(__LP64__) || TARGET_OS_IPHONE ++#if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050) ++# if defined(GCC_DIAGNOSTIC_AVAILABLE) ++# pragma GCC diagnostic push ++# pragma GCC diagnostic ignored "-Wdollar-in-identifier-extension" ++# endif ++# if defined(__LP64__) || __LP64__ || (defined(TARGET_OS_IPHONE) && (TARGET_OS_IPHONE > 0)) + extern int close$NOCANCEL(int); + return close$NOCANCEL(fd); +-#else ++# else + extern int close$NOCANCEL$UNIX2003(int); + return close$NOCANCEL$UNIX2003(fd); +-#endif +-#pragma GCC diagnostic pop ++# endif ++# if defined(GCC_DIAGNOSTIC_AVAILABLE) ++# pragma GCC diagnostic pop ++# endif + #elif defined(__linux__) && defined(__SANITIZE_THREAD__) && defined(__clang__) + long rc; + __sanitizer_syscall_pre_close(fd); From 85067ace2fadaf6e25a1c514ea10316c72b073a3 Mon Sep 17 00:00:00 2001 From: Chris Rawnsley Date: Sat, 15 Feb 2025 22:58:13 +0000 Subject: [PATCH 2/6] squash! libuv-devel: update to 1.50.0 Prefer a regex replace over patch as Makefile.in is dynamically generated so this can ease maintenance burden. --- devel/libuv/Portfile | 6 +- .../files/patch-no-libutil-on-Tiger.diff | 56 ------------------- 2 files changed, 4 insertions(+), 58 deletions(-) delete mode 100644 devel/libuv/files/patch-no-libutil-on-Tiger.diff diff --git a/devel/libuv/Portfile b/devel/libuv/Portfile index f6a4ee9f323da..c4861daabfa54 100644 --- a/devel/libuv/Portfile +++ b/devel/libuv/Portfile @@ -75,8 +75,10 @@ configure.args --disable-silent-rules platform darwin { if { ${os.major} == 8 } { - # Tiger has no libutil - patchfiles-append patch-no-libutil-on-Tiger.diff + post-patch { + # Tiger has no libutil + reinplace -E "s|(.*DARWIN_TRUE.*-lutil.*)|# \\1|" Makefile.in + } configure.cppflags-append -D__DARWIN_UNIX03 # prevent conflicting opentransport header from being pulled in diff --git a/devel/libuv/files/patch-no-libutil-on-Tiger.diff b/devel/libuv/files/patch-no-libutil-on-Tiger.diff deleted file mode 100644 index 399ced1efc2f7..0000000000000 --- a/devel/libuv/files/patch-no-libutil-on-Tiger.diff +++ /dev/null @@ -1,56 +0,0 @@ ---- Makefile.in.orig -+++ Makefile.in -@@ -255,7 +255,7 @@ - @DARWIN_TRUE@ src/unix/proctitle.c \ - @DARWIN_TRUE@ src/unix/random-getentropy.c - --@DARWIN_TRUE@am__append_31 = -lutil -+# @DARWIN_TRUE@am__append_31 = -lutil - @DRAGONFLY_TRUE@am__append_32 = include/uv/bsd.h - @DRAGONFLY_TRUE@am__append_33 = src/unix/bsd-ifaddrs.c \ - @DRAGONFLY_TRUE@ src/unix/bsd-proctitle.c \ -@@ -263,7 +263,7 @@ - @DRAGONFLY_TRUE@ src/unix/kqueue.c \ - @DRAGONFLY_TRUE@ src/unix/posix-hrtime.c - --@DRAGONFLY_TRUE@am__append_34 = -lutil -+# @DRAGONFLY_TRUE@am__append_34 = -lutil - @FREEBSD_TRUE@am__append_35 = include/uv/bsd.h - @FREEBSD_TRUE@am__append_36 = src/unix/bsd-ifaddrs.c \ - @FREEBSD_TRUE@ src/unix/bsd-proctitle.c \ -@@ -272,7 +272,7 @@ - @FREEBSD_TRUE@ src/unix/posix-hrtime.c \ - @FREEBSD_TRUE@ src/unix/random-getrandom.c - --@FREEBSD_TRUE@am__append_37 = -lutil -+# @FREEBSD_TRUE@am__append_37 = -lutil - @HAIKU_TRUE@am__append_38 = include/uv/posix.h - @HAIKU_TRUE@am__append_39 = -D_BSD_SOURCE - @HAIKU_TRUE@am__append_40 = src/unix/bsd-ifaddrs.c \ -@@ -303,7 +303,7 @@ - @LINUX_TRUE@ src/unix/random-sysctl-linux.c \ - @LINUX_TRUE@ src/unix/epoll.c - --@LINUX_TRUE@am__append_47 = -lutil -+# @LINUX_TRUE@am__append_47 = -lutil - @MSYS_TRUE@am__append_48 = -D_GNU_SOURCE - @MSYS_TRUE@am__append_49 = src/unix/cygwin.c \ - @MSYS_TRUE@ src/unix/bsd-ifaddrs.c \ -@@ -322,7 +322,7 @@ - @NETBSD_TRUE@ src/unix/netbsd.c \ - @NETBSD_TRUE@ src/unix/posix-hrtime.c - --@NETBSD_TRUE@am__append_52 = -lutil -+# @NETBSD_TRUE@am__append_52 = -lutil - @OPENBSD_TRUE@am__append_53 = include/uv/bsd.h - @OPENBSD_TRUE@am__append_54 = src/unix/bsd-ifaddrs.c \ - @OPENBSD_TRUE@ src/unix/bsd-proctitle.c \ -@@ -331,7 +331,7 @@ - @OPENBSD_TRUE@ src/unix/posix-hrtime.c \ - @OPENBSD_TRUE@ src/unix/random-getentropy.c - --@OPENBSD_TRUE@am__append_55 = -lutil -+# @OPENBSD_TRUE@am__append_55 = -lutil - @SUNOS_TRUE@am__append_56 = include/uv/sunos.h - @SUNOS_TRUE@am__append_57 = -D__EXTENSIONS__ \ - @SUNOS_TRUE@ -D_XOPEN_SOURCE=500 \ From d586f7d58175c5b9ed787f3084ff68d0d2762529 Mon Sep 17 00:00:00 2001 From: Chris Rawnsley Date: Sun, 16 Feb 2025 12:36:31 +0000 Subject: [PATCH 3/6] squash! libuv-devel: update to 1.50.0 Include patches provided by @barracuda156 See: https://github.com/macports/macports-ports/pull/27671#issuecomment-2660965002 --- devel/libuv/Portfile | 4 +- ...libuv-fix-darwin-add-udp-mmsg-support.diff | 54 +++++++++++++++++++ ...ibuv-revert-darwin-simplify-uv_hrtime.diff | 42 +++++++++++++++ 3 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 devel/libuv/files/patch-libuv-fix-darwin-add-udp-mmsg-support.diff create mode 100644 devel/libuv/files/patch-libuv-revert-darwin-simplify-uv_hrtime.diff diff --git a/devel/libuv/Portfile b/devel/libuv/Portfile index c4861daabfa54..fd1240d5861e3 100644 --- a/devel/libuv/Portfile +++ b/devel/libuv/Portfile @@ -58,7 +58,9 @@ if {${subport} eq ${name}} { # DEVEL patchfiles-append \ patch-libuv-unix-core-close-nocancel-devel.diff \ - patch-libuv-legacy-devel.diff + patch-libuv-legacy-devel.diff \ + patch-libuv-revert-darwin-simplify-uv_hrtime.diff \ + patch-libuv-fix-darwin-add-udp-mmsg-support.diff conflicts libuv diff --git a/devel/libuv/files/patch-libuv-fix-darwin-add-udp-mmsg-support.diff b/devel/libuv/files/patch-libuv-fix-darwin-add-udp-mmsg-support.diff new file mode 100644 index 0000000000000..b839bb92f7fc9 --- /dev/null +++ b/devel/libuv/files/patch-libuv-fix-darwin-add-udp-mmsg-support.diff @@ -0,0 +1,54 @@ +Guards udp mmsg support from appearing in OS X <=10.6 + +See: 1c778bd001543371c915a79b7ac3c5864fe59e74 + +--- src/unix/udp.c.orig ++++ src/unix/udp.c +@@ -152,7 +152,7 @@ + } + + static int uv__udp_recvmmsg(uv_udp_t* handle, uv_buf_t* buf) { +-#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) ++#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) + struct sockaddr_in6 peers[20]; + struct iovec iov[ARRAY_SIZE(peers)]; + struct mmsghdr msgs[ARRAY_SIZE(peers)]; +@@ -215,9 +215,9 @@ + handle->recv_cb(handle, 0, buf, NULL, UV_UDP_MMSG_FREE); + } + return nread; +-#else /* __linux__ || ____FreeBSD__ || __APPLE__ */ ++#else /* __linux__ || __FreeBSD__ || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) */ + return UV_ENOSYS; +-#endif /* __linux__ || ____FreeBSD__ || __APPLE__ */ ++#endif /* __linux__ || __FreeBSD__ || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) */ + } + + static void uv__udp_recvmsg(uv_udp_t* handle) { +@@ -878,7 +878,7 @@ + + + int uv_udp_using_recvmmsg(const uv_udp_t* handle) { +-#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) ++#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) + if (handle->flags & UV_HANDLE_UDP_RECVMMSG) + return 1; + #endif +@@ -1300,7 +1300,7 @@ + r = 0; + nsent = 0; + +-#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) ++#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) + if (count > 1) { + for (i = 0; i < count; /*empty*/) { + struct mmsghdr m[20]; +@@ -1327,7 +1327,7 @@ + + goto exit; + } +-#endif /* defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) */ ++#endif /* defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) */ + + for (i = 0; i < count; i++, nsent++) + if ((r = uv__udp_sendmsg1(fd, bufs[i], nbufs[i], addrs[i]))) diff --git a/devel/libuv/files/patch-libuv-revert-darwin-simplify-uv_hrtime.diff b/devel/libuv/files/patch-libuv-revert-darwin-simplify-uv_hrtime.diff new file mode 100644 index 0000000000000..123087311976a --- /dev/null +++ b/devel/libuv/files/patch-libuv-revert-darwin-simplify-uv_hrtime.diff @@ -0,0 +1,42 @@ +Revert "darwin: simplify uv_hrtime" + +This reverts commit c0a61c3bb323724532fa9c1ac190afb36e4ae264. + +Required for support on MacOS <10.15 + +--- src/unix/darwin.c.orig ++++ src/unix/darwin.c +@@ -25,6 +25,7 @@ + #include + #include + ++#include + #include + #include + #include /* _NSGetExecutablePath */ +@@ -33,6 +34,7 @@ + #include /* sysconf */ + + static uv_once_t once = UV_ONCE_INIT; ++static uint64_t (*time_func)(void); + static mach_timebase_info_data_t timebase; + + +@@ -54,12 +56,16 @@ void uv__platform_loop_delete(uv_loop_t* loop) { + static void uv__hrtime_init_once(void) { + if (KERN_SUCCESS != mach_timebase_info(&timebase)) + abort(); ++ ++ time_func = (uint64_t (*)(void)) dlsym(RTLD_DEFAULT, "mach_continuous_time"); ++ if (time_func == NULL) ++ time_func = mach_absolute_time; + } + + + uint64_t uv__hrtime(uv_clocktype_t type) { + uv_once(&once, uv__hrtime_init_once); +- return mach_continuous_time() * timebase.numer / timebase.denom; ++ return time_func() * timebase.numer / timebase.denom; + } + + From b28f0fc2ab22e2a95fc2315971c10287714ccd62 Mon Sep 17 00:00:00 2001 From: Chris Rawnsley Date: Sun, 16 Feb 2025 21:49:57 +0000 Subject: [PATCH 4/6] squash! libuv-devel: update to 1.50.0 Convert patch set to be compatible with `git am`. Set produced with `git format-patch` --- devel/libuv/Portfile | 9 +- ...01-Revert-darwin-simplify-uv_hrtime.patch} | 17 +- ...ausing-issues-on-older-gcc-versions.patch} | 23 ++- .../0003-support-legacy-macos-pre-v11.patch | 190 ++++++++++++++++++ ...libuv-fix-darwin-add-udp-mmsg-support.diff | 54 ----- .../libuv/files/patch-libuv-legacy-devel.diff | 111 ---------- 6 files changed, 229 insertions(+), 175 deletions(-) rename devel/libuv/files/{patch-libuv-revert-darwin-simplify-uv_hrtime.diff => 0001-Revert-darwin-simplify-uv_hrtime.patch} (70%) rename devel/libuv/files/{patch-libuv-unix-core-close-nocancel-devel.diff => 0002-prevent-pragmas-causing-issues-on-older-gcc-versions.patch} (68%) create mode 100644 devel/libuv/files/0003-support-legacy-macos-pre-v11.patch delete mode 100644 devel/libuv/files/patch-libuv-fix-darwin-add-udp-mmsg-support.diff delete mode 100644 devel/libuv/files/patch-libuv-legacy-devel.diff diff --git a/devel/libuv/Portfile b/devel/libuv/Portfile index fd1240d5861e3..e6c3be0f0c2c4 100644 --- a/devel/libuv/Portfile +++ b/devel/libuv/Portfile @@ -56,11 +56,12 @@ if {${subport} eq ${name}} { conflicts libuv-devel } else { # DEVEL + patch.pre_args-replace \ + -p0 -p1 patchfiles-append \ - patch-libuv-unix-core-close-nocancel-devel.diff \ - patch-libuv-legacy-devel.diff \ - patch-libuv-revert-darwin-simplify-uv_hrtime.diff \ - patch-libuv-fix-darwin-add-udp-mmsg-support.diff + 0001-Revert-darwin-simplify-uv_hrtime.patch \ + 0002-prevent-pragmas-causing-issues-on-older-gcc-versions.patch \ + 0003-support-legacy-macos-pre-v11.patch conflicts libuv diff --git a/devel/libuv/files/patch-libuv-revert-darwin-simplify-uv_hrtime.diff b/devel/libuv/files/0001-Revert-darwin-simplify-uv_hrtime.patch similarity index 70% rename from devel/libuv/files/patch-libuv-revert-darwin-simplify-uv_hrtime.diff rename to devel/libuv/files/0001-Revert-darwin-simplify-uv_hrtime.patch index 123087311976a..00c9b915bf38a 100644 --- a/devel/libuv/files/patch-libuv-revert-darwin-simplify-uv_hrtime.diff +++ b/devel/libuv/files/0001-Revert-darwin-simplify-uv_hrtime.patch @@ -1,11 +1,19 @@ -Revert "darwin: simplify uv_hrtime" +From c737e4d9756308e1f848af394285d9d3151bf8f9 Mon Sep 17 00:00:00 2001 +From: Sergey Fedorov +Date: Fri, 3 Jan 2025 14:40:05 +0800 +Subject: [PATCH 1/3] Revert "darwin: simplify uv_hrtime" This reverts commit c0a61c3bb323724532fa9c1ac190afb36e4ae264. Required for support on MacOS <10.15 +--- + src/unix/darwin.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) ---- src/unix/darwin.c.orig -+++ src/unix/darwin.c +diff --git a/src/unix/darwin.c b/src/unix/darwin.c +index 009efbef..5e764a65 100644 +--- a/src/unix/darwin.c ++++ b/src/unix/darwin.c @@ -25,6 +25,7 @@ #include #include @@ -40,3 +48,6 @@ Required for support on MacOS <10.15 } +-- +2.48.0 + diff --git a/devel/libuv/files/patch-libuv-unix-core-close-nocancel-devel.diff b/devel/libuv/files/0002-prevent-pragmas-causing-issues-on-older-gcc-versions.patch similarity index 68% rename from devel/libuv/files/patch-libuv-unix-core-close-nocancel-devel.diff rename to devel/libuv/files/0002-prevent-pragmas-causing-issues-on-older-gcc-versions.patch index 89edc1685368b..caf7b214d80f5 100644 --- a/devel/libuv/files/patch-libuv-unix-core-close-nocancel-devel.diff +++ b/devel/libuv/files/0002-prevent-pragmas-causing-issues-on-older-gcc-versions.patch @@ -1,6 +1,20 @@ ---- src/unix/core.c.orig -+++ src/unix/core.c -@@ -597,18 +597,31 @@ +From 7e212e1327bbc6b1a795f4a76dc8e88a6f8f27a8 Mon Sep 17 00:00:00 2001 +From: Ken Cunningham +Date: Tue, 21 May 2019 21:00:49 -0700 +Subject: [PATCH 2/3] prevent pragmas causing issues on older gcc versions + +See: https://github.com/macports/macports-ports/pull/4433 + +Co-authored-by: Michael Dickens +--- + src/unix/core.c | 27 ++++++++++++++++++++------- + 1 file changed, 20 insertions(+), 7 deletions(-) + +diff --git a/src/unix/core.c b/src/unix/core.c +index 61cbc0d0..0b22a395 100644 +--- a/src/unix/core.c ++++ b/src/unix/core.c +@@ -597,18 +597,31 @@ int uv__accept(int sockfd) { * will unwind the thread when it's in the cancel state. Work around that * by making the system call directly. Musl libc is unaffected. */ @@ -39,3 +53,6 @@ #elif defined(__linux__) && defined(__SANITIZE_THREAD__) && defined(__clang__) long rc; __sanitizer_syscall_pre_close(fd); +-- +2.48.0 + diff --git a/devel/libuv/files/0003-support-legacy-macos-pre-v11.patch b/devel/libuv/files/0003-support-legacy-macos-pre-v11.patch new file mode 100644 index 0000000000000..5b6a76b684f15 --- /dev/null +++ b/devel/libuv/files/0003-support-legacy-macos-pre-v11.patch @@ -0,0 +1,190 @@ +From cd703066aa2cc904ea376783469e4141cc14b33b Mon Sep 17 00:00:00 2001 +From: Ken Cunningham +Date: Mon, 12 Nov 2018 14:40:24 -0800 +Subject: [PATCH 3/3] support legacy macos (pre v11) + +See: https://github.com/libuv/libuv/blob/v1.x/SUPPORTED_PLATFORMS.md + +Co-authored-by: Michael Dickens +Co-authored-by: Sergey Fedorov +Co-authored-by: Evan Miller +--- + src/unix/fs.c | 4 ++-- + src/unix/process.c | 8 ++++++-- + src/unix/tty.c | 2 +- + src/unix/udp.c | 14 ++++++++------ + test/test-fs.c | 4 ++-- + 5 files changed, 19 insertions(+), 13 deletions(-) + +diff --git a/src/unix/fs.c b/src/unix/fs.c +index 239ecda1..424729e3 100644 +--- a/src/unix/fs.c ++++ b/src/unix/fs.c +@@ -1079,7 +1079,7 @@ static ssize_t uv__fs_sendfile(uv_fs_t* req) { + return -1; + } + /* sendfile() on iOS(arm64) will throw SIGSYS signal cause crash. */ +-#elif (defined(__APPLE__) && !TARGET_OS_IPHONE) \ ++#elif (defined(__APPLE__) && (!TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050))) \ + || defined(__DragonFly__) \ + || defined(__FreeBSD__) + { +@@ -1458,7 +1458,7 @@ static void uv__to_stat(struct stat* src, uv_stat_t* dst) { + dst->st_blksize = src->st_blksize; + dst->st_blocks = src->st_blocks; + +-#if defined(__APPLE__) ++#if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050) + dst->st_atim.tv_sec = src->st_atimespec.tv_sec; + dst->st_atim.tv_nsec = src->st_atimespec.tv_nsec; + dst->st_mtim.tv_sec = src->st_mtimespec.tv_sec; +diff --git a/src/unix/process.c b/src/unix/process.c +index f2038f2c..a3f885d4 100644 +--- a/src/unix/process.c ++++ b/src/unix/process.c +@@ -36,7 +36,9 @@ + #include + + #if defined(__APPLE__) ++#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 + # include ++#endif + # include + # include + # include +@@ -404,7 +406,7 @@ static void uv__process_child_init(const uv_process_options_t* options, + } + + +-#if defined(__APPLE__) ++#if defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) + typedef struct uv__posix_spawn_fncs_tag { + struct { + int (*addchdir_np)(const posix_spawn_file_actions_t *, const char *); +@@ -605,9 +607,11 @@ static int uv__spawn_set_posix_spawn_file_actions( + } + } + ++#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 + if (fd == use_fd) + err = posix_spawn_file_actions_addinherit_np(actions, fd); + else ++#endif + err = posix_spawn_file_actions_adddup2(actions, use_fd, fd); + assert(err != ENOSYS); + if (err != 0) +@@ -856,7 +860,7 @@ static int uv__spawn_and_init_child( + int exec_errorno; + ssize_t r; + +-#if defined(__APPLE__) ++#if defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) + uv_once(&posix_spawn_init_once, uv__spawn_init_posix_spawn); + + /* Special child process spawn case for macOS Big Sur (11.0) onwards +diff --git a/src/unix/tty.c b/src/unix/tty.c +index 793054ba..228b543d 100644 +--- a/src/unix/tty.c ++++ b/src/unix/tty.c +@@ -85,7 +85,7 @@ static int uv__tty_is_slave(const int fd) { + int dummy; + + result = ioctl(fd, TIOCGPTN, &dummy) != 0; +-#elif defined(__APPLE__) ++#elif defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 + char dummy[256]; + + result = ioctl(fd, TIOCPTYGNAME, &dummy) != 0; +diff --git a/src/unix/udp.c b/src/unix/udp.c +index 67c01f7d..754690ed 100644 +--- a/src/unix/udp.c ++++ b/src/unix/udp.c +@@ -152,7 +152,7 @@ static void uv__udp_io(uv_loop_t* loop, uv__io_t* w, unsigned int revents) { + } + + static int uv__udp_recvmmsg(uv_udp_t* handle, uv_buf_t* buf) { +-#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) ++#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) + struct sockaddr_in6 peers[20]; + struct iovec iov[ARRAY_SIZE(peers)]; + struct mmsghdr msgs[ARRAY_SIZE(peers)]; +@@ -215,9 +215,9 @@ static int uv__udp_recvmmsg(uv_udp_t* handle, uv_buf_t* buf) { + handle->recv_cb(handle, 0, buf, NULL, UV_UDP_MMSG_FREE); + } + return nread; +-#else /* __linux__ || ____FreeBSD__ || __APPLE__ */ ++#else /* __linux__ || __FreeBSD__ || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) */ + return UV_ENOSYS; +-#endif /* __linux__ || ____FreeBSD__ || __APPLE__ */ ++#endif /* __linux__ || __FreeBSD__ || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) */ + } + + static void uv__udp_recvmsg(uv_udp_t* handle) { +@@ -754,6 +754,7 @@ static int uv__udp_set_membership6(uv_udp_t* handle, + !defined(__ANDROID__) && \ + !defined(__DragonFly__) && \ + !defined(__QNX__) && \ ++ (!defined(__APPLE__) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070)) && \ + !defined(__GNU__) + static int uv__udp_set_source_membership4(uv_udp_t* handle, + const struct sockaddr_in* multicast_addr, +@@ -877,7 +878,7 @@ int uv__udp_init_ex(uv_loop_t* loop, + + + int uv_udp_using_recvmmsg(const uv_udp_t* handle) { +-#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) ++#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) + if (handle->flags & UV_HANDLE_UDP_RECVMMSG) + return 1; + #endif +@@ -945,6 +946,7 @@ int uv_udp_set_source_membership(uv_udp_t* handle, + !defined(__ANDROID__) && \ + !defined(__DragonFly__) && \ + !defined(__QNX__) && \ ++ (!defined(__APPLE__) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070)) && \ + !defined(__GNU__) + int err; + union uv__sockaddr mcast_addr; +@@ -1298,7 +1300,7 @@ static int uv__udp_sendmsgv(int fd, + r = 0; + nsent = 0; + +-#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) ++#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) + if (count > 1) { + for (i = 0; i < count; /*empty*/) { + struct mmsghdr m[20]; +@@ -1325,7 +1327,7 @@ static int uv__udp_sendmsgv(int fd, + + goto exit; + } +-#endif /* defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) */ ++#endif /* defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) */ + + for (i = 0; i < count; i++, nsent++) + if ((r = uv__udp_sendmsg1(fd, bufs[i], nbufs[i], addrs[i]))) +diff --git a/test/test-fs.c b/test/test-fs.c +index 423d72dd..36bb2df0 100644 +--- a/test/test-fs.c ++++ b/test/test-fs.c +@@ -1477,7 +1477,7 @@ TEST_IMPL(fs_fstat) { + ASSERT_OK(uv_fs_fstat(NULL, &req, file, NULL)); + ASSERT_OK(req.result); + s = req.ptr; +-# if defined(__APPLE__) ++# if defined(__APPLE__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050) + ASSERT_EQ(s->st_birthtim.tv_sec, t.st_birthtimespec.tv_sec); + ASSERT_EQ(s->st_birthtim.tv_nsec, t.st_birthtimespec.tv_nsec); + # elif defined(__linux__) +@@ -1518,7 +1518,7 @@ TEST_IMPL(fs_fstat) { + ASSERT_EQ(s->st_size, (uint64_t) t.st_size); + ASSERT_EQ(s->st_blksize, (uint64_t) t.st_blksize); + ASSERT_EQ(s->st_blocks, (uint64_t) t.st_blocks); +-#if defined(__APPLE__) ++# if defined(__APPLE__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050) + ASSERT_EQ(s->st_atim.tv_sec, t.st_atimespec.tv_sec); + ASSERT_EQ(s->st_atim.tv_nsec, t.st_atimespec.tv_nsec); + ASSERT_EQ(s->st_mtim.tv_sec, t.st_mtimespec.tv_sec); +-- +2.48.0 + diff --git a/devel/libuv/files/patch-libuv-fix-darwin-add-udp-mmsg-support.diff b/devel/libuv/files/patch-libuv-fix-darwin-add-udp-mmsg-support.diff deleted file mode 100644 index b839bb92f7fc9..0000000000000 --- a/devel/libuv/files/patch-libuv-fix-darwin-add-udp-mmsg-support.diff +++ /dev/null @@ -1,54 +0,0 @@ -Guards udp mmsg support from appearing in OS X <=10.6 - -See: 1c778bd001543371c915a79b7ac3c5864fe59e74 - ---- src/unix/udp.c.orig -+++ src/unix/udp.c -@@ -152,7 +152,7 @@ - } - - static int uv__udp_recvmmsg(uv_udp_t* handle, uv_buf_t* buf) { --#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) -+#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) - struct sockaddr_in6 peers[20]; - struct iovec iov[ARRAY_SIZE(peers)]; - struct mmsghdr msgs[ARRAY_SIZE(peers)]; -@@ -215,9 +215,9 @@ - handle->recv_cb(handle, 0, buf, NULL, UV_UDP_MMSG_FREE); - } - return nread; --#else /* __linux__ || ____FreeBSD__ || __APPLE__ */ -+#else /* __linux__ || __FreeBSD__ || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) */ - return UV_ENOSYS; --#endif /* __linux__ || ____FreeBSD__ || __APPLE__ */ -+#endif /* __linux__ || __FreeBSD__ || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) */ - } - - static void uv__udp_recvmsg(uv_udp_t* handle) { -@@ -878,7 +878,7 @@ - - - int uv_udp_using_recvmmsg(const uv_udp_t* handle) { --#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) -+#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) - if (handle->flags & UV_HANDLE_UDP_RECVMMSG) - return 1; - #endif -@@ -1300,7 +1300,7 @@ - r = 0; - nsent = 0; - --#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) -+#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) - if (count > 1) { - for (i = 0; i < count; /*empty*/) { - struct mmsghdr m[20]; -@@ -1327,7 +1327,7 @@ - - goto exit; - } --#endif /* defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) */ -+#endif /* defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) */ - - for (i = 0; i < count; i++, nsent++) - if ((r = uv__udp_sendmsg1(fd, bufs[i], nbufs[i], addrs[i]))) diff --git a/devel/libuv/files/patch-libuv-legacy-devel.diff b/devel/libuv/files/patch-libuv-legacy-devel.diff deleted file mode 100644 index f4e6f8990c46d..0000000000000 --- a/devel/libuv/files/patch-libuv-legacy-devel.diff +++ /dev/null @@ -1,111 +0,0 @@ ---- src/unix/fs.c.orig -+++ src/unix/fs.c -@@ -1079,7 +1079,7 @@ - return -1; - } - /* sendfile() on iOS(arm64) will throw SIGSYS signal cause crash. */ --#elif (defined(__APPLE__) && !TARGET_OS_IPHONE) \ -+#elif (defined(__APPLE__) && (!TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050))) \ - || defined(__DragonFly__) \ - || defined(__FreeBSD__) - { -@@ -1458,7 +1458,7 @@ - dst->st_blksize = src->st_blksize; - dst->st_blocks = src->st_blocks; - --#if defined(__APPLE__) -+#if defined(__APPLE__) && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1050) - dst->st_atim.tv_sec = src->st_atimespec.tv_sec; - dst->st_atim.tv_nsec = src->st_atimespec.tv_nsec; - dst->st_mtim.tv_sec = src->st_mtimespec.tv_sec; ---- src/unix/process.c.orig -+++ src/unix/process.c -@@ -36,7 +36,9 @@ - #include - - #if defined(__APPLE__) -+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 - # include -+#endif - # include - # include - # include -@@ -387,7 +389,7 @@ - #endif - - --#if defined(__APPLE__) -+#if defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) - typedef struct uv__posix_spawn_fncs_tag { - struct { - int (*addchdir_np)(const posix_spawn_file_actions_t *, const char *); -@@ -588,9 +590,11 @@ - } - } - -+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 - if (fd == use_fd) - err = posix_spawn_file_actions_addinherit_np(actions, fd); - else -+#endif - err = posix_spawn_file_actions_adddup2(actions, use_fd, fd); - assert(err != ENOSYS); - if (err != 0) -@@ -839,7 +843,7 @@ - int exec_errorno; - ssize_t r; - --#if defined(__APPLE__) -+#if defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1050) - uv_once(&posix_spawn_init_once, uv__spawn_init_posix_spawn); - - /* Special child process spawn case for macOS Big Sur (11.0) onwards ---- src/unix/tty.c.orig -+++ src/unix/tty.c -@@ -85,7 +85,7 @@ - int dummy; - - result = ioctl(fd, TIOCGPTN, &dummy) != 0; --#elif defined(__APPLE__) -+#elif defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 - char dummy[256]; - - result = ioctl(fd, TIOCPTYGNAME, &dummy) != 0; ---- src/unix/udp.c.orig -+++ src/unix/udp.c -@@ -938,6 +938,7 @@ - !defined(__ANDROID__) && \ - !defined(__DragonFly__) && \ - !defined(__QNX__) && \ -+ (!defined(__APPLE__) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070)) && \ - !defined(__GNU__) - static int uv__udp_set_source_membership4(uv_udp_t* handle, - const struct sockaddr_in* multicast_addr, -@@ -1131,6 +1132,7 @@ - !defined(__ANDROID__) && \ - !defined(__DragonFly__) && \ - !defined(__QNX__) && \ -+ (!defined(__APPLE__) || (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070)) && \ - !defined(__GNU__) - int err; - union uv__sockaddr mcast_addr; ---- test/test-fs.c.orig -+++ test/test-fs.c -@@ -1477,7 +1477,7 @@ - ASSERT_OK(uv_fs_fstat(NULL, &req, file, NULL)); - ASSERT_OK(req.result); - s = req.ptr; --# if defined(__APPLE__) -+# if defined(__APPLE__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050) - ASSERT_EQ(s->st_birthtim.tv_sec, t.st_birthtimespec.tv_sec); - ASSERT_EQ(s->st_birthtim.tv_nsec, t.st_birthtimespec.tv_nsec); - # elif defined(__linux__) -@@ -1518,7 +1518,7 @@ - ASSERT_EQ(s->st_size, (uint64_t) t.st_size); - ASSERT_EQ(s->st_blksize, (uint64_t) t.st_blksize); - ASSERT_EQ(s->st_blocks, (uint64_t) t.st_blocks); --#if defined(__APPLE__) -+# if defined(__APPLE__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050) - ASSERT_EQ(s->st_atim.tv_sec, t.st_atimespec.tv_sec); - ASSERT_EQ(s->st_atim.tv_nsec, t.st_atimespec.tv_nsec); - ASSERT_EQ(s->st_mtim.tv_sec, t.st_mtimespec.tv_sec); From 6ae2d1e2b2c7febbbcd69d52af2143adedc53501 Mon Sep 17 00:00:00 2001 From: Chris Rawnsley Date: Thu, 20 Feb 2025 22:20:15 +0000 Subject: [PATCH 5/6] squash! libuv-devel: update to 1.50.0 Add in Fred Wright's patch --- devel/libuv/Portfile | 2 +- ...001-Revert-darwin-simplify-uv_hrtime.patch | 53 ------------------- ...nuous_time-for-clock_gettime_nsec_np.patch | 53 +++++++++++++++++++ ...causing-issues-on-older-gcc-versions.patch | 2 +- .../0003-support-legacy-macos-pre-v11.patch | 2 +- 5 files changed, 56 insertions(+), 56 deletions(-) delete mode 100644 devel/libuv/files/0001-Revert-darwin-simplify-uv_hrtime.patch create mode 100644 devel/libuv/files/0001-swap-mach_continuous_time-for-clock_gettime_nsec_np.patch diff --git a/devel/libuv/Portfile b/devel/libuv/Portfile index e6c3be0f0c2c4..28858adceed9b 100644 --- a/devel/libuv/Portfile +++ b/devel/libuv/Portfile @@ -59,7 +59,7 @@ if {${subport} eq ${name}} { patch.pre_args-replace \ -p0 -p1 patchfiles-append \ - 0001-Revert-darwin-simplify-uv_hrtime.patch \ + 0001-swap-mach_continuous_time-for-clock_gettime_nsec_np.patch \ 0002-prevent-pragmas-causing-issues-on-older-gcc-versions.patch \ 0003-support-legacy-macos-pre-v11.patch diff --git a/devel/libuv/files/0001-Revert-darwin-simplify-uv_hrtime.patch b/devel/libuv/files/0001-Revert-darwin-simplify-uv_hrtime.patch deleted file mode 100644 index 00c9b915bf38a..0000000000000 --- a/devel/libuv/files/0001-Revert-darwin-simplify-uv_hrtime.patch +++ /dev/null @@ -1,53 +0,0 @@ -From c737e4d9756308e1f848af394285d9d3151bf8f9 Mon Sep 17 00:00:00 2001 -From: Sergey Fedorov -Date: Fri, 3 Jan 2025 14:40:05 +0800 -Subject: [PATCH 1/3] Revert "darwin: simplify uv_hrtime" - -This reverts commit c0a61c3bb323724532fa9c1ac190afb36e4ae264. - -Required for support on MacOS <10.15 ---- - src/unix/darwin.c | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/src/unix/darwin.c b/src/unix/darwin.c -index 009efbef..5e764a65 100644 ---- a/src/unix/darwin.c -+++ b/src/unix/darwin.c -@@ -25,6 +25,7 @@ - #include - #include - -+#include - #include - #include - #include /* _NSGetExecutablePath */ -@@ -33,6 +34,7 @@ - #include /* sysconf */ - - static uv_once_t once = UV_ONCE_INIT; -+static uint64_t (*time_func)(void); - static mach_timebase_info_data_t timebase; - - -@@ -54,12 +56,16 @@ void uv__platform_loop_delete(uv_loop_t* loop) { - static void uv__hrtime_init_once(void) { - if (KERN_SUCCESS != mach_timebase_info(&timebase)) - abort(); -+ -+ time_func = (uint64_t (*)(void)) dlsym(RTLD_DEFAULT, "mach_continuous_time"); -+ if (time_func == NULL) -+ time_func = mach_absolute_time; - } - - - uint64_t uv__hrtime(uv_clocktype_t type) { - uv_once(&once, uv__hrtime_init_once); -- return mach_continuous_time() * timebase.numer / timebase.denom; -+ return time_func() * timebase.numer / timebase.denom; - } - - --- -2.48.0 - diff --git a/devel/libuv/files/0001-swap-mach_continuous_time-for-clock_gettime_nsec_np.patch b/devel/libuv/files/0001-swap-mach_continuous_time-for-clock_gettime_nsec_np.patch new file mode 100644 index 0000000000000..a88eb31616036 --- /dev/null +++ b/devel/libuv/files/0001-swap-mach_continuous_time-for-clock_gettime_nsec_np.patch @@ -0,0 +1,53 @@ +From 304a518853ff6400fbd661a2461e38f47f7be656 Mon Sep 17 00:00:00 2001 +From: Fred Wright +Date: Wed, 19 Feb 2025 23:47:55 +0000 +Subject: [PATCH 1/3] swap mach_continuous_time for clock_gettime_nsec_np + +See: https://github.com/macports/macports-ports/pull/27671#issuecomment-2664257623 +See: https://github.com/macports/macports-ports/pull/27671#issuecomment-2670030330 +--- + src/unix/darwin.c | 14 +++----------- + 1 file changed, 3 insertions(+), 11 deletions(-) + +diff --git a/src/unix/darwin.c b/src/unix/darwin.c +index 009efbef..e9f86490 100644 +--- a/src/unix/darwin.c ++++ b/src/unix/darwin.c +@@ -25,15 +25,13 @@ + #include + #include + +-#include +-#include ++#include + #include /* _NSGetExecutablePath */ + #include + #include + #include /* sysconf */ + + static uv_once_t once = UV_ONCE_INIT; +-static mach_timebase_info_data_t timebase; + + + int uv__platform_loop_init(uv_loop_t* loop) { +@@ -51,15 +49,9 @@ void uv__platform_loop_delete(uv_loop_t* loop) { + } + + +-static void uv__hrtime_init_once(void) { +- if (KERN_SUCCESS != mach_timebase_info(&timebase)) +- abort(); +-} +- +- + uint64_t uv__hrtime(uv_clocktype_t type) { +- uv_once(&once, uv__hrtime_init_once); +- return mach_continuous_time() * timebase.numer / timebase.denom; ++ (void) type; ++ return clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW); + } + + +-- +2.48.0 + diff --git a/devel/libuv/files/0002-prevent-pragmas-causing-issues-on-older-gcc-versions.patch b/devel/libuv/files/0002-prevent-pragmas-causing-issues-on-older-gcc-versions.patch index caf7b214d80f5..b74412215f8d9 100644 --- a/devel/libuv/files/0002-prevent-pragmas-causing-issues-on-older-gcc-versions.patch +++ b/devel/libuv/files/0002-prevent-pragmas-causing-issues-on-older-gcc-versions.patch @@ -1,4 +1,4 @@ -From 7e212e1327bbc6b1a795f4a76dc8e88a6f8f27a8 Mon Sep 17 00:00:00 2001 +From 9d6c5364932ae7fef006d4b9113d34d922f88716 Mon Sep 17 00:00:00 2001 From: Ken Cunningham Date: Tue, 21 May 2019 21:00:49 -0700 Subject: [PATCH 2/3] prevent pragmas causing issues on older gcc versions diff --git a/devel/libuv/files/0003-support-legacy-macos-pre-v11.patch b/devel/libuv/files/0003-support-legacy-macos-pre-v11.patch index 5b6a76b684f15..e3e8b0c03a046 100644 --- a/devel/libuv/files/0003-support-legacy-macos-pre-v11.patch +++ b/devel/libuv/files/0003-support-legacy-macos-pre-v11.patch @@ -1,4 +1,4 @@ -From cd703066aa2cc904ea376783469e4141cc14b33b Mon Sep 17 00:00:00 2001 +From bf3f1cc29b9d64571dcf5213e2b48c0462227c37 Mon Sep 17 00:00:00 2001 From: Ken Cunningham Date: Mon, 12 Nov 2018 14:40:24 -0800 Subject: [PATCH 3/3] support legacy macos (pre v11) From 584f34b9e7b4729011acd55f57bb61a05c1d73f8 Mon Sep 17 00:00:00 2001 From: Chris Rawnsley Date: Thu, 20 Feb 2025 23:57:41 +0000 Subject: [PATCH 6/6] squash! libuv-devel: update to 1.50.0 Restrict recvmsg_x/sendmsg_x to 10.10+ --- .../0003-support-legacy-macos-pre-v11.patch | 40 +++++++++++++------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/devel/libuv/files/0003-support-legacy-macos-pre-v11.patch b/devel/libuv/files/0003-support-legacy-macos-pre-v11.patch index e3e8b0c03a046..3c1b7deab65b4 100644 --- a/devel/libuv/files/0003-support-legacy-macos-pre-v11.patch +++ b/devel/libuv/files/0003-support-legacy-macos-pre-v11.patch @@ -1,4 +1,4 @@ -From bf3f1cc29b9d64571dcf5213e2b48c0462227c37 Mon Sep 17 00:00:00 2001 +From 142c42613441cd61ef911c794d39f6a06911f505 Mon Sep 17 00:00:00 2001 From: Ken Cunningham Date: Mon, 12 Nov 2018 14:40:24 -0800 Subject: [PATCH 3/3] support legacy macos (pre v11) @@ -9,12 +9,13 @@ Co-authored-by: Michael Dickens Co-authored-by: Sergey Fedorov Co-authored-by: Evan Miller --- - src/unix/fs.c | 4 ++-- - src/unix/process.c | 8 ++++++-- - src/unix/tty.c | 2 +- - src/unix/udp.c | 14 ++++++++------ - test/test-fs.c | 4 ++-- - 5 files changed, 19 insertions(+), 13 deletions(-) + src/unix/fs.c | 4 ++-- + src/unix/internal.h | 2 +- + src/unix/process.c | 8 ++++++-- + src/unix/tty.c | 2 +- + src/unix/udp.c | 14 ++++++++------ + test/test-fs.c | 4 ++-- + 6 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/unix/fs.c b/src/unix/fs.c index 239ecda1..424729e3 100644 @@ -38,6 +39,19 @@ index 239ecda1..424729e3 100644 dst->st_atim.tv_sec = src->st_atimespec.tv_sec; dst->st_atim.tv_nsec = src->st_atimespec.tv_nsec; dst->st_mtim.tv_sec = src->st_mtimespec.tv_sec; +diff --git a/src/unix/internal.h b/src/unix/internal.h +index b1d2b217..83fa32d8 100644 +--- a/src/unix/internal.h ++++ b/src/unix/internal.h +@@ -75,7 +75,7 @@ + # include + #endif /* _AIX */ + +-#if defined(__APPLE__) ++#if (defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 101000) + # include "darwin-syscalls.h" + # if !TARGET_OS_IPHONE + # include diff --git a/src/unix/process.c b/src/unix/process.c index f2038f2c..a3f885d4 100644 --- a/src/unix/process.c @@ -96,7 +110,7 @@ index 793054ba..228b543d 100644 result = ioctl(fd, TIOCPTYGNAME, &dummy) != 0; diff --git a/src/unix/udp.c b/src/unix/udp.c -index 67c01f7d..754690ed 100644 +index 67c01f7d..8417178f 100644 --- a/src/unix/udp.c +++ b/src/unix/udp.c @@ -152,7 +152,7 @@ static void uv__udp_io(uv_loop_t* loop, uv__io_t* w, unsigned int revents) { @@ -104,7 +118,7 @@ index 67c01f7d..754690ed 100644 static int uv__udp_recvmmsg(uv_udp_t* handle, uv_buf_t* buf) { -#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) -+#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) ++#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 101000)) struct sockaddr_in6 peers[20]; struct iovec iov[ARRAY_SIZE(peers)]; struct mmsghdr msgs[ARRAY_SIZE(peers)]; @@ -113,10 +127,10 @@ index 67c01f7d..754690ed 100644 } return nread; -#else /* __linux__ || ____FreeBSD__ || __APPLE__ */ -+#else /* __linux__ || __FreeBSD__ || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) */ ++#else /* __linux__ || __FreeBSD__ || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 101000)) */ return UV_ENOSYS; -#endif /* __linux__ || ____FreeBSD__ || __APPLE__ */ -+#endif /* __linux__ || __FreeBSD__ || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) */ ++#endif /* __linux__ || __FreeBSD__ || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 101000)) */ } static void uv__udp_recvmsg(uv_udp_t* handle) { @@ -150,7 +164,7 @@ index 67c01f7d..754690ed 100644 nsent = 0; -#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) -+#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) ++#if defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 101000)) if (count > 1) { for (i = 0; i < count; /*empty*/) { struct mmsghdr m[20]; @@ -159,7 +173,7 @@ index 67c01f7d..754690ed 100644 goto exit; } -#endif /* defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) */ -+#endif /* defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1070)) */ ++#endif /* defined(__linux__) || defined(__FreeBSD__) || (defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 101000)) */ for (i = 0; i < count; i++, nsent++) if ((r = uv__udp_sendmsg1(fd, bufs[i], nbufs[i], addrs[i])))