[2.0] Add a global cache for downloaded .gem files#5782
Conversation
|
This is looking great to me. Very excited about using |
0fabbd2 to
6f8c0d9
Compare
|
Green. Is there anything else I missed in #3983 that's relevant? (I think there were some commits related to other changes that made that diff needlessly large) |
|
@bundlerbot r+ |
|
📌 Commit 6f8c0d9 has been approved by |
[2.0] Add a global cache for downloaded .gem files ### What was the end-user problem that led to this PR? The problem was that bundler would need to download `foo-1.0.gem` files from a RubyGems server for each different ruby version installed on a user's machine. It also meant that people installing into a per-app path would need to re-download every gem for that bundle an additional time. This adds up, and makes `bundle install` slower than it needs to be. ### Was was your diagnosis of the problem? My diagnosis was that Bundler could keep a (per-source) cache of these `.gem` files, and pull from that cache instead of hitting the network whenever possible. ### What is your fix for the problem, implemented in this PR? My fix implements said cache, in a very similar way to the compact index cache (same cache slug per remote strategy, etc). This largely comes from #3983. ### Why did you choose this fix out of the possible options? I chose this fix because it is safe when used from multi-source gemfiles, it is easy to clear (`rm -rf bundle cache`), and it minimally interferes with the existing installation process.
|
(gonna export the env for this and run from master on my machine until this is released, now) |
|
@indirect |
|
Ugh has this timed out on CI? |
|
@bundlerbot retry |
[2.0] Add a global cache for downloaded .gem files ### What was the end-user problem that led to this PR? The problem was that bundler would need to download `foo-1.0.gem` files from a RubyGems server for each different ruby version installed on a user's machine. It also meant that people installing into a per-app path would need to re-download every gem for that bundle an additional time. This adds up, and makes `bundle install` slower than it needs to be. ### Was was your diagnosis of the problem? My diagnosis was that Bundler could keep a (per-source) cache of these `.gem` files, and pull from that cache instead of hitting the network whenever possible. ### What is your fix for the problem, implemented in this PR? My fix implements said cache, in a very similar way to the compact index cache (same cache slug per remote strategy, etc). This largely comes from #3983. ### Why did you choose this fix out of the possible options? I chose this fix because it is safe when used from multi-source gemfiles, it is easy to clear (`rm -rf bundle cache`), and it minimally interferes with the existing installation process.
|
💔 Test failed - status-travis |
|
@bundlerbot retry |
|
☔ The latest upstream changes (presumably #5788) made this pull request unmergeable. Please resolve the merge conflicts. |
|
🔒 Merge conflict |
6f8c0d9 to
1c8b0f6
Compare
|
Rebased. @bundlerbot r=indirect |
|
📌 Commit 1c8b0f6 has been approved by |
[2.0] Add a global cache for downloaded .gem files ### What was the end-user problem that led to this PR? The problem was that bundler would need to download `foo-1.0.gem` files from a RubyGems server for each different ruby version installed on a user's machine. It also meant that people installing into a per-app path would need to re-download every gem for that bundle an additional time. This adds up, and makes `bundle install` slower than it needs to be. ### Was was your diagnosis of the problem? My diagnosis was that Bundler could keep a (per-source) cache of these `.gem` files, and pull from that cache instead of hitting the network whenever possible. ### What is your fix for the problem, implemented in this PR? My fix implements said cache, in a very similar way to the compact index cache (same cache slug per remote strategy, etc). This largely comes from #3983. ### Why did you choose this fix out of the possible options? I chose this fix because it is safe when used from multi-source gemfiles, it is easy to clear (`rm -rf bundle cache`), and it minimally interferes with the existing installation process.
|
☀️ Test successful - status-travis |
What was the end-user problem that led to this PR?
The problem was that bundler would need to download
foo-1.0.gemfiles from a RubyGems server for each different ruby version installed on a user's machine. It also meant that people installing into a per-app path would need to re-download every gem for that bundle an additional time. This adds up, and makesbundle installslower than it needs to be.Was was your diagnosis of the problem?
My diagnosis was that Bundler could keep a (per-source) cache of these
.gemfiles, and pull from that cache instead of hitting the network whenever possible.What is your fix for the problem, implemented in this PR?
My fix implements said cache, in a very similar way to the compact index cache (same cache slug per remote strategy, etc). This largely comes from #3983.
Why did you choose this fix out of the possible options?
I chose this fix because it is safe when used from multi-source gemfiles, it is easy to clear (
rm -rf bundle cache), and it minimally interferes with the existing installation process.