Cache gems into ~/.bundle/cache [WIP]#3975
Cache gems into ~/.bundle/cache [WIP]#3975stefanlance wants to merge 23 commits intorubygems:2-0-devfrom
Conversation
- Make Runtime#global_cache print a different message than Runtime#cache - Remove `#global_cache` method name conflict
lib/bundler/runtime.rb
Outdated
|
Only gems with no extensions can be safely cached globally, I think. |
|
@segiddins this cache is for the .gem files, not for the installed gems. so all gems can be cached here |
lib/bundler/settings.rb
Outdated
There was a problem hiding this comment.
~ doesn't work on Windows, so well need to use whatever Bundler currently uses to find the global settings file.
|
This implementation looks good to me, but as I read it I realized that I think we can't do global caching this way. Because Instead of loading gemspecs from the global cache, I think we will have to use it as a pure download cache instead—when the RubyGems source is asked to download a .gem file, it checks the global cache and provides the cached .gem if present, and downloads the gem into the global cache if it is not. Make sense? |
dependencies before install
lib/bundler/source/rubygems.rb
Outdated
There was a problem hiding this comment.
we need to remove this change--the global cache should be for downloads only. It will be too slow to use the global cache for gem metadata, because getting the metadata out of .gem files means decompressing them and evaluating lots of ruby code.
8d9a71c to
da8144c
Compare
da8144c to
facdaae
Compare
cc613f4 to
f3565d2
Compare
|
See #3983 |
We probably also want to test that this works when separate local bundles are installed on the same machine, i.e., that they don't overwrite the .gems in the cache, although I'm unsure how to do this just yet.