From 5c753b21ae80f409f1688ae9f1a7da45c7ee0365 Mon Sep 17 00:00:00 2001 From: Oliver Nordbjerg Date: Tue, 23 Apr 2024 23:24:38 +0200 Subject: [PATCH 01/11] ci: build for macos arm --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8bca8a9..ce7af5f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ jobs: test-bot: strategy: matrix: - os: [ubuntu-22.04, macos-13] + os: [ubuntu-22.04, macos-13, macos-14] runs-on: ${{ matrix.os }} steps: - name: Set up Homebrew From 9bd6ce8f8f8f3230e1f5c5f84f54d5fa47a1036b Mon Sep 17 00:00:00 2001 From: Oliver Nordbjerg Date: Tue, 23 Apr 2024 23:38:26 +0200 Subject: [PATCH 02/11] chore: rebuild reth bottle --- Formula/reth.rb | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Formula/reth.rb b/Formula/reth.rb index 2d2f9a8..e6c8207 100644 --- a/Formula/reth.rb +++ b/Formula/reth.rb @@ -12,11 +12,6 @@ class Reth < Formula strategy :github_latest end - bottle do - root_url "https://github.com/paradigmxyz/homebrew-brew/releases/download/reth-0.2.0-beta.6" - sha256 cellar: :any_skip_relocation, x86_64_linux: "7b9c2d91b6ae69b5deace9d2678cec9e843bac772080bdc8191b9a49919d1111" - end - depends_on "llvm" => :build depends_on "pkg-config" => :build depends_on "rust" => :build From 567e2c4a4d56323756d693a69924720629ac82d2 Mon Sep 17 00:00:00 2001 From: Oliver Nordbjerg Date: Wed, 24 Apr 2024 00:08:56 +0200 Subject: [PATCH 03/11] fix: don't use jemalloc on arm --- Formula/reth.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Formula/reth.rb b/Formula/reth.rb index e6c8207..99e8e42 100644 --- a/Formula/reth.rb +++ b/Formula/reth.rb @@ -17,8 +17,14 @@ class Reth < Formula depends_on "rust" => :build def install - cd "bin/reth" do - system "cargo", "install", "--bin", "reth", "--profile", "maxperf", "--features", "jemalloc", *std_cargo_args + if Hardware::CPU.intel? + cd "bin/reth" do + system "cargo", "install", "--bin", "reth", "--profile", "maxperf", "--features", "jemalloc", *std_cargo_args + end + else + cd "bin/reth" do + system "cargo", "install", "--bin", "reth", "--profile", "maxperf", *std_cargo_args + end end end From 4db9040c0bfbfe090dd06fde358ffacc3029281f Mon Sep 17 00:00:00 2001 From: Oliver Nordbjerg Date: Wed, 24 Apr 2024 00:12:14 +0200 Subject: [PATCH 04/11] chore: fmt --- Formula/reth.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Formula/reth.rb b/Formula/reth.rb index 99e8e42..206f0d8 100644 --- a/Formula/reth.rb +++ b/Formula/reth.rb @@ -18,13 +18,13 @@ class Reth < Formula def install if Hardware::CPU.intel? - cd "bin/reth" do - system "cargo", "install", "--bin", "reth", "--profile", "maxperf", "--features", "jemalloc", *std_cargo_args - end + cd "bin/reth" do + system "cargo", "install", "--bin", "reth", "--profile", "maxperf", "--features", "jemalloc", *std_cargo_args + end else - cd "bin/reth" do - system "cargo", "install", "--bin", "reth", "--profile", "maxperf", *std_cargo_args - end + cd "bin/reth" do + system "cargo", "install", "--bin", "reth", "--profile", "maxperf", *std_cargo_args + end end end From 8f99feb934ade50e47ff48170bc6f3a9fb988c41 Mon Sep 17 00:00:00 2001 From: Oliver Nordbjerg Date: Wed, 24 Apr 2024 00:38:59 +0200 Subject: [PATCH 05/11] fix: don't install llvm twice --- Formula/reth.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/Formula/reth.rb b/Formula/reth.rb index 206f0d8..6d1d491 100644 --- a/Formula/reth.rb +++ b/Formula/reth.rb @@ -12,7 +12,6 @@ class Reth < Formula strategy :github_latest end - depends_on "llvm" => :build depends_on "pkg-config" => :build depends_on "rust" => :build From ec0e4a38f695dc8f06b0d102b18e3fa57d0583a8 Mon Sep 17 00:00:00 2001 From: Oliver Nordbjerg Date: Wed, 24 Apr 2024 00:53:44 +0200 Subject: [PATCH 06/11] chore: always use jemalloc on mac --- Formula/reth.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Formula/reth.rb b/Formula/reth.rb index 6d1d491..81ddd67 100644 --- a/Formula/reth.rb +++ b/Formula/reth.rb @@ -16,12 +16,10 @@ class Reth < Formula depends_on "rust" => :build def install - if Hardware::CPU.intel? - cd "bin/reth" do + cd "bin/reth" do + if Hardware::CPU.intel? or OS.mac? system "cargo", "install", "--bin", "reth", "--profile", "maxperf", "--features", "jemalloc", *std_cargo_args - end - else - cd "bin/reth" do + else system "cargo", "install", "--bin", "reth", "--profile", "maxperf", *std_cargo_args end end From 028faa4d805080320d956f0c44394e921cecdcf4 Mon Sep 17 00:00:00 2001 From: Oliver Nordbjerg Date: Wed, 24 Apr 2024 01:04:19 +0200 Subject: [PATCH 07/11] chore: fmt --- Formula/reth.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Formula/reth.rb b/Formula/reth.rb index 81ddd67..db539ed 100644 --- a/Formula/reth.rb +++ b/Formula/reth.rb @@ -17,7 +17,7 @@ class Reth < Formula def install cd "bin/reth" do - if Hardware::CPU.intel? or OS.mac? + if Hardware::CPU.intel? || OS.mac? system "cargo", "install", "--bin", "reth", "--profile", "maxperf", "--features", "jemalloc", *std_cargo_args else system "cargo", "install", "--bin", "reth", "--profile", "maxperf", *std_cargo_args From b167e2ad29dff9c406b8f1f6c15fd384a5294132 Mon Sep 17 00:00:00 2001 From: Oliver Nordbjerg Date: Wed, 24 Apr 2024 01:19:41 +0200 Subject: [PATCH 08/11] feat: enable `asm-keccak` unless arm linux --- Formula/reth.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Formula/reth.rb b/Formula/reth.rb index db539ed..77af9c5 100644 --- a/Formula/reth.rb +++ b/Formula/reth.rb @@ -16,9 +16,17 @@ class Reth < Formula depends_on "rust" => :build def install + features = [] + if Hardware::CPU.intel? || OS.mac? + features.push("jemalloc") + end + unless Hardware::CPU.arm? && OS.linux? + features.push("asm-keccak") + end + cd "bin/reth" do - if Hardware::CPU.intel? || OS.mac? - system "cargo", "install", "--bin", "reth", "--profile", "maxperf", "--features", "jemalloc", *std_cargo_args + if features.any? + system "cargo", "install", "--bin", "reth", "--profile", "maxperf", "--features", *features, *std_cargo_args else system "cargo", "install", "--bin", "reth", "--profile", "maxperf", *std_cargo_args end From 270a6f54b3d2f0c9665d3ae39ae6de50e800fae5 Mon Sep 17 00:00:00 2001 From: Oliver Nordbjerg Date: Wed, 24 Apr 2024 01:22:48 +0200 Subject: [PATCH 09/11] chore: we do a little ruby i guess --- Formula/reth.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Formula/reth.rb b/Formula/reth.rb index 77af9c5..ffff62f 100644 --- a/Formula/reth.rb +++ b/Formula/reth.rb @@ -17,12 +17,8 @@ class Reth < Formula def install features = [] - if Hardware::CPU.intel? || OS.mac? - features.push("jemalloc") - end - unless Hardware::CPU.arm? && OS.linux? - features.push("asm-keccak") - end + features.push("jemalloc") if Hardware::CPU.intel? || OS.mac? + features.push("asm-keccak") if !(Hardware::CPU.arm? && OS.linux?) cd "bin/reth" do if features.any? From 2ff3fe4f8a55481b1dd55632bbc2856fc367bf58 Mon Sep 17 00:00:00 2001 From: Oliver Nordbjerg Date: Wed, 24 Apr 2024 01:28:44 +0200 Subject: [PATCH 10/11] chore: awesome --- Formula/reth.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Formula/reth.rb b/Formula/reth.rb index ffff62f..fe6af61 100644 --- a/Formula/reth.rb +++ b/Formula/reth.rb @@ -18,7 +18,9 @@ class Reth < Formula def install features = [] features.push("jemalloc") if Hardware::CPU.intel? || OS.mac? - features.push("asm-keccak") if !(Hardware::CPU.arm? && OS.linux?) + + is_arm_linux = Hardware::CPU.arm? && OS.linux? + features.push("asm-keccak") unless is_arm_linux cd "bin/reth" do if features.any? From e6c3643092e9e3b277bccd6f13547a28dac5ad94 Mon Sep 17 00:00:00 2001 From: Oliver Nordbjerg Date: Wed, 24 Apr 2024 01:37:15 +0200 Subject: [PATCH 11/11] fix: don't splat features --- Formula/reth.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Formula/reth.rb b/Formula/reth.rb index fe6af61..35af3cf 100644 --- a/Formula/reth.rb +++ b/Formula/reth.rb @@ -24,7 +24,8 @@ def install cd "bin/reth" do if features.any? - system "cargo", "install", "--bin", "reth", "--profile", "maxperf", "--features", *features, *std_cargo_args + system "cargo", "install", "--bin", "reth", "--profile", "maxperf", + "--features", features.join(" "), *std_cargo_args else system "cargo", "install", "--bin", "reth", "--profile", "maxperf", *std_cargo_args end