Error compiling BigDecimal extension
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Ruby
- Star
- 875
- Fork
- 68
- Merge trung bình
- 9 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
with this gem file:
source 'https://rubygems.org'
gem 'js', '~> 2.5'
gem 'ruby_wasm', '~> 2.5'
gem 'prawn', '~> 2.5'
fails with this error:
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include=${opt-dir}/include
--without-opt-include
--with-opt-lib=${opt-dir}/lib
--without-opt-lib
--with-make-prog
--without-make-prog
--srcdir=/Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bigdecimal-3.1.8/ext/bigdecimal
--curdir
--ruby=/usr/local/bin/$(RUBY_BASE_NAME)
/Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:480:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:606:in `block in try_compile'
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:555:in `with_werror'
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:606:in `try_compile'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bigdecimal-3.1.8/ext/bigdecimal/extconf.rb:6:in `block in have_builtin_func'
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:983:in `block in checking_for'
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:344:in `block (2 levels) in postpone'
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:314:in `open'
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:344:in `block in postpone'
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:314:in `open'
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:340:in `postpone'
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:982:in `checking_for'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bigdecimal-3.1.8/ext/bigdecimal/extconf.rb:5:in `have_builtin_func'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bigdecimal-3.1.8/ext/bigdecimal/extconf.rb:18:in `<top (required)>'
from -e:5:in `require_relative'
from -e:5:in `<main>'
checking for __builtin_clz()... ...
*** /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bigdecimal-3.1.8/ext/bigdecimal/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=${opt-dir}/include
--without-opt-include
--with-opt-lib=${opt-dir}/lib
--without-opt-lib
--with-make-prog
--without-make-prog
--srcdir=/Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bigdecimal-3.1.8/ext/bigdecimal
--curdir
--ruby=/usr/local/bin/$(RUBY_BASE_NAME)
/Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:480:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:606:in `block in try_compile'
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:555:in `with_werror'
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:606:in `try_compile'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bigdecimal-3.1.8/ext/bigdecimal/extconf.rb:6:in `block in have_builtin_func'
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:983:in `block in checking_for'
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:344:in `block (2 levels) in postpone'
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:314:in `open'
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:344:in `block in postpone'
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:314:in `open'
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:340:in `postpone'
from /Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/lib/ruby/3.3.0/mkmf.rb:982:in `checking_for'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bigdecimal-3.1.8/ext/bigdecimal/extconf.rb:5:in `have_builtin_func'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bigdecimal-3.1.8/ext/bigdecimal/extconf.rb:18:in `<top (required)>'
from -e:5:in `require_relative'
from -e:5:in `<main>'
Try running with rake --verbose for more complete output.
bundler: failed to load command: rbwasm (/Users/marcosbellucci/.rbenv/versions/3.3.0/bin/rbwasm)
/Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/lib/ruby_wasm/build/executor.rb:77:in system': Command failed with status (1): '/Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/bin/ruby' '-C' '/Users/marcosbellucci/code/prawn_box_2/app/build/wasm32-unknown-wasip1/ruby-3.3-wasm32-unknown-wasip1-full-3f82af526b9cf91fdd37dcda45809fad-ext/bigdecimal-3.1.8/ext/bigdecimal' '--disable=gems' '-e' '$top_srcdir="/Users/marcosbellucci/code/prawn_box_2/app/build/checkouts/3.3"' '-e' '$extout="/Users/marcosbellucci/code/prawn_box_2/app/build/wasm32-unknown-wasip1/ruby-3.3-wasm32-unknown-wasip1-full-3f82af526b9cf91fdd37dcda45809fad/.ext"' '-e' '$static = true; trace_var(:$static) {|v| $static = true }' '-e' '$0="/Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bigdecimal-3.1.8/ext/bigdecimal/extconf.rb"' '-e' 'require_relative "/Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bigdecimal-3.1.8/ext/bigdecimal/extconf.rb"' '-e' 'require "json"; File.write("/Users/marcosbellucci/code/prawn_box_2/app/build/wasm32-unknown-wasip1/ruby-3.3-wasm32-unknown-wasip1-full-3f82af526b9cf91fdd37dcda45809fad-ext/bigdecimal-3.1.8/ext/bigdecimal/rbwasm.metadata.json", JSON.dump({target: $target}))' '-I/Users/marcosbellucci/code/prawn_box_2/app/build/wasm32-unknown-wasip1/ruby-3.3-wasm32-unknown-wasip1-full-3f82af526b9cf91fdd37dcda45809fad' '--' '--disable-component-model' (RuntimeError)
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/lib/ruby_wasm/build/product/crossruby.rb:116:in do_legacy_extconf'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/lib/ruby_wasm/build/product/crossruby.rb:70:in do_extconf'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/lib/ruby_wasm/build/product/crossruby.rb:48:in build'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/lib/ruby_wasm/build/product/crossruby.rb:190:in block in build_exts'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/lib/ruby_wasm/build/product/crossruby.rb:188:in each'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/lib/ruby_wasm/build/product/crossruby.rb:188:in build_exts'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/lib/ruby_wasm/build/product/crossruby.rb:209:in build'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/lib/ruby_wasm/packager/core.rb:292:in block in build'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler.rb:424:in block in with_unbundled_env'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler.rb:679:in with_env'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler.rb:424:in with_unbundled_env'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/lib/ruby_wasm/packager/core.rb:64:in with_unbundled_env'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/lib/ruby_wasm/packager/core.rb:291:in build'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/lib/ruby_wasm/packager/core.rb:11:in build'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/lib/ruby_wasm/packager.rb:28:in package'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/lib/ruby_wasm/cli.rb:352:in do_build'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/lib/ruby_wasm/cli.rb:171:in block in do_build_with_force_ruby_platform'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/3.3.0/tmpdir.rb:99:in mktmpdir'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/lib/ruby_wasm/cli.rb:170:in do_build_with_force_ruby_platform'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/lib/ruby_wasm/cli.rb:137:in block in build'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/settings.rb:157:in temporary'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/lib/ruby_wasm/cli.rb:136:in build'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/lib/ruby_wasm/cli.rb:34:in run'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/ruby_wasm-2.7.0-arm64-darwin/exe/rbwasm:7:in <top (required)>'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/bin/rbwasm:25:in load'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/bin/rbwasm:25:in <top (required)>'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/cli/exec.rb:58:in load'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/cli/exec.rb:58:in kernel_load'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/cli/exec.rb:23:in run'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/cli.rb:455:in exec'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/vendor/thor/lib/thor/command.rb:28:in run'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in invoke_command'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/vendor/thor/lib/thor.rb:527:in dispatch'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/cli.rb:35:in dispatch'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/vendor/thor/lib/thor/base.rb:584:in start'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/cli.rb:29:in start'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/exe/bundle:28:in block in <top (required)>'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/lib/bundler/friendly_errors.rb:117:in with_friendly_errors'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.11/exe/bundle:20:in <top (required)>'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/bin/bundle:25:in load'
from /Users/marcosbellucci/.rbenv/versions/3.3.0/bin/bundle:25:in
This is the command that fails:
'/Users/marcosbellucci/code/prawn_box_2/app/build/arm64-apple-darwin23/baseruby-3.3/opt/bin/ruby' '-C' '/Users/marcosbellucci/code/prawn_box_2/app/build/wasm32-unknown-wasip1/ruby-3.3-wasm32-unknown-wasip1-full-3f82af526b9cf91fdd37dcda45809fad-ext/bigdecimal-3.1.8/ext/bigdecimal' '--disable=gems' '-e' '$top_srcdir="/Users/marcosbellucci/code/prawn_box_2/app/build/checkouts/3.3"' '-e' '$extout="/Users/marcosbellucci/code/prawn_box_2/app/build/wasm32-unknown-wasip1/ruby-3.3-wasm32-unknown-wasip1-full-3f82af526b9cf91fdd37dcda45809fad/.ext"' '-e' '$static = true; trace_var(:$static) {|v| $static = true }' '-e' '$0="/Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bigdecimal-3.1.8/ext/bigdecimal/extconf.rb"' '-e' 'require_relative "/Users/marcosbellucci/.rbenv/versions/3.3.0/lib/ruby/gems/3.3.0/gems/bigdecimal-3.1.8/ext/bigdecimal/extconf.rb"' '-e' 'require "json"; File.write("/Users/marcosbellucci/code/prawn_box_2/app/build/wasm32-unknown-wasip1/ruby-3.3-wasm32-unknown-wasip1-full-3f82af526b9cf91fdd37dcda45809fad-ext/bigdecimal-3.1.8/ext/bigdecimal/rbwasm.metadata.json", JSON.dump({target: $target}))' '-I/Users/marcosbellucci/code/prawn_box_2/app/build/wasm32-unknown-wasip1/ruby-3.3-wasm32-unknown-wasip1-full-3f82af526b9cf91fdd37dcda45809fad' '--' '--disable-component-model'
removing the -I/Users/marcosbellucci/code/prawn_box_2/app/build/wasm32-unknown-wasip1/ruby-3.3-wasm32-unknown-wasip1-full-3f82af526b9cf91fdd37dcda45809fad makes it work.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện bundle exec rbwasm build -o app.wasm với Gemfile được cung cấp, rồi kiểm tra lỗi của BigDecimal trong extconf.rb và mkmf.log của nó. Xác định lý do extension BigDecimal không thể biên dịch cho target wasm; công việc được xem là hoàn tất khi cùng build đó hoàn thành thành công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- ruby, wasm
- Lĩnh vực
- build-system
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100