monome / serialosc

multi-device, bonjour-capable monome OSC server
http://monome.org/docs/serialosc/osc
Other
145 stars 31 forks source link

Set min. macOS deploy target to 10.13 for fmemopen #71

Closed timsutton closed 5 months ago

timsutton commented 5 months ago

When updating serialosc in homebrew, I realized that it didn't seem to build on Darwin since (?) the addition of fmemopen, since this API was only added in OS X 10.13:

==> python3 ./waf build
  Waf: Entering directory `/private/tmp/serialosc-20240114-4751-lp9158/build'
  [ 1/23] Compiling src/common/util.c
  [ 2/23] Compiling src/common/ipc.c
  [ 3/23] Compiling src/common/platform/darwin.c
  [ 4/23] Compiling src/common/platform/posix.c
  [ 5/23] Compiling third-party/confuse/reallocarray.c
  [ 6/23] Compiling third-party/confuse/confuse.c
  [ 7/23] Compiling third-party/confuse/lexer.c
  [ 8/23] Compiling src/serialoscd/uv.c
  [ 9/23] Compiling src/serialosc-detector/iokitlib.c
  ../third-party/confuse/confuse.c:792:10: error: 'fmemopen' is only available on macOS 10.13 or newer [-Werror,-Wunguarded-availability-new]
                                  fp = fmemopen(buf, strlen(buf), "r");
                                       ^~~~~~~~
  /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/stdio.h:366:7: note: 'fmemopen' has been marked as being introduced in macOS 10.13 here, but the deployment target is macOS 10.5.0
  FILE *fmemopen(void * __restrict __buf, size_t __size, const char * __restrict __mode) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
        ^
  ../third-party/confuse/confuse.c:792:10: note: enclose 'fmemopen' in a __builtin_available check to silence this warning
                                  fp = fmemopen(buf, strlen(buf), "r");
                                       ^~~~~~~~
  ../third-party/confuse/confuse.c:1829:7: error: 'fmemopen' is only available on macOS 10.13 or newer [-Werror,-Wunguarded-availability-new]
          fp = fmemopen((void *)buf, strlen(buf), "r");
               ^~~~~~~~
  /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/stdio.h:366:7: note: 'fmemopen' has been marked as being introduced in macOS 10.13 here, but the deployment target is macOS 10.5.0
  FILE *fmemopen(void * __restrict __buf, size_t __size, const char * __restrict __mode) __API_AVAILABLE(macos(10.13), ios(11.0), tvos(11.0), watchos(4.0));
        ^
  ../third-party/confuse/confuse.c:1829:7: note: enclose 'fmemopen' in a __builtin_available check to silence this warning
          fp = fmemopen((void *)buf, strlen(buf), "r");
               ^~~~~~~~
  2 errors generated.

  Waf: Leaving directory `/private/tmp/serialosc-20240[114](https://github.com/Homebrew/homebrew-core/actions/runs/7522449788/job/20474502425?pr=159939#step:3:115)-4751-lp9158/build'
  Build failed

I'm not well familiar with building serialosc but I added this patch in order for it to build successfully.

artfwo commented 5 months ago

fmemopen calls could be wrapped in __builtin_available check here, but that is probably better to do in libconfuse rather than our local copy.

i'm fine with bumping the min target platform though, so merging this as is, thanks!