Add Gem::Specification#required_engine_version#1468
Add Gem::Specification#required_engine_version#1468djberg96 wants to merge 2 commits intoruby:masterfrom
Conversation
lib/rubygems/specification.rb
Outdated
| spec.instance_variable_set :@platform, array[16].to_s | ||
| spec.instance_variable_set :@license, array[17] | ||
| spec.instance_variable_set :@metadata, array[18] | ||
| spec.instance_variable_set :@required_engine_version, array[8] |
There was a problem hiding this comment.
This has to go at the end or it its incompatible with previous versions.
There was a problem hiding this comment.
Ah, dang, I was trying to keep the related stuff together. Ok.
|
You'll also need to update SPECIFICATION_VERSION and MARSHAL_FIELDS, but it may be better to put |
Added a Gem.ruby_engine_version singleton method and use it within the installer. Reordered fields, updated CURRENT_SPECIFICATION_VERSION and MARSHAL_FIELDS, and updated specs.
|
@drbrain Updated. |
|
@copiousfreetime @segiddins @krainboltgreene Whaddya think? |
|
I'm personally not ready to ship this yet -- there's a lot of stuff that would need to be put in place for this to be used across the ecosystem (updating the bundler dependency API, updating the new index format specification, updating bundler itself to take this into account) and I'm honestly not convinced that this is worth doing -- it seems like a bandaid on the current multiplatform situation, and given we plan on actually tacking that area head-on in the near future, this could well end up just being baggage |
|
For what it's worth npm stopped enforcement of the engine metadata. |
|
@segiddins You say that we plan on tackling this in the near future, but I've seen no mention of it, nor have I seen any sort of proposal anywhere for how to better deal with this. Meanwhile, there's at least a few folks out there waiting for some sort of solution. |
|
@segiddins Alright, closing for now. |
This is a followup to issue #1263.
This PR adds the Gem::Specification#required_engine_version member to deal with the limitations of the required_ruby_version, which was originally put in place when there was only one implementation. With multiple Ruby implementations now in the wild, it's necessary to not only specify a Ruby version, but an engine version as well in some cases.
I've also added a Gem.ruby_engine_version singleton method. There's already a Gem.ruby_engine singleton, so it makes sense to add it, and I use it internally in the installer code.
There is one test failure:
Which is coming from this test:
Perhaps the null-type.gemspec.rz file needs to be regenerated? I'm not sure what the proper thing to do is.