Skip to content

Commit

Permalink
Fix dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
froch committed Jul 3, 2024
1 parent 96303c2 commit 1ce0ff2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 13 additions & 4 deletions lib/base.rb
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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 |tmpdir|

Check failure on line 20 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

Lint/UnusedBlockArgument: Unused block argument - `tmpdir`. You can omit the argument if you don't care about it.

Check failure on line 20 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-latest)

Lint/UnusedBlockArgument: Unused block argument - `tmpdir`. You can omit the argument if you don't care about it.

Check failure on line 20 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-14)

Lint/UnusedBlockArgument: Unused block argument - `tmpdir`. You can omit the argument if you don't care about it.
remove_dir(buildpath, true)
Dir.mkdir(buildpath)
system "git", "clone", "--depth", "1", "--branch", "v#{version}", "https://github.com/burnt-labs/xion.git", buildpath
Expand Down Expand Up @@ -76,10 +74,21 @@ def compile_and_install_xiond

system "make", "install"
bin.install "#{ENV.fetch("GOPATH", nil)}/bin/xiond"
end

# Homebrew linting fails on this system call

Check failure on line 79 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

Layout/TrailingWhitespace: Trailing whitespace detected.

Check failure on line 79 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-latest)

Layout/TrailingWhitespace: Trailing whitespace detected.

Check failure on line 79 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-14)

Layout/TrailingWhitespace: Trailing whitespace detected.
# it stubbornly requires a dependency on ruby-macho instead
# GTFO
def post_install
return unless OS.mac?

MachO::Tools.add_rpath("#{bin}/xiond", "#{HOMEBREW_PREFIX}/lib")
rpath = "#{HOMEBREW_PREFIX}/lib"
executable = "#{bin}/xiond"

# Check if the executable exists and modify the rpath
if File.exist?(executable)

Check failure on line 89 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

Style/GuardClause: Use a guard clause (`return unless File.exist?(executable)`) instead of wrapping the code inside a conditional expression.

Check failure on line 89 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

Style/IfUnlessModifier: Favor modifier `if` usage when having a single-line body. Another good alternative is the usage of control flow `&&`/`||`.

Check failure on line 89 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-latest)

Style/GuardClause: Use a guard clause (`return unless File.exist?(executable)`) instead of wrapping the code inside a conditional expression.

Check failure on line 89 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-latest)

Style/IfUnlessModifier: Favor modifier `if` usage when having a single-line body. Another good alternative is the usage of control flow `&&`/`||`.

Check failure on line 89 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-14)

Style/GuardClause: Use a guard clause (`return unless File.exist?(executable)`) instead of wrapping the code inside a conditional expression.

Check failure on line 89 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-14)

Style/IfUnlessModifier: Favor modifier `if` usage when having a single-line body. Another good alternative is the usage of control flow `&&`/`||`.
system "install_name_tool", "-add_rpath", rpath, executable

Check failure on line 90 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

FormulaAudit/Miscellaneous: Use ruby-macho instead of calling "install_name_tool"

Check failure on line 90 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-latest)

FormulaAudit/Miscellaneous: Use ruby-macho instead of calling "install_name_tool"

Check failure on line 90 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-14)

FormulaAudit/Miscellaneous: Use ruby-macho instead of calling "install_name_tool"
end
end

def determine_libwasmvm_suffix
Expand Down

0 comments on commit 1ce0ff2

Please sign in to comment.