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

Fix regression related to locked ruby #3900

Merged
merged 2 commits into from
Aug 28, 2020
Merged

Conversation

deivid-rodriguez
Copy link
Member

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

A few months ago we introduced a change in how we handle the locked ruby version that has caused a (fortunately still unreleased) regression.

The regression will be hit be applications:

  • Using the ruby DSL.
  • Having a locked ruby version different from the running ruby version.
  • Running bundle update.

In that case, whereas previously things would just work, we now get an error like the following:

Could not find gem 'Ruby (>= 2.2.2, = 2.7.1.83, = 2.6.5.114)' in the local ruby installation. The source contains 'Ruby' at: 2.7.1.83

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

This PR reverts the offending PR, and adds a regression spec.

The offending PR (that tried to reactivate this unsued code, but caused this regression), also linked to an alternative PR removing the unused code instead. As a bonus, this PR backports that alternative solution to the new repository.


Tasks:

  • Describe the problem / feature
  • Write tests
  • Write code to solve the problem
  • Get code review from coworkers / friends

I will abide by the code of conduct.

deivid-rodriguez and others added 2 commits August 24, 2020 17:56
This reverts commit 68929fc.

This change caused a regression if applications are using the `ruby`
Gemfile DSL, have a locked ruby version different from the running ruby,
and run `bundle update`.

In that case, the new result is something like:

```
Could not find gem 'Ruby (>= 2.2.2, = 2.7.1.83, = 2.6.5.114)' in the local ruby installation.
The source contains 'Ruby' at: 2.7.1.83
```

whereas before things would just work.

The reason is that the reverted commit started adding both the locked
ruby and the running running as exact ruby requirements when unlocking.
And they will obviously conflict if they are different.

This PR reverts the commit and adds a regression spec to catch the
error.
The unused code is a leftover from commit 38b0e7e .
That commit disabled that RubyVersion.system is respected, but it seems that that feature wasn't missed.
@deivid-rodriguez
Copy link
Member Author

Thanks @indirect!

@deivid-rodriguez deivid-rodriguez merged commit 03738b8 into master Aug 28, 2020
@deivid-rodriguez deivid-rodriguez deleted the ruby_version_regression branch August 28, 2020 18:51
deivid-rodriguez added a commit that referenced this pull request Oct 5, 2020
Fix regression related to locked ruby

(cherry picked from commit 03738b8)
deivid-rodriguez added a commit that referenced this pull request Oct 5, 2020
Fix regression related to locked ruby

(cherry picked from commit 03738b8)
deivid-rodriguez added a commit that referenced this pull request Oct 5, 2020
Fix regression related to locked ruby

(cherry picked from commit 03738b8)
deivid-rodriguez added a commit that referenced this pull request Oct 6, 2020
Fix regression related to locked ruby

(cherry picked from commit 03738b8)
deivid-rodriguez added a commit that referenced this pull request Oct 6, 2020
Fix regression related to locked ruby

(cherry picked from commit 03738b8)
deivid-rodriguez added a commit that referenced this pull request Oct 6, 2020
Fix regression related to locked ruby

(cherry picked from commit 03738b8)
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

4 participants