unused-code / unused

A tool to identify potentially unused code.
https://unused.codes
MIT License
283 stars 11 forks source link

Mac M1 / ARM compatibility? #35

Closed marckohlbrugge closed 3 years ago

marckohlbrugge commented 3 years ago

I've installed unused v0.0.2 via homebrew. When I try to run it on macOS 11.3 on a Mac M1 I get the follow error:

➜ unused
[1]    30856 segmentation fault  unused
➜ unused doctor
[1]    30964 segmentation fault  unused doctor

This person mentioned the same problem on an M1 Mac.

Is unused supposed to be compatible with this architecture?

The tool looks great. Let me know if there's anything I can do to help test M1 builds, etc.

marckohlbrugge commented 3 years ago

Not sure if this is relevant, but running brew test unused returned the following:

==> /opt/homebrew/Cellar/unused/0.2.0/bin/unused -a
Error: unused-code/formulae/unused: failed
An exception occurred within a child process:
  Minitest::Assertion: Expected: 0
  Actual: nil
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/minitest-5.14.4/lib/minitest/assertions.rb:183:in `assert'
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/minitest-5.14.4/lib/minitest/assertions.rb:218:in `assert_equal'
/opt/homebrew/Library/Homebrew/formula_assertions.rb:65:in `shell_output'
/opt/homebrew/Library/Taps/unused-code/homebrew-formulae/Formula/unused.rb:56:in `block in <class:Unused>'
/opt/homebrew/Library/Homebrew/formula.rb:1975:in `block (3 levels) in run_test'
/opt/homebrew/Library/Homebrew/utils.rb:558:in `with_env'
/opt/homebrew/Library/Homebrew/formula.rb:1974:in `block (2 levels) in run_test'
/opt/homebrew/Library/Homebrew/formula.rb:924:in `with_logging'
/opt/homebrew/Library/Homebrew/formula.rb:1973:in `block in run_test'
/opt/homebrew/Library/Homebrew/mktemp.rb:63:in `block in run'
/opt/homebrew/Library/Homebrew/mktemp.rb:63:in `chdir'
/opt/homebrew/Library/Homebrew/mktemp.rb:63:in `run'
/opt/homebrew/Library/Homebrew/formula.rb:2224:in `mktemp'
/opt/homebrew/Library/Homebrew/formula.rb:1967:in `run_test'
/opt/homebrew/Library/Homebrew/test.rb:43: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>'
marckohlbrugge commented 3 years ago

Whoops, seems like there's already an issue about this: https://github.com/unused-code/unused/issues/34