extism / ruby-sdk

Extism Ruby Host SDK - easily run WebAssembly modules / plugins from Ruby applications
https://extism.org
BSD 3-Clause "New" or "Revised" License
12 stars 1 forks source link

Fat Gem Releases #5

Closed bhelx closed 1 year ago

bhelx commented 1 year ago

Instead of asking people to install the Extism runtime shared object separately, we should include the runtime with the gem. There seem to be 2 ways to do this:

  1. Bundle the gem with the shared object for each architecture. Let the gem decide which shared object to load at runtime based on the architecture it's running on.
  2. Have the gem pull down the shared object as part of the gem install process. This can apparently be done with a rake task.

The recommended option seems to be the first option. How we publish it, I'm a little unsure. Apparently you can drop the object in the ext folder. Something like this:

extism/
├── ext/
│   └── extism/
│       └── libextism-x86_64-darwin.so
├── lib/
│   └── extism.rb
├── ...

One question I'd have is do we pack all the supported archs into that folder? I think this is within the limits of rubygems but how big would it be? We may want to have a process where it can fallback to looking on the system for the library and log a little warning message.

bhelx commented 1 year ago

Closing in favor of #6