ruby / ruby/snap.ruby

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

未关闭
#28 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
HTML
星标
32
派生
5
平均合并
14 小时 17 分钟
30 天内合并 PR
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. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

使用 Ruby snap 在 Ubuntu Bionic 上复现四个 gem 安装失败,首先处理 ruby/snap.ruby#26 中引用的从 core18 到 core20 的变更。比较 cbor、raindrops、kgio 和 stackprof 的 native extension 输出,包括 buffer.c、linux_inet_diag.c、ancient_ruby.h、accept.c 和 extconf.rb。完成的标准是识别并解决 snap 兼容性原因,使列出的四个版本都能成功安装。

由索引模型根据 Issue 内容生成。

评估

技术栈
linux, ruby, ubuntu
领域
build-system, devops, infrastructure
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。