diff --git a/Formula/neon-extension.rb b/Formula/neon-extension.rb index 8ed57fd..b797b36 100644 --- a/Formula/neon-extension.rb +++ b/Formula/neon-extension.rb @@ -2,8 +2,8 @@ class NeonExtension < Formula desc "Extension enabling storage manager API and Pageserver communication" homepage "https://github.com/neondatabase/neon" url "https://github.com/neondatabase/neon.git", - tag: "release-4642", - revision: "a1a74eef2c60c283bc038b65b99db2ed0c68f5bb" + tag: "release-4713", + revision: "1ec3e39d4e777d53d78eea8eba7d21f37942b000" license "Apache-2.0" head "https://github.com/neondatabase/neon.git", branch: "main" @@ -16,6 +16,16 @@ class NeonExtension < Formula depends_on "bayandin/tap/neon-postgres" + # A workaround for `FATAL: postmaster became multithreaded during startup` on macOS >= 14.2 + # See https://www.postgresql.org/message-id/flat/CYMBV0OT7216.JNRUO6R6GH86%40neon.tech + on_macos do + depends_on "bayandin/tap/curl-without-ipv6" + end + + on_linux do + depends_on "curl" + end + def extensions %w[neon_walredo neon neon_rmgr neon_utils] end diff --git a/Formula/neon-local.rb b/Formula/neon-local.rb index ee2be1f..05c4f1b 100644 --- a/Formula/neon-local.rb +++ b/Formula/neon-local.rb @@ -2,8 +2,8 @@ class NeonLocal < Formula desc "CLI for running Neon locally" homepage "https://github.com/neondatabase/neon" url "https://github.com/neondatabase/neon.git", - tag: "release-4642", - revision: "a1a74eef2c60c283bc038b65b99db2ed0c68f5bb" + tag: "release-4713", + revision: "1ec3e39d4e777d53d78eea8eba7d21f37942b000" license "Apache-2.0" head "https://github.com/neondatabase/neon.git", branch: "main" diff --git a/Formula/neon-postgres.rb b/Formula/neon-postgres.rb index 6b20f44..0fea71d 100644 --- a/Formula/neon-postgres.rb +++ b/Formula/neon-postgres.rb @@ -2,8 +2,8 @@ class NeonPostgres < Formula desc "Neon's fork of PostgreSQL" homepage "https://github.com/neondatabase/postgres" url "https://github.com/neondatabase/neon.git", - tag: "release-4642", - revision: "a1a74eef2c60c283bc038b65b99db2ed0c68f5bb" + tag: "release-4713", + revision: "1ec3e39d4e777d53d78eea8eba7d21f37942b000" license "Apache-2.0" head "https://github.com/neondatabase/neon.git", branch: "main" @@ -28,15 +28,9 @@ class NeonPostgres < Formula uses_from_macos "libxml2" uses_from_macos "libxslt" - # A workaround for `FATAL: postmaster became multithreaded during startup` on macOS >= 14.2 - # See https://www.postgresql.org/message-id/flat/CYMBV0OT7216.JNRUO6R6GH86%40neon.tech - on_macos do - depends_on "bayandin/tap/curl-without-ipv6" - end - on_linux do - depends_on "curl" depends_on "libseccomp" + depends_on "util-linux" end def pg_versions(with: nil, without: nil) @@ -50,6 +44,10 @@ def pg_bin_for(version) opt_libexec/version/"bin" end + def pg_lib_for(version) + opt_libexec/version/"lib" + end + def dlsuffix(version) # Ref https://github.com/postgres/postgres/commit/b55f62abb2c2e07dfae99e19a2b3d7ca9e58dc1a (OS.linux? || "v14 v15".include?(version)) ? "so" : "dylib" @@ -58,14 +56,7 @@ def dlsuffix(version) def install ENV["XML_CATALOG_FILES"] = etc/"xml/catalog" - ENV.prepend "LDFLAGS", "-L#{Formula["openssl@3"].opt_lib} -L#{Formula["readline"].opt_lib}" - ENV.prepend "CPPFLAGS", "-I#{Formula["openssl@3"].opt_include} -I#{Formula["readline"].opt_include}" - - if OS.linux? - ENV.prepend "LDFLAGS", "-L#{Formula["curl"].opt_lib}" - ENV.prepend "CPPFLAGS", "-I#{Formula["curl"].opt_include}" - end - + deps = %w[openssl@3 readline] pg_versions.each do |v| cd "vendor/postgres-#{v}" do args = %W[ @@ -73,6 +64,8 @@ def install --datadir=#{HOMEBREW_PREFIX}/share/#{name}/#{v} --libdir=#{HOMEBREW_PREFIX}/lib/#{name}/#{v} --includedir=#{HOMEBREW_PREFIX}/include/#{name}/#{v} + --with-includes=#{deps.map { |d| Formula[d].opt_include }.join(" ")} + --with-libraries=#{deps.map { |d| Formula[d].opt_lib }.join(" ")} --enable-debug --with-icu --with-libxml @@ -82,7 +75,7 @@ def install --with-uuid=e2fs ] args << "--with-zstd" if v != "v14" - args << "PG_SYSROOT=#{MacOS.sdk_path}" if MacOS.sdk_root_needed? + args << "PG_SYSROOT=#{MacOS.sdk_path}" if OS.mac? && MacOS.sdk_root_needed? system "./configure", *args system "make" diff --git a/Formula/neon-storage.rb b/Formula/neon-storage.rb index 5e35aa1..36e37a8 100644 --- a/Formula/neon-storage.rb +++ b/Formula/neon-storage.rb @@ -2,8 +2,8 @@ class NeonStorage < Formula desc "Storage components for Neon" homepage "https://github.com/neondatabase/neon" url "https://github.com/neondatabase/neon.git", - tag: "release-4642", - revision: "a1a74eef2c60c283bc038b65b99db2ed0c68f5bb" + tag: "release-4713", + revision: "1ec3e39d4e777d53d78eea8eba7d21f37942b000" license "Apache-2.0" head "https://github.com/neondatabase/neon.git", branch: "main" @@ -14,14 +14,20 @@ class NeonStorage < Formula sha256 cellar: :any_skip_relocation, x86_64_linux: "88c87bf0a437c6278a10376a3c20e20b9a0bb36296f3b515f6c51880a7b4937f" end - depends_on "bayandin/tap/neon-postgres" => :build depends_on "pkg-config" => :build depends_on "rust" => :build + depends_on "bayandin/tap/neon-postgres" depends_on "openssl@3" depends_on "protobuf" uses_from_macos "llvm" => :build + on_linux do + # `attachment_service` got linked with system libpq on Linux. + # Not sure how to prevent it from doing that, so just depend on it to make audit happy + depends_on "libpq" + end + def binaries %w[ attachment_service compute_ctl neon_local pagebench @@ -35,9 +41,6 @@ def neon_postgres end def install - ENV["BUILD_TAG"] = build.stable? ? "release-#{version}" : "dev-#{Utils.git_short_head}" - ENV["GIT_VERSION"] = Utils.git_head - # A workaround for `FATAL: postmaster became multithreaded during startup` on macOS >= 14.2 # See https://www.postgresql.org/message-id/flat/CYMBV0OT7216.JNRUO6R6GH86%40neon.tech if OS.mac? @@ -48,20 +51,27 @@ def install EOS end - with_env(POSTGRES_INSTALL_DIR: neon_postgres.opt_libexec) do - system "cargo", "install", *std_cargo_args(root: libexec, path: "compute_tools") - system "cargo", "install", *std_cargo_args(root: libexec, path: "control_plane") - system "cargo", "install", *std_cargo_args(root: libexec, path: "control_plane/attachment_service") - system "cargo", "install", *std_cargo_args(root: libexec, path: "libs/postgres_ffi/wal_craft") - system "cargo", "install", *std_cargo_args(root: libexec, path: "pageserver") - system "cargo", "install", *std_cargo_args(root: libexec, path: "pageserver/ctl") - system "cargo", "install", *std_cargo_args(root: libexec, path: "pageserver/pagebench") - system "cargo", "install", *std_cargo_args(root: libexec, path: "proxy") - system "cargo", "install", *std_cargo_args(root: libexec, path: "s3_scrubber") - system "cargo", "install", *std_cargo_args(root: libexec, path: "safekeeper") - system "cargo", "install", *std_cargo_args(root: libexec, path: "storage_broker") - system "cargo", "install", *std_cargo_args(root: libexec, path: "trace") - end + ENV["BUILD_TAG"] = build.stable? ? "release-#{version}" : "dev-#{Utils.git_short_head}" + ENV["GIT_VERSION"] = Utils.git_head + ENV["POSTGRES_INSTALL_DIR"] = neon_postgres.opt_libexec + ENV["POSTGRES_DISTRIB_DIR"] = neon_postgres.opt_libexec + + ENV["PQ_LIB_DIR"] = neon_postgres.pg_lib_for("v16") if OS.mac? + mkdir_p libexec/"control_plane/attachment_service" + cp_r "control_plane/attachment_service/migrations", libexec/"control_plane/attachment_service/" + + system "cargo", "install", *std_cargo_args(root: libexec, path: "compute_tools") + system "cargo", "install", *std_cargo_args(root: libexec, path: "control_plane") + system "cargo", "install", *std_cargo_args(root: libexec, path: "control_plane/attachment_service") + system "cargo", "install", *std_cargo_args(root: libexec, path: "libs/postgres_ffi/wal_craft") + system "cargo", "install", *std_cargo_args(root: libexec, path: "pageserver") + system "cargo", "install", *std_cargo_args(root: libexec, path: "pageserver/ctl") + system "cargo", "install", *std_cargo_args(root: libexec, path: "pageserver/pagebench") + system "cargo", "install", *std_cargo_args(root: libexec, path: "proxy") + system "cargo", "install", *std_cargo_args(root: libexec, path: "s3_scrubber") + system "cargo", "install", *std_cargo_args(root: libexec, path: "safekeeper") + system "cargo", "install", *std_cargo_args(root: libexec, path: "storage_broker") + system "cargo", "install", *std_cargo_args(root: libexec, path: "trace") end test do