Skip to content
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

Warn if RubyGems version explicitly set in gemspec does not match running version #7460

Merged
merged 1 commit into from May 3, 2024

Conversation

deivid-rodriguez
Copy link
Member

What was the end-user or developer problem that led to this PR?

This gets in the middle if we ever start allowing to build as if using a different RubyGems version than the one being run.

This could be useful to make gem rebuild a little more usable, and it's already done by Bundler specs which already make this method a noop when they need this.

I'm not sure forcefully setting this, even if user explicitly specified something else is helpful.

What is your fix for the problem, implemented in this PR?

Since this could potentially prevent gems explicitly setting a constant RubyGems version from building, I changed the error of incorrect RubyGems version from a hard error to a warning, since it will start happening in those cases if we stop overwriting the version.

Make sure the following tasks are checked

@deivid-rodriguez
Copy link
Member Author

@duckinator Does this make sense to you? The idea is to remove any hurdles to eventually allow mocking the RubyGems version while building gems. We could use this for gem rebuild by using the RubyGems version used to build the original gem for the gem being rebuilt to hopefully eliminate the diff caused by the version mismatch.

@duckinator
Copy link
Member

@deivid-rodriguez this seems reasonable, and I think it can be extended like you said to help gem rebuild. Sorry for the delay!

@deivid-rodriguez deivid-rodriguez marked this pull request as ready for review April 29, 2024 13:12
@deivid-rodriguez deivid-rodriguez changed the title Remove Gem::Specification#mark_version Warn if RubyGems version explicitly set in gemspec does not match running version Apr 29, 2024
This gets in the middle if we ever start allowing to build as if using a
different RubyGems version than the one being run.

This could be useful to make `gem rebuild` a little more usable, and
it's already done by Bundler specs which already make this method a noop
when they need this.

I'm not sure forcefully setting this, even if user explicitly specified
something else is helpful.

Since this could potentially prevent gems explicitly setting a constant
RubyGems version from building, I changed the error of incorrect
RubyGems version from a hard error to a warning, since it will start
happening in those cases if we stop overwriting the version.
@deivid-rodriguez
Copy link
Member Author

Let's try this!

@deivid-rodriguez deivid-rodriguez merged commit 35e5019 into master May 3, 2024
84 checks passed
@deivid-rodriguez deivid-rodriguez deleted the remove-mark-version branch May 3, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants