-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #174554 from Homebrew/various-watchman-fixes
watchman: don't make state directory world-writeable
- Loading branch information
Showing
1 changed file
with
13 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,8 +34,6 @@ class Watchman < Formula | |
depends_on "gflags" | ||
depends_on "glog" | ||
depends_on "libevent" | ||
depends_on "libsodium" | ||
depends_on "mvfst" | ||
depends_on "openssl@3" | ||
depends_on "pcre2" | ||
depends_on "[email protected]" | ||
|
@@ -52,18 +50,22 @@ def install | |
/gtest_discover_tests\((.*)\)/, | ||
"gtest_discover_tests(\\1 DISCOVERY_TIMEOUT 60)" | ||
|
||
args = %W[ | ||
-DENABLE_EDEN_SUPPORT=ON | ||
-DPython3_EXECUTABLE=#{which("python3.12")} | ||
-DWATCHMAN_VERSION_OVERRIDE=#{version} | ||
-DWATCHMAN_BUILDINFO_OVERRIDE=#{tap&.user || "Homebrew"} | ||
-DWATCHMAN_STATE_DIR=#{var}/run/watchman | ||
] | ||
# Avoid overlinking with libsodium and mvfst | ||
args << "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-dead_strip_dylibs" if OS.mac? | ||
|
||
# NOTE: Setting `BUILD_SHARED_LIBS=ON` will generate DSOs for Eden libraries. | ||
# These libraries are not part of any install targets and have the wrong | ||
# RPATHs configured, so will need to be installed and relocated manually | ||
# if they are built as shared libraries. They're not used by any other | ||
# formulae, so let's link them statically instead. This is done by default. | ||
system "cmake", "-S", ".", "-B", "build", | ||
"-DENABLE_EDEN_SUPPORT=ON", | ||
"-DPython3_EXECUTABLE=#{which("python3.12")}", | ||
"-DWATCHMAN_VERSION_OVERRIDE=#{version}", | ||
"-DWATCHMAN_BUILDINFO_OVERRIDE=#{tap.user}", | ||
"-DWATCHMAN_STATE_DIR=#{var}/run/watchman", | ||
*std_cmake_args | ||
system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args | ||
system "cmake", "--build", "build" | ||
system "cmake", "--install", "build" | ||
|
||
|
@@ -75,7 +77,8 @@ def install | |
|
||
def post_install | ||
(var/"run/watchman").mkpath | ||
chmod 042777, var/"run/watchman" | ||
# Don't make me world-writeable! This admits symlink attacks that makes upstream dislike usage of `/tmp`. | ||
chmod 03775, var/"run/watchman" | ||
end | ||
|
||
test do | ||
|