Homebrew / homebrew-portable-ruby

🚗 Versions of Ruby that can be installed and run from anywhere on the filesystem.
BSD 2-Clause "Simplified" License
128 stars 43 forks source link

portable-ruby: slim bundled gems #219

Closed Bo98 closed 2 months ago

Bo98 commented 2 months ago

The functionality introduced here is mostly a nice-to-have for now but it may become very much central to our needs over time. Fiddle will be moved to be a bundled gem in Ruby 3.5.0 which is a gem we need on macOS so this will help with that as normally bundled gems cannot be used in Bundler environments and Fiddle also cannot be vendored in Homebrew/brew due to native extensions.

Relatedly, this system could allow us to include additional native gems should we need them. I could demonstrate that with Bootsnap if we want to test that out in the upcoming 3.3.3 release today. It should however never be used for anything critical on Linux as system Ruby is allowed there, so bundling things here should only be done for very few things (i.e. no more than what's mentioned in this PR). Fiddle is used on macOS only, debug is a niche feature that is already gated to be Portable Ruby only and Bootsnap auto-disables if not present.

Bo98 commented 2 months ago

I suspect if we ever want to enable it by default (which we should consider) we'll need to add better error handling around when it blows up (which I see periodically).

For sure. Before enabling we need to home in on what causes the breakage and potentially key the cache with that variable.

Long term ambition is to enable it by default, but that can only happen when we are comfortable it is stable for all.