Skip to content

Commit

Permalink
Fix persisting wasm dylib on macOS after brew cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
froch committed May 9, 2024
1 parent c803c9a commit 3e93c12
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,24 @@ def verify_checksum(file)
end

def install_libwasmvm
lib.install "#{buildpath}/libwasmvm.#{determine_libwasmvm_suffix}"
libwasmvm_suffix = determine_libwasmvm_suffix
libwasmvm_file = "#{buildpath}/libwasmvm.#{libwasmvm_suffix}"

Check failure on line 64 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 64 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-latest)

Layout/TrailingWhitespace: Trailing whitespace detected.
lib.install libwasmvm_file
end

def compile_and_install_xiond
unless OS.mac?
ENV["LINK_STATICALLY"] = "true"
ENV["LDFLAGS"] = "-linkmode external -extldflags '-static'"
end

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

Check failure on line 76 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 76 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-latest)

Layout/TrailingWhitespace: Trailing whitespace detected.
if OS.mac?

Check failure on line 77 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 OS.mac?`) instead of wrapping the code inside a conditional expression.

Check failure on line 77 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 77 in lib/base.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-latest)

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

Check failure on line 77 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 `&&`/`||`.
system "install_name_tool", "-add_rpath", HOMEBREW_PREFIX/"lib", "#{bin}/xiond"

Check failure on line 78 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 78 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"
end
end

def determine_libwasmvm_suffix
Expand Down

0 comments on commit 3e93c12

Please sign in to comment.