Fix installation error of same version of default gems with local installation#6430
Merged
Fix installation error of same version of default gems with local installation#6430
Conversation
…n of name and version for gemspec
56d6c85 to
abe5ac8
Compare
Current implementation tried to build installation artifact. But default gems didn't provide normal gem files. So, It's always build failure. https://github.com/ruby/bigdecimal/actions/runs/4269574995/jobs/7432842788 ERROR: Error installing pkg/bigdecimal-3.1.4.gem: ERROR: Failed to build gem native extension. No such file or directory @ dir_s_mkdir - /Users/runner/.rubies/ruby-head/lib/ruby/gems/3.3.0+0/gems/bigdecimal-3.1.4/ext/bigdecimal/.gem.20230225-2301-2mul99 Gem files will remain installed in /Users/runner/.rubies/ruby-head/lib/ruby/gems/3.3.0+0/gems/bigdecimal-3.1.4 for inspection. Results logged to /Users/runner/.rubies/ruby-head/lib/ruby/gems/3.3.0+0/extensions/x86_64-darwin-19/3.3.0+0/bigdecimal-3.1.4/gem_make.out
abe5ac8 to
2157aa8
Compare
Contributor
|
Is this related to #6429? |
Member
Author
|
Yes. But I think #6429 is correct behavior with current implementation. I fixed only broken behavior of C-ext gem and local installation. So, pure ruby gem, C-ext gem and remote installation are working fine. We can consider skipping all of gem installation with same default gems version after this. |
Member
Author
hsbt
added a commit
to ruby/json
that referenced
this pull request
Mar 8, 2023
hsbt
added a commit
to ruby/json
that referenced
this pull request
Mar 8, 2023
hsbt
added a commit
to ruby/json
that referenced
this pull request
Mar 8, 2023
deivid-rodriguez
pushed a commit
that referenced
this pull request
Mar 8, 2023
Fix installation error of same version of default gems with local installation (cherry picked from commit 03a074e)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was the end-user or developer problem that led to this PR?
When we try to install local gem like
pkg/bigdecimal-3.1.4.gemwith Ruby 3.3.0-dev(ruby/ruby master version). RubyGems always fail with the following error.https://github.com/ruby/bigdecimal/actions/runs/4269574995/jobs/7432842358
What is your fix for the problem, implemented in this PR?
This is too complex condition. The assumption is that
jsonis default gems(bigdecimal-3.1.4 didn't release yet, I showed same example with json),https://github.com/rubygems/rubygems/blob/master/lib/rubygems/request_set.rb#L183 is always true when it's given same name and same version.
When we try to install via rubygems.org like
gem i json -v 2.6.3, It's working fine. When we use remote installation, gemspec isAPISpecificationin https://github.com/rubygems/rubygems/blob/master/lib/rubygems/request_set.rb#L184 like:This gemspec don't have
Gem::Specificaiton#extensionslike:Because https://github.com/rubygems/rubygems/blob/master/lib/rubygems/specification.rb#L1607 is skip to this
Gem::Specification#build_extensionsand download, build, install after that.But when we invoke
gem i pkg/json-2.6.3.gem, we haveLocalSpecificationlike:This gemspec have full spec of
Gem::Specification:So,
Gem::Specification#build_extensionstry to build this spec despite there is no files of json-2.6.3.I added guard condition to
Gem::Specification#build_extensionsfor fullname of default gems.Make sure the following tasks are checked