Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Cache gems into ~/.bundle/cache [WIP]#3975

Closed
stefanlance wants to merge 23 commits intorubygems:2-0-devfrom
stefanlance:sml-bundle-gems-cache-2-0-dev
Closed

Cache gems into ~/.bundle/cache [WIP]#3975
stefanlance wants to merge 23 commits intorubygems:2-0-devfrom
stefanlance:sml-bundle-gems-cache-2-0-dev

Conversation

@stefanlance
Copy link
Copy Markdown
Contributor

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.

@stefanlance stefanlance changed the title Cache gems into ~/.bundle/gems Cache gems into ~/.bundle/cache [WIP] Sep 2, 2015
Stefan Lance added 2 commits September 2, 2015 14:27
- Make Runtime#global_cache print a different message than Runtime#cache
- Remove `#global_cache` method name conflict
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cache_globally?

@segiddins
Copy link
Copy Markdown
Contributor

Only gems with no extensions can be safely cached globally, I think.

@indirect
Copy link
Copy Markdown

indirect commented Sep 2, 2015

@segiddins this cache is for the .gem files, not for the installed gems. so all gems can be cached here

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~ doesn't work on Windows, so well need to use whatever Bundler currently uses to find the global settings file.

@indirect
Copy link
Copy Markdown

indirect commented Sep 2, 2015

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 load_global_cache reads every cached .gem file, ungzipping and untarring it to extract the .gemspec file and then evaluating the gemspec, it's going to get slower and slower as the global cache grows.

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?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@stefanlance stefanlance force-pushed the sml-bundle-gems-cache-2-0-dev branch 2 times, most recently from 8d9a71c to da8144c Compare September 9, 2015 15:14
@stefanlance stefanlance force-pushed the sml-bundle-gems-cache-2-0-dev branch from da8144c to facdaae Compare September 9, 2015 15:15
@stefanlance stefanlance force-pushed the sml-bundle-gems-cache-2-0-dev branch from cc613f4 to f3565d2 Compare September 9, 2015 16:58
@stefanlance
Copy link
Copy Markdown
Contributor Author

See #3983

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants