Skip to contentSkip to conversation

Makefile: suppress macOS deprecation warning

PATCH In review Stefan Sundin via GitGitGadget 4 participants 5 messages Nov 19, 2022 – Dec 1, 2022 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: suppress macOS deprecation warning

From: Stefan Sundin <[email protected]>

Compiling git on macOS 13 emits the following deprecation warning:

        CC compat/fsmonitor/fsm-listen-darwin.o
    compat/fsmonitor/fsm-listen-darwin.c:495:2: warning: 'FSEventStreamScheduleWithRunLoop' is deprecated: first deprecated in macOS 13.0 - Use FSEventStreamSetDispatchQueue instead. [-Wdeprecated-declarations]
            FSEventStreamScheduleWithRunLoop(data->stream, data->rl, kCFRunLoopDefaultMode);
            ^
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:1138:1: note: 'FSEventStreamScheduleWithRunLoop' has been explicitly marked deprecated here
    FSEventStreamScheduleWithRunLoop(
    ^
    1 warning generated.

Setting a minimum macOS version will suppress this deprecation warning. Using a version lower than 10.13 will cause other warning messages to be emitted.

---
Makefile: suppress macOS deprecation warning

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1422%2Fstefansundin%2Fmacosx-version-min-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1422/stefansundin/macosx-version-min-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1422

 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +1 -0
index 4927379184c..8a729efd2d1 100644
@@ -1430,6 +1430,7 @@ ifneq (,$(SOCKLEN_T))
 endif
 
 ifeq ($(uname_S),Darwin)
+	BASIC_CFLAGS += -mmacosx-version-min=10.13
 	ifndef NO_FINK
 		ifeq ($(shell test -d /sw/lib && echo y),y)
 			BASIC_CFLAGS += -I/sw/include

base-commit: eea7033409a0ed713c78437fc76486983d211e25

Signature · 1 line
gitgitgadget
#1 lore raw
Quoted 13 lines · Stefan Sundin via GitGitGadget

From: Stefan Sundin <[email protected]>

Compiling git on macOS 13 emits the following deprecation warning:

        CC compat/fsmonitor/fsm-listen-darwin.o
    compat/fsmonitor/fsm-listen-darwin.c:495:2: warning: 'FSEventStreamScheduleWithRunLoop' is deprecated: first deprecated in macOS 13.0 - Use FSEventStreamSetDispatchQueue instead. [-Wdeprecated-declarations]
            FSEventStreamScheduleWithRunLoop(data->stream, data->rl, kCFRunLoopDefaultMode);
            ^
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:1138:1: note: 'FSEventStreamScheduleWithRunLoop' has been explicitly marked deprecated here
    FSEventStreamScheduleWithRunLoop(
    ^
    1 warning generated.
Quoted 4 lines

Setting a minimum macOS version will suppress this deprecation warning. Using a version lower than 10.13 will cause other warning messages to be emitted.

Why don't instead follow the suggestion on the warning message (FSEventStreamSetDispatchQueue) instead?

Signature · 1 line
An old man doll... just what I always wanted! - Clara
#2 lore raw
Quoted 20 lines · Bagas Sanjaya
Quoted 13 lines · Stefan Sundin via GitGitGadget

From: Stefan Sundin <[email protected]>

Compiling git on macOS 13 emits the following deprecation warning:

        CC compat/fsmonitor/fsm-listen-darwin.o
    compat/fsmonitor/fsm-listen-darwin.c:495:2: warning: 'FSEventStreamScheduleWithRunLoop' is deprecated: first deprecated in macOS 13.0 - Use FSEventStreamSetDispatchQueue instead. [-Wdeprecated-declarations]
            FSEventStreamScheduleWithRunLoop(data->stream, data->rl, kCFRunLoopDefaultMode);
            ^
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h:1138:1: note: 'FSEventStreamScheduleWithRunLoop' has been explicitly marked deprecated here
    FSEventStreamScheduleWithRunLoop(
    ^
    1 warning generated.
Quoted 4 lines

Setting a minimum macOS version will suppress this deprecation warning. Using a version lower than 10.13 will cause other warning messages to be emitted.

Quoted 5 lines

Why don't instead follow the suggestion on the warning message (FSEventStreamSetDispatchQueue) instead?

--
An old man doll... just what I always wanted! - Clara

You are right, Bagas. I assumed, without actually looking it up, that the new function had a higher-than-acceptable minimum macOS version requirement. It turns out that the new function was added in 10.6 which is far better than requiring 10.13.

Please disregard this patch and I will attempt to update the code to use the new function instead.

#3 lore raw
Quoted 7 lines · Stefan Sundin

You are right, Bagas. I assumed, without actually looking it up, that the new function had a higher-than-acceptable minimum macOS version requirement. It turns out that the new function was added in 10.6 which is far better than requiring 10.13.

Please disregard this patch and I will attempt to update the code to use the new function instead.

OK. But unfortunately, I don't have any macOS machines handy, so I can't test your future patch.

Thanks.

Signature · 1 line
An old man doll... just what I always wanted! - Clara
#4 lore raw
Quoted 6 lines · Bagas Sanjaya
Quoted 5 lines · Stefan Sundin

You are right, Bagas. I assumed, without actually looking it up, that the new function had a higher-than-acceptable minimum macOS version requirement. It turns out that the new function was added in 10.6 which is far better than requiring 10.13.

Quoted 8 lines
Quoted 2 lines

Please disregard this patch and I will attempt to update the code to use the new function instead.

OK. But unfortunately, I don't have any macOS machines handy, so I can't test your future patch.

Thanks.

As I mentioned in another thread, I'm working on a solution for this deprecated function. As soon the CI builds finish I'll submit it.

Jeff