git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] fsmonitor: eliminate call to deprecated FSEventStream function

From
SSStefan Sundin <git@stefansundin.com>
Date
Dec 2, 2022, 21:44 UTC
Message-ID
<CAMDaVWGKx3YMuzRvqGTvvcwh1y9CotFtOCpyAzm=QW3YLy5ROg@mail.gmail.com>
In-Reply-To
<1b090929-f2da-f075-01d4-458804fc0717@github.com>

On Fri, Dec 2, 2022 at 6:24 AM Jeff Hostetler via GitGitGadget <gitgitgadget@gmail.com> wrote:

Show 6 quoted lines
> The MacOS version of the builtin FSMonitor feature uses the
> `FSEventStreamScheduleWithRunLoop()` function to drive the event loop
> and process FSEvents from the system.  This routine has now been
> deprecated by Apple.  The MacOS 13 (Ventana) compiler tool chain now
> generates a warning when compiling calls to this function.  In
> DEVELOPER=1 mode, this now causes a compile error.
Typo here, MacOS 13 is Ventura not Ventana.
On Fri, Dec 2, 2022 at 1:17 PM Victoria Dye <vdye@github.com> wrote:
Show 9 quoted lines
> My point is that such a user for this scenario is so unlikely to exist that
> holding up this patch - which provides a real, tangible benefit to
> developers *right now* - to implement your suggestion or modify the commit
> message is, at best, an unnecessary distraction.
>
> If, somewhere, there is a user that 1) keeps up-to-date with the latest
> version of Git, 2) uses FSMonitor, and 3) is working on the sole version of
> MacOS that was theoretically compatible with FSMonitor before this change
> but now is not, we can accommodate that once such a need is shown to exist.

Looking at config.mak.uname it seems quite easy to keep git working on old MacOS versions by adding a check like Ævar suggested.

Something like this:
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -161,12 +161,15 @@ ifeq ($(uname_S),Darwin)

        # The builtin FSMonitor on MacOS builds upon Simple-IPC.  Both require
        # Unix domain sockets and PThreads.
+       # FSMonitor on Darwin requires MacOS 10.6 or later.
        ifndef NO_PTHREADS
        ifndef NO_UNIX_SOCKETS
+       ifeq ($(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`"
-ge 10 && echo 1),1)
        FSMONITOR_DAEMON_BACKEND = darwin
        FSMONITOR_OS_SETTINGS = darwin
        endif
        endif
+       endif

        BASIC_LDFLAGS += -framework CoreServices
 endif


Looking at that file it seems like a lot of care has gone into keeping
compatibility with older MacOS versions so in my mind it seems
appropriate to continue that legacy, especially since it is so easy.

Great work Jeff.
Previous: Victoria DyeNext: Ævar Arnfjörð Bjarmason
Message 9 of 17 in “fsmonitor: eliminate call to deprecated FSEventStream function”
  1. fsmonitor: eliminate call to deprecated FSEventStream functionJeff Hostetler via GitGitGadget, Dec 2, 2022
  2. Victoria DyeDec 2, 2022
  3. Ævar Arnfjörð BjarmasonDec 2, 2022
  4. Jeff HostetlerDec 2, 2022
  5. Ævar Arnfjörð BjarmasonDec 2, 2022
  6. Victoria DyeDec 2, 2022
  7. Ævar Arnfjörð BjarmasonDec 2, 2022
  8. Victoria DyeDec 2, 2022
  9. Stefan SundinDec 2, 2022
  10. Ævar Arnfjörð BjarmasonDec 2, 2022
  11. Junio C HamanoDec 3, 2022
  12. Junio C HamanoDec 5, 2022
  13. Jeff HostetlerDec 5, 2022
  14. Junio C HamanoDec 5, 2022
  15. Jeff HostetlerDec 6, 2022
  16. fsmonitor: eliminate call to deprecated FSEventStream functionJeff Hostetler via GitGitGadget, Dec 14, 2022
  17. Junio C HamanoDec 15, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.