You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Distributing ruby apps is currently more difficult than it needs to be.
It usually involves a set of instructions telling the end-user how to get the right ruby version, to regenerate or use an existing Gemfile.lock, maybe deal with uninstallable gems (because of dependency issues), etc. The alternative is dealing with Docker, but that comes with its own difficulties.
It would reduce a lot of friction and make ruby more attractive if the tooling enabled compiling and distributing a single-file static binary, or something as close to it as possible.
There's been projects in the past that tried to solve this, like:
These solutions usually end up slightly outdated, and would benefit from a bundler integrated solution.
I think it's important to distinguish different levels of "packing".
Just the gem dependencies (ruby)
Basically storing everything in the bundle path in a zip, SquashFS or DwarFS read-only image, and ensuring load, require, etc do the right thing. Maybe using a ruby shebang argument, a bundler/inline-like statement, and/or something like a __END__ hack to actually inline the image.
All (file) resources
This would require implementing ruby's File API to be able to read the bundle image. Useful for things like assets and other ancillary files.
All (file) resources accessible through gem extensions
This would require linking some C libc/vfs overrides, which would probably make things like bootsnap work. I believe wasi-vfs takes a similar approach.
Everything including the ruby interpreter
Even better if we could statically compile the whole thing.
I believe an official bundler-supported solution for even just 1. or 2. would be a big help.
Maybe the solution is just to rely on ruby.wasm, ruvy and wasi-vfs, even if depending on wasm would limit the applicability. But even then it'd still be nice to ensure the tooling around bundler would make it very easy to use.
This discussion was converted from issue #7578 on April 15, 2024 10:46.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Distributing ruby apps is currently more difficult than it needs to be.
It usually involves a set of instructions telling the end-user how to get the right ruby version, to regenerate or use an existing Gemfile.lock, maybe deal with uninstallable gems (because of dependency issues), etc. The alternative is dealing with Docker, but that comes with its own difficulties.
It would reduce a lot of friction and make ruby more attractive if the tooling enabled compiling and distributing a single-file static binary, or something as close to it as possible.
There's been projects in the past that tried to solve this, like:
These solutions usually end up slightly outdated, and would benefit from a bundler integrated solution.
I think it's important to distinguish different levels of "packing".
Basically storing everything in the bundle path in a zip, SquashFS or DwarFS read-only image, and ensuring
load
,require
, etc do the right thing. Maybe using a ruby shebang argument, abundler/inline
-like statement, and/or something like a__END__
hack to actually inline the image.This would require implementing ruby's
File
API to be able to read the bundle image. Useful for things like assets and other ancillary files.This would require linking some C libc/vfs overrides, which would probably make things like bootsnap work. I believe wasi-vfs takes a similar approach.
Even better if we could statically compile the whole thing.
I believe an official bundler-supported solution for even just 1. or 2. would be a big help.
Maybe the solution is just to rely on ruby.wasm, ruvy and wasi-vfs, even if depending on wasm would limit the applicability. But even then it'd still be nice to ensure the tooling around bundler would make it very easy to use.
Beta Was this translation helpful? Give feedback.
All reactions