riscv-software-src / homebrew-riscv

homebrew (macOS) packages for RISC-V toolchain
https://riscv.org
304 stars 50 forks source link

Fix for riscv-pk.rb #101

Closed gmerlino closed 1 year ago

gmerlino commented 1 year ago

Addressing https://github.com/riscv-software-src/homebrew-riscv/issues/99

ggranberry commented 1 year ago

Any luck on this?

I got rid of my install, and tapped your version with brew tap gmerlino/homebrew-riscv. However I still seem to be having the same issue as before where I'm technically able to install riscv-tools, but the tests aren't passing:

λ ~/blah brew test riscv-tools
==> Testing gmerlino/riscv/riscv-tools
==> /opt/homebrew/opt/riscv-gnu-toolchain/bin/riscv64-unknown-elf-gcc /private/tmp/riscv-tools-test-20230514
==> spike pk /private/tmp/riscv-tools-test-20230514-8063-b542aw/a.out
Error: gmerlino/riscv/riscv-tools: failed
An exception occurred within a child process:
  Minitest::Assertion: Expected: 0
  Actual: 255
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/minitest-5.18.0/lib/minitest/assertions.rb:183:in `assert'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/minitest-5.18.0/lib/minitest/assertions.rb:218:in `assert_equal'
/opt/homebrew/Library/Homebrew/formula_assertions.rb:26:in `shell_output'
/opt/homebrew/Library/Taps/gmerlino/homebrew-riscv/riscv-tools.rb:27:in `block in <class:RiscvTools>'
/opt/homebrew/Library/Homebrew/formula.rb:2350:in `block (3 levels) in run_test'
/opt/homebrew/Library/Homebrew/extend/kernel.rb:498:in `with_env'
/opt/homebrew/Library/Homebrew/formula.rb:2349:in `block (2 levels) in run_test'
/opt/homebrew/Library/Homebrew/formula.rb:978:in `with_logging'
/opt/homebrew/Library/Homebrew/formula.rb:2348:in `block in run_test'
/opt/homebrew/Library/Homebrew/mktemp.rb:75:in `block in run'
/opt/homebrew/Library/Homebrew/mktemp.rb:75:in `chdir'
/opt/homebrew/Library/Homebrew/mktemp.rb:75:in `run'
/opt/homebrew/Library/Homebrew/formula.rb:2626:in `mktemp'
/opt/homebrew/Library/Homebrew/formula.rb:2342:in `run_test'
/opt/homebrew/Library/Homebrew/test.rb:44:in `block in <main>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:93:in `block in timeout'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `block in catch'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `catch'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:33:in `catch'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/timeout.rb:108:in `timeout'
/opt/homebrew/Library/Homebrew/test.rb:48:in `<main>'

And all of my binaries segfault when I run them no matter how basic.

gmerlino commented 1 year ago

@ggranberry actually forgot to merge the fix in my own (forked) tap, now it's updated to include this one. btw, on my laptop that brew test invocation does not fail

sbeamer commented 1 year ago

Thank you for making this!

This may not be needed since riscv-pk reverted the commit that caused this issue: https://github.com/riscv-software-src/riscv-pk/commit/acbe166dac9d1db752ee95f61e65ca82bb875afb

sbeamer commented 1 year ago

Thanks!

This still seems necessary for now, but will keep on eye and see if we need to revert in future.