-
Notifications
You must be signed in to change notification settings - Fork 32
Description
Context
Currently, any gem maintainer who wishes to limit the precompiled extensions to only a few recent rubies must set RUBY_CC_VERSION to a specific set of Ruby versions to inform rake-compiler.
Practically, this means that every gem's build process somewhere is hard-coding ruby versions. Some examples:
- nokogiri: https://github.com/sparklemotion/nokogiri/blob/main/.cross_rubies#L1
- sqlite3-ruby: https://github.com/sparklemotion/sqlite3-ruby/blob/flavorjones-dep-sqlite-3.48.0/rakelib/native.rake#L9
- re2: https://github.com/mudge/re2/blob/main/Rakefile#L36
Previously, this was not a big deal because we generally settled on the .0 release for the cross-rubies. However, starting with v1.6.0 we've started upgrading the cross-rubies' patch levels for various reasons. This makes upgrading rake-compiler-dock annoying because now everyone has to update these hard-coded values.
Proposal
I'm proposing that the rake-compiler-dock gem make these cross-ruby versions available to gem maintainers for use at build time.
Specifically I'm proposing (and would like feedback on) a method RakeCompilerDock.cross_rubies which returns a Hash<minor ⇒ patch>, e.g.:
{
"3.4" => "3.4.1",
"3.3" => "3.3.7",
...
"2.4" => "2.4.10"
}Then gems could assemble a correct/valid value for RUBY_CC_VERSIONS using only the minor versions that will be packaged.
I'd love to get a 👍 or 👎 and a comment from folks.
/cc @mudge @stanhu @larskanis