-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libuv-devel: update to 1.50.0 #27671
Open
casr
wants to merge
6
commits into
macports:master
Choose a base branch
from
casr:libuv-1.50.0-devel
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+333
−199
Open
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9d65f65
libuv-devel: update to 1.50.0
casr 85067ac
squash! libuv-devel: update to 1.50.0
casr d586f7d
squash! libuv-devel: update to 1.50.0
casr b28f0fc
squash! libuv-devel: update to 1.50.0
casr 6ae2d1e
squash! libuv-devel: update to 1.50.0
casr 584f34b
squash! libuv-devel: update to 1.50.0
casr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,15 @@ | ||
From 97b062503185cbafaf80cb5ec1da1c1c953411e1 Mon Sep 17 00:00:00 2001 | ||
From: barracuda156 <[email protected]> | ||
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,31 +18,28 @@ 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 <poll.h> | ||
|
||
#if defined(__APPLE__) | ||
-# include <spawn.h> | ||
+# if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 | ||
+# include <spawn.h> | ||
+# endif | ||
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 | ||
# include <spawn.h> | ||
+#endif | ||
# include <paths.h> | ||
# include <sys/kauth.h> | ||
# include <sys/types.h> | ||
@@ -407,7 +409,7 @@ static void uv__process_child_init(const uv_process_options_t* options, | ||
} | ||
@@ -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 *); | ||
@@ -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,36 +60,52 @@ 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__) && \ | ||
+ (!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, | ||
@@ -1083,6 +1084,7 @@ int uv_udp_set_source_membership(uv_udp_t* handle, | ||
@@ -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); |
41 changes: 41 additions & 0 deletions
41
devel/libuv/files/patch-libuv-unix-core-close-nocancel-devel.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@barracuda156 Do you know if this is sufficient as compared with the patch? The patch originally commented out DragonFlyBSD's, FreeBSD's, etc as well which seemed unnecessary for Tiger to work.
If it is necessary then the regex could instead be:
which would yield a similar result to the patch.
(Extra context: I changed this to be a
reinplace
instead because this file is dynamically created by automake so will more likely apply in the future)