From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f173.google.com (mail-dy1-f173.google.com [74.125.82.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A502130FC26 for ; Thu, 5 Mar 2026 06:55:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772693728; cv=none; b=tl2aoPmCOeOnK8fYjSrlzk9OShHU7Zt2AH9YU9yIKQW5b3XfyOK3X/WHRrUpVi3eFrgBB2ceScdZZMTepgIOxL2wfJURZDMgxsPOa21l/eZvcZ3j+zyhse9oylvT2n8hdz3+IOdIbC+UObEHnRv2W7TlB0EUyKmnkagU+pN5Eec= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772693728; c=relaxed/simple; bh=EsgHUGDMRhuks515iSzmHNeqU4szO86Gm6UxEyphQ9E=; h=Message-Id:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=fuYgJe3lZszmeo1Fkn09/CDgnSUfpkkSPaBE8Ffg6ZQ7Hz3ykB6sAx/lGWGtSUNtqNu1+uoZXP2RRyFjKIyhOP/lHtwqHErDp9HsefoTPnBPVGNPZ6Sq+5/TVX7kGS2fGACBXUxdyFrQRiiUdyv4vrEfj1y62V/viXFSpYi7f9A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hRUp+B6Q; arc=none smtp.client-ip=74.125.82.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hRUp+B6Q" Received: by mail-dy1-f173.google.com with SMTP id 5a478bee46e88-2b6b0500e06so9506279eec.1 for ; Wed, 04 Mar 2026 22:55:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772693726; x=1773298526; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=hfq55mn7MJ04jqjtTP4/AbbAEktb2oJtSvHfgUnB3sY=; b=hRUp+B6QtV/sNatMRoom8udwDEo8X6ojqmRrr5MqEhVNlJK+ts1uNXPrgKDByQIsez VvdbTeo2YC6orbdgNF7WlBa3mzD9Vl5s+wT2ugFITwbgkFl3vBW/IPiz7qClhpre1/dA FHT03l257w6W3BHGi0I8qBFGc3euw3UU84enBEmfdcs2XMUnucz04T2Uhh6gE2G7lrkL 8T2lzpFGoQ57dolxLv+RVRHVreUj4gdNmPUbl6KgRe/hJTRTyyn0GQUwwlhYZn+jIj9w SXdAlKdnrLv+CB7WNCXLhWnO6NpYcu+R7RVwLfmj6r7qCv8Tblb02gEHWprUmBwS+I4z mj1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772693726; x=1773298526; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hfq55mn7MJ04jqjtTP4/AbbAEktb2oJtSvHfgUnB3sY=; b=qKq3sQlfcr8G7Fv/YuZLl2/7DPOGCKnGrvsnUmQHXyPfbhcazIJoY1VjPRjUtvVCe+ eMGjEIKFkgNehUOZnhQYundFMX2kzKnR/ooUK+1Bpp9tH6t9vClEAADI2Yt2dtLLfZNM cUc+6HRb0JPJMzYLvbZVPsq7q38EF5ixP3etlwUwVlak6b9h6HTokmWSSw3lYuCiRagl KL9F92xcRLo6o6y9BvUFDe8LwiBzYEoIZV7iugJ8g5yrawHSOJmnN28M6sQQiY5E8EM6 LoVxfKFQyCwPgDpRJ+6AiaXEUe7dNNXws/ucyacBADBZi0I8vY5PEbauVngdttMyipDN BXgQ== X-Gm-Message-State: AOJu0Yzamxc0B6/YIfwqCmNdnN/t0QQweVSE6pAZ3yjP2cCq2FWHfhvc +VCZhcu5Ql4yd1V6G8wx50oJKfnMJV+FvrMUQcjb94GqVJ1o44uyQkeww/UuzQ== X-Gm-Gg: ATEYQzw0PA/ERTHjbjGehGFSDjB7uoIvYvo86A8+UAI5+iOAoBFY9Sxdfn7gbwkZ+ZT aOfDnm+t4/9Juy5RL2FI5im7pt9bVGDz6cGqmIR6qjiqksy7ULokdTLBmhx+Smbot8DaXvtL6t3 /BNIaxvG7P/NCmLdhdfixsUFU7Io9Otsr59awq/IPqWWzdksO+/Zw1Lf0CSuXr9PVET+H+hNs0X yYYHrUtOSVEFPG1XkYz77WdUD88f1cIlWL6tq8zQcqxXsHYyp5A5psj1v4hNlPR4OH/Ptu2mKA1 8C/EJgeE7RQ5BtXLEuociXcEYmIcyf+lQYlgLige2ghgAhJbB5oT4OdQSMZMPcNimEVtkiEXIve Nj83x1knmCsXeZeFPoapSzBjA/ZZP+rN6tuo8rtTdSNARxctoiy77NOLPR4L0Xn6FGP29Jyckn6 GwpX6JBc954r0Cji9xkZKRoBzWww== X-Received: by 2002:a05:7300:bc90:b0:2be:2cfe:68bc with SMTP id 5a478bee46e88-2be30fb998bmr1744467eec.10.1772693726299; Wed, 04 Mar 2026 22:55:26 -0800 (PST) Received: from [127.0.0.1] ([52.190.182.112]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2be2056acd1sm5421458eec.22.2026.03.04.22.55.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2026 22:55:25 -0800 (PST) Message-Id: In-Reply-To: References: From: "Paul Tarjan via GitGitGadget" Date: Thu, 05 Mar 2026 06:55:05 +0000 Subject: [PATCH v11 05/12] fsmonitor: rename fsm-ipc-darwin.c to fsm-ipc-unix.c Fcc: Sent Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Patrick Steinhardt , Paul Tarjan , Paul Tarjan , Paul Tarjan From: Paul Tarjan The fsmonitor IPC path logic in fsm-ipc-darwin.c is not Darwin-specific and will be reused by the upcoming Linux implementation. Rename it to fsm-ipc-unix.c to reflect that it is shared by all Unix platforms. Introduce FSMONITOR_OS_SETTINGS (set to "unix" for non-Windows, "win32" for Windows) as a separate variable from FSMONITOR_DAEMON_BACKEND so that the build files can distinguish between platform-specific files (listen, health, path-utils) and shared Unix files (ipc, settings). Move fsm-ipc to the FSMONITOR_OS_SETTINGS section in the Makefile, and switch fsm-path-utils to use FSMONITOR_DAEMON_BACKEND since path-utils is platform-specific (there will be separate darwin and linux versions). Based-on-patch-by: Eric DeCosta Based-on-patch-by: Marziyeh Esipreh Signed-off-by: Paul Tarjan --- Makefile | 6 ++--- .../{fsm-ipc-darwin.c => fsm-ipc-unix.c} | 0 config.mak.uname | 2 +- contrib/buildsystems/CMakeLists.txt | 25 +++++++++---------- meson.build | 7 ++++-- 5 files changed, 21 insertions(+), 19 deletions(-) rename compat/fsmonitor/{fsm-ipc-darwin.c => fsm-ipc-unix.c} (100%) diff --git a/Makefile b/Makefile index 8aa489f3b6..080d009bf0 100644 --- a/Makefile +++ b/Makefile @@ -417,7 +417,7 @@ include shared.mak # If your platform has OS-specific ways to tell if a repo is incompatible with # fsmonitor (whether the hook or IPC daemon version), set FSMONITOR_OS_SETTINGS # to the "" of the corresponding `compat/fsmonitor/fsm-settings-.c` -# that implements the `fsm_os_settings__*()` routines. +# and `compat/fsmonitor/fsm-ipc-.c` files. # # Define LINK_FUZZ_PROGRAMS if you want `make all` to also build the fuzz test # programs in oss-fuzz/. @@ -2365,13 +2365,13 @@ ifdef FSMONITOR_DAEMON_BACKEND COMPAT_CFLAGS += -DHAVE_FSMONITOR_DAEMON_BACKEND COMPAT_OBJS += compat/fsmonitor/fsm-listen-$(FSMONITOR_DAEMON_BACKEND).o COMPAT_OBJS += compat/fsmonitor/fsm-health-$(FSMONITOR_DAEMON_BACKEND).o - COMPAT_OBJS += compat/fsmonitor/fsm-ipc-$(FSMONITOR_DAEMON_BACKEND).o endif ifdef FSMONITOR_OS_SETTINGS COMPAT_CFLAGS += -DHAVE_FSMONITOR_OS_SETTINGS + COMPAT_OBJS += compat/fsmonitor/fsm-ipc-$(FSMONITOR_OS_SETTINGS).o COMPAT_OBJS += compat/fsmonitor/fsm-settings-$(FSMONITOR_OS_SETTINGS).o - COMPAT_OBJS += compat/fsmonitor/fsm-path-utils-$(FSMONITOR_OS_SETTINGS).o + COMPAT_OBJS += compat/fsmonitor/fsm-path-utils-$(FSMONITOR_DAEMON_BACKEND).o endif ifdef WITH_BREAKING_CHANGES diff --git a/compat/fsmonitor/fsm-ipc-darwin.c b/compat/fsmonitor/fsm-ipc-unix.c similarity index 100% rename from compat/fsmonitor/fsm-ipc-darwin.c rename to compat/fsmonitor/fsm-ipc-unix.c diff --git a/config.mak.uname b/config.mak.uname index 3c35ae33a3..33877020e9 100644 --- a/config.mak.uname +++ b/config.mak.uname @@ -165,7 +165,7 @@ ifeq ($(uname_S),Darwin) ifndef NO_PTHREADS ifndef NO_UNIX_SOCKETS FSMONITOR_DAEMON_BACKEND = darwin - FSMONITOR_OS_SETTINGS = darwin + FSMONITOR_OS_SETTINGS = unix endif endif diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 28877feb9d..6197d5729c 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -291,23 +291,22 @@ endif() if(SUPPORTS_SIMPLE_IPC) if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - add_compile_definitions(HAVE_FSMONITOR_DAEMON_BACKEND) - list(APPEND compat_SOURCES compat/fsmonitor/fsm-listen-win32.c) - list(APPEND compat_SOURCES compat/fsmonitor/fsm-health-win32.c) - list(APPEND compat_SOURCES compat/fsmonitor/fsm-ipc-win32.c) - list(APPEND compat_SOURCES compat/fsmonitor/fsm-path-utils-win32.c) - - add_compile_definitions(HAVE_FSMONITOR_OS_SETTINGS) - list(APPEND compat_SOURCES compat/fsmonitor/fsm-settings-win32.c) + set(FSMONITOR_DAEMON_BACKEND "win32") + set(FSMONITOR_OS_SETTINGS "win32") elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(FSMONITOR_DAEMON_BACKEND "darwin") + set(FSMONITOR_OS_SETTINGS "unix") + endif() + + if(FSMONITOR_DAEMON_BACKEND) add_compile_definitions(HAVE_FSMONITOR_DAEMON_BACKEND) - list(APPEND compat_SOURCES compat/fsmonitor/fsm-listen-darwin.c) - list(APPEND compat_SOURCES compat/fsmonitor/fsm-health-darwin.c) - list(APPEND compat_SOURCES compat/fsmonitor/fsm-ipc-darwin.c) - list(APPEND compat_SOURCES compat/fsmonitor/fsm-path-utils-darwin.c) + list(APPEND compat_SOURCES compat/fsmonitor/fsm-listen-${FSMONITOR_DAEMON_BACKEND}.c) + list(APPEND compat_SOURCES compat/fsmonitor/fsm-health-${FSMONITOR_DAEMON_BACKEND}.c) + list(APPEND compat_SOURCES compat/fsmonitor/fsm-ipc-${FSMONITOR_OS_SETTINGS}.c) + list(APPEND compat_SOURCES compat/fsmonitor/fsm-path-utils-${FSMONITOR_DAEMON_BACKEND}.c) add_compile_definitions(HAVE_FSMONITOR_OS_SETTINGS) - list(APPEND compat_SOURCES compat/fsmonitor/fsm-settings-darwin.c) + list(APPEND compat_SOURCES compat/fsmonitor/fsm-settings-${FSMONITOR_DAEMON_BACKEND}.c) endif() endif() diff --git a/meson.build b/meson.build index dd52efd1c8..86a68365a9 100644 --- a/meson.build +++ b/meson.build @@ -1320,10 +1320,13 @@ else endif fsmonitor_backend = '' +fsmonitor_os = '' if host_machine.system() == 'windows' fsmonitor_backend = 'win32' + fsmonitor_os = 'win32' elif host_machine.system() == 'darwin' fsmonitor_backend = 'darwin' + fsmonitor_os = 'unix' libgit_dependencies += dependency('CoreServices') endif if fsmonitor_backend != '' @@ -1332,14 +1335,14 @@ if fsmonitor_backend != '' libgit_sources += [ 'compat/fsmonitor/fsm-health-' + fsmonitor_backend + '.c', - 'compat/fsmonitor/fsm-ipc-' + fsmonitor_backend + '.c', + 'compat/fsmonitor/fsm-ipc-' + fsmonitor_os + '.c', 'compat/fsmonitor/fsm-listen-' + fsmonitor_backend + '.c', 'compat/fsmonitor/fsm-path-utils-' + fsmonitor_backend + '.c', 'compat/fsmonitor/fsm-settings-' + fsmonitor_backend + '.c', ] endif build_options_config.set_quoted('FSMONITOR_DAEMON_BACKEND', fsmonitor_backend) -build_options_config.set_quoted('FSMONITOR_OS_SETTINGS', fsmonitor_backend) +build_options_config.set_quoted('FSMONITOR_OS_SETTINGS', fsmonitor_os) if not get_option('b_sanitize').contains('address') and get_option('regex').allowed() and compiler.has_header('regex.h') and compiler.get_define('REG_STARTEND', prefix: '#include ') != '' build_options_config.set('NO_REGEX', '') -- gitgitgadget