diff options
author | The Bundler Bot <bot@bundler.io> | 2018-08-27 17:33:53 +0000 |
---|---|---|
committer | The Bundler Bot <bot@bundler.io> | 2018-08-27 17:33:53 +0000 |
commit | 4e215b74197581de3b11cf3e2948d604da7ca2d6 (patch) | |
tree | 21b0c4551ed126bbe97a9b56c0bbf7c12c235dc3 /.github | |
parent | 8e685af1c78e4e77827eb9b718f5eddb09a89aaa (diff) | |
parent | 8ddc9ac0fa34a0030c0c1b95bbdcd1e0b4ecfb4d (diff) | |
download | bundler-4e215b74197581de3b11cf3e2948d604da7ca2d6.tar.gz |
Auto merge of #6675 - MaxLap:master, r=greysteil
Handle RangeNotSatisfiable for compact index
### What was the end-user problem that led to this PR?
On ruby 2.1, bundler would try to install the latest version of psych, which is not compatible with it, instead of using an older version.
This is the error message i would get:
`Gem::RuntimeRequirementNotMetError: psych requires Ruby version >= 2.2.2. The current ruby version is 2.1.0.`
### What was your diagnosis of the problem?
Looking online, i managed to discover that there are 2 API in use, and if bundler can't use the compact index, it will not be able to detect ruby version requirements. (It might be a good idea to have a message that explain that more clearly somewhere, I found that in a random thread somewhere)
Using `bundle install --verbose`, I found out that a RangeNotSatisfiable was being returned by the `info/psych` call and it stopped the usage of the compact index. I figured out that this was because the local cache file was too long after reading te code.
I also knew that psych did a mistake in one of their release and had to yank versions in the past.
### What is your fix for the problem, implemented in this PR?
When receiving the `RangeNotSatisfiable`, instead of generating an exception which bubbles up and forces bundler to switch to the dependency API, I return the response, and test for it in th caller. When the response is that one, I trigger a retry, which reloads the whole while by not requesting a specific range.
### Why did you choose this fix out of the possible options?
It seems like the only logical fix to do in the current situation.
If the API didn't use the HTTP header stuff, it would have been more efficient to change rubygems to return the full file or just the new etag instead of a RangeNotSatisfiable. Doing so would have solved the issue for all previous versions of Bundler. But the use of caching servers and so on means that it's better to just respect HTTP and do a second query.
Diffstat (limited to '.github')
0 files changed, 0 insertions, 0 deletions