Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hashcat: fix failed to create metal library #181921

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Formula/h/hashcat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
depends_on "pocl"
end

# Fix 'failed to create metal library' on macos
# extract from hashcat version 66b22fa, remove this patch when version released after 66b22fa
# hashcat 66b22fa link: https://github.com/hashcat/hashcat/commit/66b22fa64472b4d809743c35fb05fc3c993a5cd2#diff-1eece723a1d42fd48f0fc4f829ebbb4a67bd13cb3499f49196f801ee9143ee83R15
patch :DATA

def install
args = %W[
CC=#{ENV.cc}
Expand All @@ -52,9 +57,24 @@
(bin/"hashcat").write_env_script bin/"hashcat_bin", XDG_DATA_HOME: share
end

test do

Check warning on line 60 in Formula/h/hashcat.rb

View workflow job for this annotation

GitHub Actions / macOS 14-arm64

`brew test --verbose hashcat` failed on macOS Sonoma (14) on Apple Silicon!

/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.4_1/bin/bundle clean ==> Testing hashcat ==> /opt/homebrew/Cellar/hashcat/6.2.6_1/bin/hashcat_bin --benchmark -m 0 -D 1,2 -w 2 clGetDeviceIDs(): CL_INVALID_VALUE No devices found/left. hashcat (v6.2.6) starting in benchmark mode Started: Wed Aug 21 13:06:32 2024 Stopped: Wed Aug 21 13:06:32 2024 Error: hashcat: failed ::error::hashcat: failed An exception occurred within a child process: Minitest::Assertion: Expected: 0 Actual: 255 /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/minitest-5.25.1/lib/minitest/assertions.rb:176:in `assert' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/minitest-5.25.1/lib/minitest/assertions.rb:216:in `assert_equal' /opt/homebrew/Library/Homebrew/formula_assertions.rb:31:in `shell_output' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11531/lib/types/private/methods/call_validation.rb:270:in `bind_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11531/lib/types/private/methods/call_validation.rb:270:in `validate_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11531/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added' /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/h/hashcat.rb:58:in `block in <class:Hashcat>' /opt/homebrew/Library/Homebrew/formula.rb:2800:in `block (3 levels) in run_test' /opt/homebrew/Library/Homebrew/extend/kernel.rb:536:in `with_env' /opt/homebrew/Library/Homebrew/formula.rb:2799:in `block (2 levels) in run_test' /opt/homebrew/Library/Homebrew/formula.rb:1193:in `with_logging' /opt/homebrew/Library/Homebrew/formula.rb:2798: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:3109:in `mktemp' /opt/homebrew/Library/Homebrew/formula.rb:2792:in `run_test' /opt/homebrew/Library/Homebrew/test.rb:48:in `block in <main>' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.4_1/lib/ruby/3.3.0/timeout.rb:186:in `block in timeout' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.4_1/lib/ruby/3.3.0/timeout.rb:41:in `handle_timeout' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.4_1/lib/ruby/3.3.0/timeout.rb:195:in `timeout' /opt/homebrew/Library/Homebrew/test.rb:52:in `<main>'

Check warning on line 60 in Formula/h/hashcat.rb

View workflow job for this annotation

GitHub Actions / macOS 13-arm64

`brew test --verbose hashcat` failed on macOS Ventura (13) on Apple Silicon!

/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.4_1/bin/bundle clean ==> Testing hashcat ==> /opt/homebrew/Cellar/hashcat/6.2.6_1/bin/hashcat_bin --benchmark -m 0 -D 1,2 -w 2 clGetDeviceIDs(): CL_INVALID_VALUE No devices found/left. hashcat (v6.2.6) starting in benchmark mode Started: Wed Aug 21 13:06:07 2024 Stopped: Wed Aug 21 13:06:07 2024 Error: hashcat: failed ::error::hashcat: failed An exception occurred within a child process: Minitest::Assertion: Expected: 0 Actual: 255 /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/minitest-5.25.1/lib/minitest/assertions.rb:176:in `assert' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/minitest-5.25.1/lib/minitest/assertions.rb:216:in `assert_equal' /opt/homebrew/Library/Homebrew/formula_assertions.rb:31:in `shell_output' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11531/lib/types/private/methods/call_validation.rb:270:in `bind_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11531/lib/types/private/methods/call_validation.rb:270:in `validate_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11531/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added' /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/h/hashcat.rb:58:in `block in <class:Hashcat>' /opt/homebrew/Library/Homebrew/formula.rb:2800:in `block (3 levels) in run_test' /opt/homebrew/Library/Homebrew/extend/kernel.rb:536:in `with_env' /opt/homebrew/Library/Homebrew/formula.rb:2799:in `block (2 levels) in run_test' /opt/homebrew/Library/Homebrew/formula.rb:1193:in `with_logging' /opt/homebrew/Library/Homebrew/formula.rb:2798: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:3109:in `mktemp' /opt/homebrew/Library/Homebrew/formula.rb:2792:in `run_test' /opt/homebrew/Library/Homebrew/test.rb:48:in `block in <main>' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.4_1/lib/ruby/3.3.0/timeout.rb:186:in `block in timeout' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.4_1/lib/ruby/3.3.0/timeout.rb:41:in `handle_timeout' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.4_1/lib/ruby/3.3.0/timeout.rb:195:in `timeout' /opt/homebrew/Library/Homebrew/test.rb:52:in `<main>'

Check failure on line 60 in Formula/h/hashcat.rb

View workflow job for this annotation

GitHub Actions / macOS 12-arm64

`brew test --verbose hashcat` failed on macOS Monterey (12) on Apple Silicon!

/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.4_1/bin/bundle clean ==> Testing hashcat ==> /opt/homebrew/Cellar/hashcat/6.2.6_1/bin/hashcat_bin --benchmark -m 0 -D 1,2 -w 2 clGetDeviceIDs(): CL_INVALID_VALUE No devices found/left. hashcat (v6.2.6) starting in benchmark mode Started: Wed Aug 21 13:22:21 2024 Stopped: Wed Aug 21 13:22:21 2024 Error: hashcat: failed ::error::hashcat: failed An exception occurred within a child process: Minitest::Assertion: Expected: 0 Actual: 255 /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/minitest-5.25.1/lib/minitest/assertions.rb:176:in `assert' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/minitest-5.25.1/lib/minitest/assertions.rb:216:in `assert_equal' /opt/homebrew/Library/Homebrew/formula_assertions.rb:31:in `shell_output' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11531/lib/types/private/methods/call_validation.rb:270:in `bind_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11531/lib/types/private/methods/call_validation.rb:270:in `validate_call' /opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11531/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added' /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/h/hashcat.rb:58:in `block in <class:Hashcat>' /opt/homebrew/Library/Homebrew/formula.rb:2800:in `block (3 levels) in run_test' /opt/homebrew/Library/Homebrew/extend/kernel.rb:536:in `with_env' /opt/homebrew/Library/Homebrew/formula.rb:2799:in `block (2 levels) in run_test' /opt/homebrew/Library/Homebrew/formula.rb:1193:in `with_logging' /opt/homebrew/Library/Homebrew/formula.rb:2798: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:3109:in `mktemp' /opt/homebrew/Library/Homebrew/formula.rb:2792:in `run_test' /opt/homebrew/Library/Homebrew/test.rb:48:in `block in <main>' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.4_1/lib/ruby/3.3.0/timeout.rb:186:in `block in timeout' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.4_1/lib/ruby/3.3.0/timeout.rb:41:in `handle_timeout' /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.4_1/lib/ruby/3.3.0/timeout.rb:195:in `timeout' /opt/homebrew/Library/Homebrew/test.rb:52:in `<main>'
ENV["XDG_DATA_HOME"] = testpath
mkdir testpath/"hashcat"
assert_match "Hash-Mode 0 (MD5)", shell_output("#{bin}/hashcat_bin --benchmark -m 0 -D 1,2 -w 2")
end
end

__END__
diff --git a/OpenCL/inc_vendor.h b/OpenCL/inc_vendor.h
index c39fce952..0916a30b3 100644
--- a/OpenCL/inc_vendor.h
+++ b/OpenCL/inc_vendor.h
@@ -12,7 +12,7 @@
#define IS_CUDA
#elif defined __HIPCC__
#define IS_HIP
-#elif defined __METAL_MACOS__
+#elif defined __METAL__
#define IS_METAL
#else
#define IS_OPENCL
Loading