ruby-debug / debase

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to install Debase

Horki opened this issue · comments

OS: Linux
Linux host 5.17.1-arch1-1 #1 SMP PREEMPT Mon, 28 Mar 2022 20:55:33 +0000 x86_64 GNU/Linux

`Building native extensions. This could take a while...
ERROR: Error installing debase:
ERROR: Failed to build gem native extension.

current directory: ~/.rbenv/versions/2.6.7/lib/ruby/gems/2.6.0/gems/debase-0.2.4.1/ext

~/.rbenv/versions/2.6.7/bin/ruby -I ~/.rbenv/versions/2.6.7/lib/ruby/2.6.0 -r ./siteconf20220416-2577322-1xkmy2i.rb extconf.rb
*** 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
--without-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=~/.rbenv/versions/2.6.7/bin/$(RUBY_BASE_NAME)
~/.rbenv/versions/2.6.7/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require': cannot load such file -- debase/ruby_core_source (LoadError) from ~/.rbenv/versions/2.6.7/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require'
from extconf.rb:28:in `

'

extconf failed, exit code 1

Gem files will remain installed in ~/.rbenv/versions/2.6.7/lib/ruby/gems/2.6.0/gems/debase-0.2.4.1 for inspection.
Results logged to ~/.rbenv/versions/2.6.7/lib/ruby/gems/2.6.0/extensions/x86_64-linux/2.6.0/debase-0.2.4.1/gem_make.out`

I'm also seeing failures trying to install debase into a Ruby 3.1.1 gemset.

OS: macOS 11.6.5 on Apple M1
Darwin hostname 20.6.0 Darwin Kernel Version 20.6.0: Tue Feb 22 21:10:42 PST 2022; root:xnu-7195.141.26~1/RELEASE_ARM64_T8101 arm64

Install output:

➜  git:(master) ✗ gem install debase
Building native extensions. This could take a while...
ERROR:  Error installing debase:
	ERROR: Failed to build gem native extension.

    current directory: $HOME/.rvm/gems/ruby-3.1.1@cuke_base/gems/debase-0.2.4.1/ext
$HOME/.rvm/rubies/ruby-3.1.1/bin/ruby -I $HOME/.rvm/rubies/ruby-3.1.1/lib/ruby/3.1.0 -r ./siteconf20220425-74376-23ny0c.rb extconf.rb
checking for vm_core.h... yes
checking for iseq.h... no
checking for vm_core.h... no
**************************************************************************
No source for ruby-3.1.1-p18 (revision 53f5fc4236a754ddf94b20dbb70ab63bd5109b18) provided with
debase-ruby_core_source gem. Falling back to ruby-3.1.0-p0.
**************************************************************************
checking for vm_core.h... yes
checking for iseq.h... no
Makefile creation failed
*************************************************************

  NOTE: If your headers were not found, try passing
        --with-ruby-include=PATH_TO_HEADERS

*************************************************************

*** 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
	--without-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=$HOME/.rvm/rubies/ruby-3.1.1/bin/$(RUBY_BASE_NAME)
	--with-ruby-dir
	--without-ruby-dir
	--with-ruby-include=${ruby-dir}/include
	--with-ruby-lib
	--without-ruby-lib=${ruby-dir}/lib
	--with-vm_core-dir
	--without-vm_core-dir
	--with-vm_core-include
	--without-vm_core-include=${vm_core-dir}/include
	--with-vm_core-lib
	--without-vm_core-lib=${vm_core-dir}/lib
	--with-iseq-dir
	--without-iseq-dir
	--with-iseq-include
	--without-iseq-include=${iseq-dir}/include
	--with-iseq-lib
	--without-iseq-lib=${iseq-dir}/lib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  $HOME/.rvm/gems/ruby-3.1.1@cuke_base/extensions/arm64-darwin-20/3.1.0/debase-0.2.4.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in $HOME/.rvm/gems/ruby-3.1.1@cuke_base/gems/debase-0.2.4.1 for inspection.
Results logged to $HOME/.rvm/gems/ruby-3.1.1@cuke_base/extensions/arm64-darwin-20/3.1.0/debase-0.2.4.1/gem_make.out

mkmf.log errors:

have_header: checking for iseq.h... -------------------- no

DYLD_FALLBACK_LIBRARY_PATH=.:$HOME/.rvm/rubies/ruby-3.1.1/lib "gcc -I$HOME/.rvm/rubies/ruby-3.1.1/include/ruby-3.1.0/arm64-darwin20 -I$HOME/.rvm/rubies/ruby-3.1.1/include/ruby-3.1.0/ruby/backward -I$HOME/.rvm/rubies/ruby-3.1.1/include/ruby-3.1.0 -I. -I$HOME/.rvm/gems/ruby-3.1.1@cuke_base/gems/debase-ruby_core_source-0.10.15/lib/debase/ruby_core_source/ruby-3.1.0-p0 -O3 -I/opt/homebrew/opt/libyaml/include -I/opt/homebrew/opt/libksba/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/openssl@1.1/include -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens -Wundef -fno-common -pipe   -c conftest.c"
In file included from conftest.c:3:
In file included from $HOME/.rvm/gems/ruby-3.1.1@cuke_base/gems/debase-ruby_core_source-0.10.15/lib/debase/ruby_core_source/ruby-3.1.0-p0/iseq.h:14:
In file included from $HOME/.rvm/gems/ruby-3.1.1@cuke_base/gems/debase-ruby_core_source-0.10.15/lib/debase/ruby_core_source/ruby-3.1.0-p0/vm_core.h:74:
In file included from $HOME/.rvm/gems/ruby-3.1.1@cuke_base/gems/debase-ruby_core_source-0.10.15/lib/debase/ruby_core_source/ruby-3.1.0-p0/method.h:15:
$HOME/.rvm/gems/ruby-3.1.1@cuke_base/gems/debase-ruby_core_source-0.10.15/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/imemo.h:234:5: error: implicit declaration of function 'RB_OBJ_WRITE' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    RB_OBJ_WRITE(m, &m->v1, v);
    ^
$HOME/.rvm/gems/ruby-3.1.1@cuke_base/gems/debase-ruby_core_source-0.10.15/lib/debase/ruby_core_source/ruby-3.1.0-p0/internal/imemo.h:240:5: error: implicit declaration of function 'RB_OBJ_WRITE' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    RB_OBJ_WRITE(m, &m->v2, v);
    ^
2 errors generated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <iseq.h>
/* end */

--------------------

And my .zshrc contains:
export optflags="-Wno-error=shorten-64-to-32 -Wno-error=implicit-function-declaration"

Also failing with similar output on Windows subsystem Debian.
Ruby version 3.1.2p20, and Rails 7.0.2.4.
I also tried version 0.2.3 which gave the same error, but was able to install the 0.2.2 successfully.

It looks like this is fixed in debase 0.25.beta2.

gem 'debase', :git => 'https://github.com/ruby-debug/debase.git', :tag => 'v0.2.5.beta2'

It looks like this is fixed in debase 0.25.beta2.

gem 'debase', :git => 'https://github.com/ruby-debug/debase.git', :tag => 'v0.2.5.beta2'

Yes, it was. Thanks @jlm!

Is it fixed, or is it fixed for darwin (in the v0.2.5.beta2 release) in a way that breaks installing on Linux?

(I'm unable to install the same version of debase on both Linux and macos, and since:

You cannot specify the same gem twice with different version requirements.
You specified: debase (~> 0.2.5.beta2) and debase (~> 0.2.4)

I'm not sure how to proceed... I need a Gemfile that will build successfully on either MacOS or Linux

Edit: I mean, I personally was able to work through this issue by choosing one or the other platform today, but this seems like an outstanding problem remains still, else the beta release probably would be published as 0.2.5 (?)

Can confirm, this issue persists. Using 0.2.5.beta2 and installing on the base 3.1.2 ruby image from docker hub fails.

fixed: arch linux version

PKG_CONFIG_PATH=/usr/lib/openssl-1.1/pkgconfig rbenv install 2.6.7 # reinstall ruby version, to receive missing header files
gem install debase