-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Provide easy access to the cross-rubies from the build process #149
Comments
Or, I guess, an alternative or additional method might construct the RakeCompilerDock.ruby_cc_version("3.4", "3.3", "3.2", "3.1")
# => "3.4.1:3.3.5:3.2.6:3.1.6" and potentially even accept RakeCompilerDock.ruby_cc_version(Gem::Requirement.new("~> 3.0"))
# => "3.4.1:3.3.5:3.2.6:3.1.6:3.0.7" Overkill? |
Introducing some sort of higher-level API that either sets Given that Ruby version support will always end up being a Requirement in the resulting gems maybe using that API isn't a bad idea but could be an implementation detail, e.g. RakeCompilerDock.set_ruby_cc_version("~> 3.0")
# internally uses `Gem::Requirement.create` to handle input and filters the supported list of Ruby versions for rake-compiler |
See #150 for a concrete proposal. |
This is great, thanks. |
@flavorjones I should note that for Rust extensions, we also need to match the patch releases here:
The first pull request uses With the addition of |
Actually, we can simplify the |
`RakeCompilerDock.cross_rubies` supplies the exact patch release needed. This is available in rack-compiler-dock v1.9.1: * rake-compiler/rake-compiler-dock#149 * https://github.com/rake-compiler/rake-compiler-dock/releases/tag/v1.9.1 This simplifies the `Dockerfile`, but it does mean we have to keep the rake-compiler-dock version in the `Gemfile` in sync with all the images in `docker/Dockerfile.*`.
`RakeCompilerDock.cross_rubies` supplies the exact patch release needed. This is available in rack-compiler-dock v1.9.1: * rake-compiler/rake-compiler-dock#149 * https://github.com/rake-compiler/rake-compiler-dock/releases/tag/v1.9.1 This simplifies the `Dockerfile`, but it does mean we have to keep the rake-compiler-dock version in the `Gemfile` in sync with all the images in `docker/Dockerfile.*`.
`RakeCompilerDock.cross_rubies` supplies the exact patch release needed. This is available in rack-compiler-dock v1.9.1: * rake-compiler/rake-compiler-dock#149 * https://github.com/rake-compiler/rake-compiler-dock/releases/tag/v1.9.1 This simplifies the `Dockerfile`, but it does mean we have to keep the rake-compiler-dock version in the `Gemfile` in sync with all the images in `docker/Dockerfile.*`.
`RakeCompilerDock.cross_rubies` supplies the exact patch release needed. This is available in rack-compiler-dock v1.9.1: * rake-compiler/rake-compiler-dock#149 * https://github.com/rake-compiler/rake-compiler-dock/releases/tag/v1.9.1 This simplifies the `Dockerfile`, but it does mean we have to keep the rake-compiler-dock version in the `Gemfile` in sync with all the images in `docker/Dockerfile.*`.
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:
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 aHash<minor ⇒ patch>
, e.g.: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
The text was updated successfully, but these errors were encountered: