Closed sandstrom closed 3 years ago
Hello,
Thanks for the bug report. I see in your logs:
Using rake 13.0.3
Using concurrent-ruby 1.1.8
Using i18n 1.8.9
Using minitest 5.10.3
[… redacted for brevity]
Using therubyracer 0.12.3
Using tzinfo-data 1.2021.1
Using user_agent_parser 2.7.0
where those dependencies are coming from? We aren't using them as far as I know.
I just tried on macOS Big Sur with Ruby 3.0.0 and it succeeded with no issue.
I've then installed Ruby 2.6.6 with rbenv
and retried. It succeeded with no issue.
[…]
current directory: /Users/hwhost/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/wasmer-0.5.0
/Users/hwhost/.rbenv/versions/2.6.6/bin/ruby -rrubygems /Users/hwhost/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/rake-13.0.3/exe/rake RUBYARCHDIR\=/Users/hwhost/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/extensions/-darwin-20/2.6.0/wasmer-0.5.0 RUBYLIBDIR\=/Users/hwhost/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/extensions/-darwin-20/2.6.0/wasmer-0.5.0
Successfully installed wasmer-0.5.0
Parsing documentation for wasmer-0.5.0
Parsing sources...
100% [ 2/ 2] lib/wasmer.rb
Installing ri documentation for wasmer-0.5.0
Done installing documentation for wasmer after 0 seconds
1 gem installed
How did you install Ruby 2.6.6?
~I installed it via https://github.com/postmodern/ruby-install,
something likebrew install ruby-install && ruby-install 2.6
~
Here is a repo with what I need to reproduce on my machine
Checked the install script (Rakefile), could it be that I don't have cargo
installed? (not found…)
Tried adding cargo, but doesn't seem to help.
Looking closer at the error message, I think this is the failing line:
https://github.com/wasmerio/wasmer-ruby/blob/master/Rakefile#L12
Don't know why though, but maybe there are assumptions there, about the host environment, that one shouldn't do in a general install script?
Maybe you could check similar install scripts in other gems, and see what they've done?
Thank you for the investigation. I'll try to find time to address that. I'll keep you updated.
@Hywan Check out this script from Skylight. They also have a rust-agent, so should be fairly similar to your case.
It's also a very well-written gem (one of its authors is a former Rails core team member and (I think) also a former Rust core team member).
https://github.com/skylightio/skylight-ruby/blob/master/ext/extconf.rb https://github.com/skylightio/skylight-ruby/blob/master/skylight.gemspec#L49
I've failed to reproduce your error even with the given repository.
What version of gem
do you have?
To simplify our debugging session, can you please try to clone this repository, and run:
$ rake test
I suspect that you have a static version of Ruby, which isn't compatible with how rutie
works (rutie
is the underlying library we use to integrate seamlessly with Ruby). Check the Dynamic vs Static Builds Section to learn more. Can you please give me the result of:
$ ruby -e "pp RbConfig::CONFIG['ENABLE_SHARED']"
We should see a "yes"
.
Yes, you are correct, I have a static version of ruby.
I left a comment in rutie (https://github.com/danielpclark/rutie/issues/45#issuecomment-861326518), about maybe checking if helix has found a solution to this problem. Other than that, I don't have much I can contribute.
Still looking forward to trying out wasmer! I'll see if we can change our environment setup to use dynamic ruby. If that isn't easily, we'll have to wait and see if rutie gets support for static builds. Thanks for taking time looking into this!
Maybe you could add that check to the rake file, raise "Expected dynamic ruby, see http://www….com" unless pp(RbConfig::CONFIG['ENABLE_SHARED']) == 'yes'
Yeah, raising such error is indeed a good idea.
For what project would you like to use wasmer-ruby
? I'm curious :-).
(Closing the issue as the problem is “solved”).
Evaluate untrusted code (probably AssemblyScript) in a Rails application.
Yeah, feel free to close, agree initial issue is "solved"!
Two things that one could do though:
It's up to you and the Wasmer team though to decide, obviously! 😄
Either way I'll keep my eyes on this and hopefully we'll be able to give it a try in 3-6 months, if we're lucky 💯
If you're willing to open a PR to raise an error/warning when the Ruby version has been statically distributed, I would be very happy to merge it!
I can try to take a look at Rutie itself also, as soon as I've time :-).
Tried to install on macOS 11.4 (Big Sur) and got this error: