Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cockroach 19.1.5 #44732

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 39 additions & 3 deletions Formula/cockroach.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class Cockroach < Formula
desc "Distributed SQL database"
homepage "https://www.cockroachlabs.com"
url "https://binaries.cockroachdb.com/cockroach-v19.1.4.src.tgz"
version "19.1.4"
sha256 "d819167dc109b566511cb6cef9aadc8c4f07b1be6a8b3108f4bbd14808d21faf"
url "https://binaries.cockroachdb.com/cockroach-v19.1.5.src.tgz"
version "19.1.5"
sha256 "1e3329a56e5a1729ed3ac4ff0a97943163325dd4825e8c7c8c1d9fd57bfddfde"
head "https://github.com/cockroachdb/cockroach.git"

bottle do
Expand All @@ -24,6 +24,38 @@ def install
# that causes it to loop infinitely when trying to build cockroach. Use
# the more up-to-date make that Homebrew provides.
ENV.prepend_path "PATH", Formula["make"].opt_libexec/"gnubin"

# Patch the CXX_FLAGS used to build rocksdb as a workaround for the issue fixed by
# https://github.com/facebook/rocksdb/pull/5779. Furthermore on 10.14 (Mojave) and
# later we also allow defaulted-function-delete as a workaround for
# https://github.com/facebook/rocksdb/pull/5095.
if MacOS.version < "10.14"
patch = <<~PATCH
253c253
< set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
---
> set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-error=shadow")
PATCH
else
patch = <<~PATCH
253c253
< set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
---
> set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-error=shadow -Wno-error=defaulted-function-deleted")
PATCH
end
patchfile = Tempfile.new("patch")
begin
patchfile.write(patch)
patchfile.close
system "patch", "src/github.com/cockroachdb/cockroach/c-deps/rocksdb/CMakeLists.txt", patchfile.path
ensure
patchfile.unlink
end

# Ensure that go modules are not used as cockroachdb does not support them.
ENV["GO111MODULE"] = "off"

# Build only the OSS components
system "make", "buildoss"
system "make", "install", "prefix=#{prefix}", "BUILDTYPE=release"
Expand All @@ -40,6 +72,10 @@ def caveats; <<~EOS
mode and may expose data publicly in e.g. a DNS rebinding attack. To run
CockroachDB securely, please see:
#{Formatter.url("https://www.cockroachlabs.com/docs/secure-a-cluster.html")}

Due to a license change, the cockroach package in homebrew-core will no
longer be updated when CockroachDB 19.2 is released. Please switch to
https://github.com/cockroachdb/homebrew-tap instead.
EOS
end

Expand Down