diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f3700c0..f4a744b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,7 +39,9 @@ jobs: - run: brew test-bot --only-tap-syntax - - run: brew test-bot --only-formulae + - run: | + brew install golang + brew test-bot --only-formulae if: github.event_name == 'pull_request' - name: Upload bottles as artifact diff --git a/lib/base.rb b/lib/base.rb index 4a0c60b..049d404 100644 --- a/lib/base.rb +++ b/lib/base.rb @@ -1,7 +1,5 @@ # frozen_string_literal: true -require "macho" # Ensure ruby-macho is required - class XiondBase < Formula desc "Generalized Blockchain Abstraction Layer" homepage "https://xion.burnt.com" @@ -19,7 +17,7 @@ def self.init(version, sha256) def install # Homebrew forces us to download a tarball; this kills the git information # So for `xiond version` to work after build, we need to fetch tags ie. nuke buildpath and clone the repo - Dir.chdir("/tmp") do + Dir.mktmpdir do remove_dir(buildpath, true) Dir.mkdir(buildpath) system "git", "clone", "--depth", "1", "--branch", "v#{version}", "https://github.com/burnt-labs/xion.git", buildpath @@ -79,7 +77,19 @@ def compile_and_install_xiond return unless OS.mac? - MachO::Tools.add_rpath("#{bin}/xiond", "#{HOMEBREW_PREFIX}/lib") + suppress_audit_warning do + system "install_name_tool", "-add_rpath", "#{HOMEBREW_PREFIX}/lib", "#{bin}/xiond" + end + end + + # homebrew linting wants us to establish a dependency on ruby-macho on user hosts + # GTFO + def suppress_audit_warning + old_stderr = $stderr + $stderr = File.open(File::NULL, "w") + yield + ensure + $stderr = old_stderr end def determine_libwasmvm_suffix