Conversation
There was a problem hiding this comment.
This is great, thank you so much Ian.
I see the cross-compile's smoke test fails:
ERROR: Error installing pkg/wasmtime-rb-0.1.0-x86_64-linux.gem: wasmtime-rb-0.1.0-x86_64-linux requires Ruby version >= 3.0, < > 3.1.dev. The current ruby version is 3.1.2.20.
Looks like we're only building for 3.0.0:
no configuration section for specified version of Ruby (rbconfig-x86_64-linux-"3.1.0)
no configuration section for specified version of Ruby (rbconfig-x86_64-linux-2.7.0")
Searching for that error message led me to rake-compiler. Looks like config.yml doesn't have entries for all rubies. Is it because xrubies bundles 1 ruby version per image, unlike rake-compiler-docker?
Edit: also no idea where 3.0.0 is coming from. I understand the intent to be "build for all RUBY_CC_VERSION", not only 3.0.0 🤔.
.github/workflows/ci.yml
Outdated
| run: | | ||
| bundle exec rake build | ||
| gem install pkg/wasmtime-rb-*.gem --verbose | ||
| script="puts Wasmtime::Engine.new(Wasmtime::Config.new).precompile_module('(module)')" |
There was a problem hiding this comment.
Nit: the config is optional now, this should also work:
| script="puts Wasmtime::Engine.new(Wasmtime::Config.new).precompile_module('(module)')" | |
| script="puts Wasmtime::Engine.new.precompile_module('(module)')" |
|
@jbourassa I am very confused about this as well. Not sure where the bug is… Gonna contact rake-compiler team |
|
The current error, I think, is because rake-compiler will put the cross-compiled shared object file into a subdirectory named after the ruby minor version (e.g., You can see this in the build log: https://github.com/bytecodealliance/wasmtime-rb/actions/runs/3340442663/jobs/5530540697#step:4:280 You should look first for a ruby-specific precompiled .so, and fall back to An example of how to do this is
Hope this helps! |
This is a PR to setup cross gem compilation. Right now, it just adds the ability to cross compile gems via Github UI. We'll figure out publishing later.