Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Feb 8, 2024
1 parent 1956daf commit 73103d3
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Formula/risingwave.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class Risingwave < Formula
end

depends_on "cmake" => :build
depends_on "llvm" => :build
depends_on "protobuf" => :build
depends_on "rustup-init" => :build
depends_on "openssl@3"
Expand All @@ -25,14 +24,27 @@ def install
"--default-toolchain", "none"
ENV.prepend_path "PATH", HOMEBREW_CACHE/"cargo_cache/bin"

ENV.delete "RUSTFLAGS" # https://github.com/Homebrew/brew/pull/15544#issuecomment-1628639703
# Remove `RUSTFLAGS` env var set by Homebrew, or it will override the one specified
# in `.cargo/config.toml`.
#
# https://github.com/Homebrew/brew/pull/15544#issuecomment-1628639703
ENV.delete "RUSTFLAGS"

# Homebrew changes cxx flags, and CMake doesn't pick them up, so rdkafka-sys build fails.
# We cannot pass CMake flags (`std_cmake_args`) because it's in their build.rs.
#
# Some refs that might be useful:
# https://github.com/Homebrew/homebrew-core/pull/51949#issuecomment-601943075
# https://github.com/Homebrew/brew/pull/7134
ENV["SDKROOT"] = MacOS.sdk_path_if_needed

# Remove `"-Clink-arg=xxx/ld64.lld"` to avoid dependency on LLVM.
# If we `depends_on "llvm" => :build`, it will somehow corrupt the resolution of the C++
# compiler when building `cxx` crate. Didn't investigate further.
inreplace ".cargo/config.toml" do |s|
s.gsub!(/"-Clink-arg=.*ld64.lld",?/, "")
end

system "cargo", "install",
"--bin", "risingwave",
"--features", "rw-static-link",
Expand Down

0 comments on commit 73103d3

Please sign in to comment.