Giter Club home page Giter Club logo

Comments (12)

sandstrom avatar sandstrom commented on July 30, 2024 1

Here is a repo with what I need to reproduce on my machine

https://github.com/sandstrom/wasmer-install-repro

from wasmer-ruby.

Hywan avatar Hywan commented on July 30, 2024 1

Thank you for the investigation. I'll try to find time to address that. I'll keep you updated.

from wasmer-ruby.

sandstrom avatar sandstrom commented on July 30, 2024 1

@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

from wasmer-ruby.

Hywan avatar Hywan commented on July 30, 2024

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?

from wasmer-ruby.

sandstrom avatar sandstrom commented on July 30, 2024

I installed it via https://github.com/postmodern/ruby-install,
something likebrew install ruby-install && ruby-install 2.6

from wasmer-ruby.

sandstrom avatar sandstrom commented on July 30, 2024

Checked the install script (Rakefile), could it be that I don't have cargo installed? (not found…)

from wasmer-ruby.

sandstrom avatar sandstrom commented on July 30, 2024

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?

from wasmer-ruby.

Hywan avatar Hywan commented on July 30, 2024

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".

from wasmer-ruby.

sandstrom avatar sandstrom commented on July 30, 2024

Yes, you are correct, I have a static version of ruby.

I left a comment in rutie (danielpclark/rutie#45 (comment)), 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'

from wasmer-ruby.

Hywan avatar Hywan commented on July 30, 2024

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”).

from wasmer-ruby.

sandstrom avatar sandstrom commented on July 30, 2024

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:

  • Add the suggested warning above (for others that trip on this)
  • Check in with the rutie folks and see how much work it would be to support static builds (and if it's possible to help out).

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 💯

from wasmer-ruby.

Hywan avatar Hywan commented on July 30, 2024

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 :-).

from wasmer-ruby.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.