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

Add /opt/homebrew/include to include path #973

Open
vp993 opened this issue Sep 10, 2022 · 0 comments
Open

Add /opt/homebrew/include to include path #973

vp993 opened this issue Sep 10, 2022 · 0 comments

Comments

@vp993
Copy link

vp993 commented Sep 10, 2022

Hi everyone,

As you know, Homebrew on M1 Macs is moved to /opt/homebrew, there were already number of issues connected to it. Some of them even led to upd. 0.15.2 which added opt/homebrew/lib to lib resolve path.

However, FFI does not use /opt/homebrew/include as include path, which leads to issues with gems such: https://github.com/cryptape/ruby-bitcoin-secp256k1

I fixed the issue linking the header file into /usr/local/include, but it's not the best solution.

ln -s /opt/homebrew/include/secp256k1.h /usr/local/include

I propose to add /opt/homebrew/include into include path to fix it correctly.

Here is the error log:

Gem Load Error is: Compilation error generating constants BitcoinSecp256k1:
        /var/folders/7w/3qbqdjjx7fs3q90khl91_jh00000gn/T/BitcoinSecp256k1.const_generator20220910-5936-9j7iei:3:10: fatal error: 'secp256k1.h' file not found
        #include <secp256k1.h>
                 ^~~~~~~~~~~~~
        1 error generated.
Backtrace for gem load error is:
/.../gems/ffi-1.15.5/lib/ffi/tools/const_generator.rb:133:in `block in calculate'
/.rvm/rubies/ruby-2.7.6/lib/ruby/2.7.0/tempfile.rb:291:in `open'
/.../gems/ffi-1.15.5/lib/ffi/tools/const_generator.rb:110:in `calculate'
/.../gems/ffi-1.15.5/lib/ffi/tools/const_generator.rb:49:in `initialize'
/.../bundler/gems/ruby-bitcoin-secp256k1-8a97edf7f923/lib/bitcoin_secp256k1/c.rb:11:in `new'
/.../bundler/gems/ruby-bitcoin-secp256k1-8a97edf7f923/lib/bitcoin_secp256k1/c.rb:11:in `<module:C>'
/.../bundler/gems/ruby-bitcoin-secp256k1-8a97edf7f923/lib/bitcoin_secp256k1/c.rb:6:in `<module:BitcoinSecp256k1>'
/.../bundler/gems/ruby-bitcoin-secp256k1-8a97edf7f923/lib/bitcoin_secp256k1/c.rb:5:in `<main>'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/.../gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `block in require'
/.../gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
/.../gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `require'
/.../bundler/gems/ruby-bitcoin-secp256k1-8a97edf7f923/lib/bitcoin_secp256k1.rb:3:in `<main>'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/.../gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `block in require'
/.../gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
/.../gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `require'
/.../gems/zilliqa-0.1.5/lib/zilliqa/crypto/key_tool.rb:1:in `<main>'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/.../gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `block in require'
/.../gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
/.../gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `require'
/.../gems/zilliqa-0.1.5/lib/zilliqa.rb:2:in `<main>'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/.../gems/bundler-2.3.21/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
/.../gems/bundler-2.3.21/lib/bundler/runtime.rb:55:in `each'
/.../gems/bundler-2.3.21/lib/bundler/runtime.rb:55:in `block in require'
/.../gems/bundler-2.3.21/lib/bundler/runtime.rb:44:in `each'
/.../gems/bundler-2.3.21/lib/bundler/runtime.rb:44:in `require'
/.../gems/bundler-2.3.21/lib/bundler.rb:187:in `require'
/.../config/application.rb:19:in `<main>'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/.../gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `block in require'
/.../gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
/.../gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `require'
/.../gems/railties-6.0.3.4/lib/rails/commands/server/server_command.rb:141:in `block in perform'
/.../gems/railties-6.0.3.4/lib/rails/commands/server/server_command.rb:138:in `tap'
/.../gems/railties-6.0.3.4/lib/rails/commands/server/server_command.rb:138:in `perform'
/.../gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
/.../gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
/.../gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
/.../gems/railties-6.0.3.4/lib/rails/command/base.rb:69:in `perform'
/.../gems/railties-6.0.3.4/lib/rails/command.rb:46:in `invoke'
/.../gems/railties-6.0.3.4/lib/rails/commands.rb:18:in `<main>'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/.../gems/bootsnap-1.5.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/.../gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `block in require'
/.../gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:291:in `load_dependency'
/.../gems/activesupport-6.0.3.4/lib/active_support/dependencies.rb:324:in `require'
bin/rails:4:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant