From d82a473876bea4cd7e348d36462f2876011a752a Mon Sep 17 00:00:00 2001 From: "Jesse A. Tov" Date: Mon, 18 Jul 2022 18:56:17 -0400 Subject: [PATCH 1/3] On macOS >= 12, don't use vfork(2). It's deprecated. Use fork(2) instead. Signed-off-by: Jesse A. Tov --- src/spawn_stubs.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/spawn_stubs.c b/src/spawn_stubs.c index c2e60be..bde857b 100644 --- a/src/spawn_stubs.c +++ b/src/spawn_stubs.c @@ -50,6 +50,13 @@ CAMLprim value spawn_is_osx() #if defined(__APPLE__) +/* vfork(2) is deprecated on macOS >= 12, so we use fork(2) instead. */ +#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) +# if __MAC_OS_X_VERSION_MAX_ALLOWED >= 120000 +# define vfork fork +# endif +#endif + static int safe_pipe(int fd[2]) { int i; From a3a885b583c27ef11e7ecc2c9272fb01cd47fc50 Mon Sep 17 00:00:00 2001 From: "Jesse A. Tov" Date: Tue, 19 Jul 2022 09:36:17 -0400 Subject: [PATCH 2/3] CI: Specify macOS versions 11 and 12 for testing vfork(2) is deprecated on macOS 12, so we need to test on both. Signed-off-by: Jesse Tov --- .github/workflows/workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index ca4a1f9..61e4031 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -18,7 +18,7 @@ jobs: # We test: # - once for each architecture with the latest OCaml # - once for a few older versions of OCaml under Linux - os: [macos-latest, ubuntu-latest, windows-latest] + os: [macos-11, macos-12, ubuntu-latest, windows-latest] ocaml: [4.14.0] include: - {os: ubuntu-latest, ocaml: 4.13.1} From 1c2ad578cb6595511f17e88e14dbcbf1f3530358 Mon Sep 17 00:00:00 2001 From: "Jesse A. Tov" Date: Wed, 22 Mar 2023 12:22:22 -0400 Subject: [PATCH 3/3] Indentation Because I can't figure out how to run the CI without making a change. Signed-off-by: Jesse A. Tov --- src/spawn_stubs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/spawn_stubs.c b/src/spawn_stubs.c index bde857b..69a1844 100644 --- a/src/spawn_stubs.c +++ b/src/spawn_stubs.c @@ -51,11 +51,11 @@ CAMLprim value spawn_is_osx() #if defined(__APPLE__) /* vfork(2) is deprecated on macOS >= 12, so we use fork(2) instead. */ -#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) -# if __MAC_OS_X_VERSION_MAX_ALLOWED >= 120000 -# define vfork fork +# if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) +# if __MAC_OS_X_VERSION_MAX_ALLOWED >= 120000 +# define vfork fork +# endif # endif -#endif static int safe_pipe(int fd[2]) {