From: "nobu (Nobuyoshi Nakada)" Date: 2022-10-02T07:47:33+00:00 Subject: [ruby-core:110166] [Ruby master Bug#19034] Ruby 3.2.0 build failure on macOS 10.12.6, which does not have utimensat Issue #19034 has been updated by nobu (Nobuyoshi Nakada). This seems unmatched `#if`/`#endif`. ```diff commit b893b976c820f1f3c9ddfe26d1b84d2aefd5464f Author: David Bohman AuthorDate: 2022-10-02 09:40:48 +0900 Commit: David Bohman CommitDate: 2022-10-02 09:40:48 +0900 File build failure on macOS 10.12.6, which does not have utimensat. diff --git a/file.c b/file.c index 709c33cca7c..7815de53409 100644 --- a/file.c +++ b/file.c @@ -2876,6 +2876,7 @@ utime_failed(struct apply_arg *aa) # if defined(__APPLE__) && \ (!defined(MAC_OS_X_VERSION_13_0) || (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_13_0)) +# if defined(HAVE_UTIMENSAT) # if defined(__has_attribute) && __has_attribute(availability) typedef int utimensat_func(int, const char *, const struct timespec [2], int); @@ -2887,6 +2888,7 @@ rb_utimensat(void) return &utimensat; } RBIMPL_WARNING_POP() +# endif # define utimensat rb_utimensat() # else /* __API_AVAILABLE macro does nothing on gcc */ ``` Does this work? ```diff diff --git a/file.c b/file.c index 709c33cca7c..6d248afc39b 100644 --- a/file.c +++ b/file.c @@ -2873,7 +2873,9 @@ utime_failed(struct apply_arg *aa) #if defined(HAVE_UTIMES) -# if defined(__APPLE__) && \ +# if !defined(HAVE_UTIMENSAT) +/* utimensat() is not found, runtime check is not needed */ +# elif defined(__APPLE__) && \ (!defined(MAC_OS_X_VERSION_13_0) || (MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_13_0)) # if defined(__has_attribute) && __has_attribute(availability) ``` ---------------------------------------- Bug #19034: Ruby 3.2.0 build failure on macOS 10.12.6, which does not have utimensat https://bugs.ruby-lang.org/issues/19034#change-99422 * Author: debo (David Bohman) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.0dev (2022-10-01T09:53:41Z master-mod 88c12a2937) [x86_64-darwin16] * Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- Ruby 3.2.0 does not build on macOS 10.12.6 due to the lack of utimensat() on that system. I have opened a pull request on GitHub. -- https://bugs.ruby-lang.org/ Unsubscribe: