ruby / ruby/snap.ruby

Can't install gems cbor, raindrops, kgio, and stackprof

オープン
#28 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
HTML
スター
32
フォーク
5
平均マージ
14時間 17分
マージ済み PR(30日)
1

説明

Hi,

Recently noticed failures in installing the following gems on VMs running Ubuntu Bionic. Each with a different weird and wonderful error.

ubuntu@juju-87625f-hloeung-66:~$ sudo snap install ruby --channel 2.7/stable --classic
2021-10-25T03:34:26Z INFO Waiting for automatic snapd restart...
ruby (2.7/stable) 2.7.4 from Ruby core team (rubylang✓) installed

For cbor:

ubuntu@juju-87625f-hloeung-66:~$ gem install cbor -v '0.5.9.6' --source 'https://rubygems.org/'
Fetching cbor-0.5.9.6.gem
Building native extensions. This could take a while...
ERROR: Error installing cbor:
ERROR: Failed to build gem native extension.

current directory: /home/ubuntu/.gem/gems/cbor-0.5.9.6/ext/cbor

/snap/bin/ruby -I /snap/ruby/231/lib/ruby/2.7.0 -r ./siteconf20211025-27308-7v0y83.rb extconf.rb
checking for ruby/st.h... yes
checking for st.h... yes
checking for rb_str_replace() in ruby.h... no
checking for rb_big_new() in ruby.h... no
checking for rb_intern_str() in ruby.h... no
checking for rb_sym2str() in ruby.h... no
checking for rb_str_intern() in ruby.h... no
checking for rb_integer_unpack() in ruby.h... no
creating Makefile

current directory: /home/ubuntu/.gem/gems/cbor-0.5.9.6/ext/cbor
make "DESTDIR=" clean

current directory: /home/ubuntu/.gem/gems/cbor-0.5.9.6/ext/cbor
make "DESTDIR="
compiling buffer.c
In file included from buffer.h:33:0,
from buffer.c:28:
sysdep.h:133:2: error: #error this size of bignum digits SIZEOF_BDIGITS not implemented
#error this size of bignum digits SIZEOF_BDIGITS not implemented
^~~~~
Makefile:244: recipe for target 'buffer.o' failed
make: *** [buffer.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/ubuntu/.gem/gems/cbor-0.5.9.6 for inspection.
Results logged to /home/ubuntu/.gem/extensions/x86_64-linux/2.7.0/cbor-0.5.9.6/gem_make.out

For raindrops:

ubuntu@juju-87625f-hloeung-66:~$ gem install raindrops -v '0.19.2' --source 'https://rubygems.org/'
Fetching raindrops-0.19.2.gem
Building native extensions. This could take a while...
ERROR: Error installing raindrops:
ERROR: Failed to build gem native extension.

current directory: /home/ubuntu/.gem/gems/raindrops-0.19.2/ext/raindrops

/snap/bin/ruby -I /snap/ruby/231/lib/ruby/2.7.0 -r ./siteconf20211025-3245-1j4wwzl.rb extconf.rb
...
make "DESTDIR="
compiling linux_inet_diag.c
In file included from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33:0,
from /usr/include/stdio.h:27,
from /snap/ruby/231/include/ruby-2.7.0/ruby/defines.h:126,
from /snap/ruby/231/include/ruby-2.7.0/ruby/ruby.h:29,
from /snap/ruby/231/include/ruby-2.7.0/ruby.h:33,
from linux_inet_diag.c:1:
/usr/include/features.h:184:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]

warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"

^~~~~~~
linux_inet_diag.c:20:4: error: #error Ruby <= 1.8 not supported

error Ruby <= 1.8 not supported

^~~~~

linux_inet_diag.c: In function ‘tcp_stats’:
linux_inet_diag.c:589:14: warning: implicit declaration of function ‘rd_fd_region’; did you mean ‘rb_fd_zero’? [-Wimplicit-function-declaration]
nl_errcheck(rd_fd_region(diag, args, args->fd));
^~~~~~~~~~~~
rb_fd_zero
Makefile:244: recipe for target 'linux_inet_diag.o' failed
make: *** [linux_inet_diag.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/ubuntu/.gem/gems/raindrops-0.19.2 for inspection.

For kgio:

ubuntu@juju-87625f-hloeung-66:~$ gem install kgio -v '2.11.3' --source 'https://rubygems.org/'
Fetching kgio-2.11.3.gem
Building native extensions. This could take a while...
ERROR: Error installing kgio:
ERROR: Failed to build gem native extension.

current directory: /home/ubuntu/.gem/gems/kgio-2.11.3/ext/kgio

/snap/bin/ruby -I /snap/ruby/231/lib/ruby/2.7.0 -r ./siteconf20211025-3878-10052w1.rb extconf.rb
checking for CLOCK_MONOTONIC in time.h... yes
...
current directory: /home/ubuntu/.gem/gems/kgio-2.11.3/ext/kgio
make "DESTDIR="
compiling accept.c
In file included from kgio.h:24:0,
from accept.c:4:
ancient_ruby.h: In function ‘my_str_set_len’:
ancient_ruby.h:7:14: error: ‘struct RString’ has no member named ‘len’
RSTRING(str)->len = len;
^~
ancient_ruby.h:8:14: error: ‘struct RString’ has no member named ‘ptr’
RSTRING(str)->ptr[len] = '\0';
^~
In file included from accept.c:93:0:
/snap/ruby/231/include/ruby-2.7.0/ruby/backward/rubysig.h: At top level:
/snap/ruby/231/include/ruby-2.7.0/ruby/backward/rubysig.h:14:2: warning: #warning rubysig.h is obsolete [-Wcpp]
#warning rubysig.h is obsolete
^~~~~~~
accept.c: In function ‘thread_accept’:
accept.c:104:2: error: ‘TRAP_BEG’ undeclared (first use in this function)
TRAP_BEG;
^~~~~~~~
accept.c:104:2: note: each undeclared identifier is reported only once for each function it appears in
accept.c:106:2: error: ‘TRAP_END’ undeclared (first use in this function); did you mean ‘TRAP_BEG’?
TRAP_END;
^~~~~~~~
TRAP_BEG
Makefile:244: recipe for target 'accept.o' failed
make: *** [accept.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/ubuntu/.gem/gems/kgio-2.11.3 for inspection.
Results logged to /home/ubuntu/.gem/extensions/x86_64-linux/2.7.0/kgio-2.11.3/gem_make.out

Finally, for stackprof:

ubuntu@juju-87625f-hloeung-66:~$ gem install stackprof -v '0.2.16' --source 'https://rubygems.org/'
Fetching stackprof-0.2.16.gem
Building native extensions. This could take a while...
ERROR: Error installing stackprof:
ERROR: Failed to build gem native extension.

current directory: /home/ubuntu/.gem/gems/stackprof-0.2.16/ext/stackprof

/snap/bin/ruby -I /snap/ruby/231/lib/ruby/2.7.0 -r ./siteconf20211025-4178-1dtvnzk.rb extconf.rb
checking for rb_postponed_job_register_one()... no
*** 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=/snap/ruby/231/bin/$(RUBY_BASE_NAME)
extconf.rb:8:in `

': missing API: are you using ruby 2.1+? (RuntimeError)

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

/home/ubuntu/.gem/extensions/x86_64-linux/2.7.0/stackprof-0.2.16/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/ubuntu/.gem/gems/stackprof-0.2.16 for inspection.
Results logged to /home/ubuntu/.gem/extensions/x86_64-linux/2.7.0/stackprof-0.2.16/gem_make.out
ubuntu@juju-87625f-hloeung-66:~$:

The last successful collection of these were from Jan 7th so I think it may be related to the recent core18 to core20 change - https://github.com/ruby/snap.ruby/pull/26

It's possible it's commits around then, I'm not sure.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

ruby/snap.ruby#26 で参照されている core18 から core20 への変更を起点として、Ruby snap を使用して Ubuntu Bionic で4つの gem インストール失敗を再現します。cbor、raindrops、kgio、stackprof のネイティブ拡張の出力を、buffer.c、linux_inet_diag.c、ancient_ruby.h、accept.c、extconf.rb を含めて比較します。4つの対象バージョンすべてが正常にインストールできるよう、snap の互換性の原因を特定して解決できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
linux, ruby, ubuntu
領域
build-system, devops, infrastructure
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。