Trying to run bundle install but gets blocked on thrift-0.16.0 dependency
Hi, I am trying to run this command on macOS Big Sur in the Gitlab core repo:
bundle exec rake gitlab:audit_event_types:compile_docs
This command tells me to install the missing dependency thrift-0.16.0. I tried to install thrift manually using this command:
gem install thrift -v 0.16.0 -- --with-cppflags="-Wno-compound-token-split-by-macro"
but, it fails and gives me this output:
Building native extensions with: '--with-cppflags=-Wno-compound-token-split-by-macro'
This could take a while...
ERROR: Error installing thrift:
ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/3.2.0/gems/thrift-0.16.0/ext
/usr/local/opt/ruby/bin/ruby extconf.rb --with-cppflags\=-Wno-compound-token-split-by-macro
checking for strlcpy() in string.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/Cellar/ruby/3.2.2_1/bin/$(RUBY_BASE_NAME)
/usr/local/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/mkmf.rb:490:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/local/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/mkmf.rb:583:in `try_link0'
from /usr/local/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/mkmf.rb:601:in `try_link'
from /usr/local/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/mkmf.rb:812:in `try_func'
from /usr/local/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/mkmf.rb:1116:in `block in have_func'
from /usr/local/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/mkmf.rb:989:in `block in checking_for'
from /usr/local/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/mkmf.rb:354:in `block (2 levels) in postpone'
from /usr/local/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/mkmf.rb:324:in `open'
from /usr/local/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/mkmf.rb:354:in `block in postpone'
from /usr/local/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/mkmf.rb:324:in `open'
from /usr/local/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/mkmf.rb:350:in `postpone'
from /usr/local/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/mkmf.rb:988:in `checking_for'
from /usr/local/Cellar/ruby/3.2.2_1/lib/ruby/3.2.0/mkmf.rb:1115:in `have_func'
from extconf.rb:31:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/local/lib/ruby/gems/3.2.0/extensions/x86_64-darwin-20/3.2.0/thrift-0.16.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /usr/local/lib/ruby/gems/3.2.0/gems/thrift-0.16.0 for inspection.
Results logged to /usr/local/lib/ruby/gems/3.2.0/extensions/x86_64-darwin-20/3.2.0/thrift-0.16.0/gem_make.out
It would be great if someone can help me out with this issue. Tried other solutions as well available on the internet but, it's not helping.
Edited by Harshit Prasad