wasmerio / wasmer-ruby

💎🕸 WebAssembly runtime for Ruby
https://wasmer.io
MIT License
471 stars 18 forks source link

Remove bundle install rakefile #58

Closed tsmartt closed 3 years ago

tsmartt commented 3 years ago

Wonderful library. We use it for our app publishers.

This PR resolves this ticket. An install would break our build because of the call to bundle in Rakefile. I've added these as development dependencies and make the default task the one that builds the library. Ideally, we'd package a native gem like mentioned here, but this at least stops us from polluting the bundle namespace and breaking builds.

tsmartt commented 3 years ago

@Hywan any thoughts?

Hywan commented 3 years ago

Hello @tsmartt!

Thank you for your PR, and I'm happy to learn you're using wasmer-ruby :-)! I'm OK with this PR, but I'm not a regular Ruby user hences comes my question: How the user is supposed to install the extension then? The part that changes the local path is a hack to be able to test the documentation, but I can find another hack, I'm OK with that (or maybe just run this when running the tests), but about to run bundle install, I'm still confused.

I would love to embed a shared object or even a static object with the Ruby extensions. We have this PR, https://github.com/wasmerio/wasmer-ruby/pull/6, but it's based on Thermite, which seems abandonned. Thought?

Hywan commented 3 years ago

I would love to embed a shared object or even a static object with the Ruby extensions. We have this PR, #6, but it's based on Thermite, which seems abandonned. Thought?

I'm correcting myself. With the work I did in https://github.com/wasmerio/wasmer-ruby/blob/c1b554b5b3d14f17405940dc6c0951b898113ef1/lib/wasmer.rb#L3-L32, we can easily embed our own shared library, and use it. I've been already working on this. I just need to set up the CI to produce everything we need :-).

tsmartt commented 3 years ago

Hello @tsmartt!

Thank you for your PR, and I'm happy to learn you're using wasmer-ruby :-)! I'm OK with this PR, but I'm not a regular Ruby user hences comes my question: How the user is supposed to install the extension then? The part that changes the local path is a hack to be able to test the documentation, but I can find another hack, I'm OK with that (or maybe just run this when running the tests), but about to run bundle install, I'm still confused.

The user can still install the extension, in fact, we still do. The only change is that, when installing, all we do is call cargo to build the extension. We no longer run the tests when installing, which we should not do anyway. We also no longer bundle install when installing the gem, which we should also not do.

If you want to distribute prebuilt binaries, that would further simplify installation, but is a separate concern to this PR. All I cared about here was not running bundle install inside the gem installation, which causes issues further down the line.

tsmartt commented 3 years ago

but I can find another hack, I'm OK with that (or maybe just run this when running the tests), but about to run bundle install, I'm still confused.

Also to run the tests, you can still run rake test, they just will not be run installing the gem, which they should not anyway. We're still build the gem on install, like we do now.

If there's no objection @Hywan perhaps we can go ahead and merge? If there's any other way I can help out, I'm happy to.

tsmartt commented 3 years ago

@Hywan any update? Do you want me to do anything else for this?

Hywan commented 3 years ago

Sorry, I was in vacations, and then been under water. I'm all OK to merge this PR. Can you update the Install Section of the README.md please? After that, I think we are good to go!

tsmartt commented 3 years ago

Sorry, I was in vacations, and then been under water. I'm all OK to merge this PR. Can you update the Install Section of the README.md please? After that, I think we are good to go!

What would you like me to add? The install should still be the same, we're just fixing a bug here.