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

Obtain gemspecs from the local system cache if available. #2497

Merged
merged 6 commits into from
Jul 3, 2013

Conversation

mipearson
Copy link
Contributor

Ref #2444

bundle install (when the Gemfile is modified) and bundle update commands take a long time when latency is high between the system running the command and Rubygems.

This PR works around part of this problem by obtaining gemspecs from the local gem specification directories if they're available.

I need assistance writing a spec for this PR, I can't quite work out which combination of builders I need to use to fake out an already existing specification file. Am I right in assuming a test for this should go in spec/install/gems/simple_case_spec.rb?

Benchmarks

of an bundle update on an already up-to-date Gemfile.lock:

With local specificiations patch

bundle _1.3.5.mp_ update 20.10s user 0.62s system 29% cpu 1:10.70 total

Original flavour

bundle update 20.15s user 0.72s system 10% cpu 3:20.49 total

@indirect
Copy link
Member

Hey, I'd love to work with you to get some specs written for this. If you'd like to schedule something, drop me an email!

@mipearson
Copy link
Contributor Author

Reminder: spoke to @indirect on IRC, he recommended setting up a system gem for a positive test, then modifying the gemspec of the system gem. Also need to move the spec cache dir path code into rubygems_integration.rb.

@mipearson
Copy link
Contributor Author

Added commits to address both items. Tried many approaches with the spec: as there's only a few conditions where bundler will attempt to retrieve gemspecs (rather than using the dependency API), this was difficult to test effectively.

@indirect
Copy link
Member

Hmm... the dependency API doesn't provide gemspecs, so they should need to be downloaded if they aren't found locally. Thanks for working on this!

On Tue, Jun 11, 2013 at 4:13 AM, mipearson notifications@github.com
wrote:

Added commits to address both items. Tried many approaches with the spec: as there's only a few conditions where bundler will attempt to retrieve gemspecs (rather than using the dependency API), this was difficult to test effectively.

Reply to this email directly or view it on GitHub:
#2497 (comment)

@mipearson
Copy link
Contributor Author

No, but it does provide dependency resolution. If it's unavailable, then
the gemspecs can be used to achieve the same goal.

On Wed, Jun 12, 2013 at 1:41 AM, André Arko notifications@github.comwrote:

Hmm... the dependency API doesn't provide gemspecs, so they should need to
be downloaded if they aren't found locally. Thanks for working on this!

On Tue, Jun 11, 2013 at 4:13 AM, mipearson notifications@github.com
wrote:

Added commits to address both items. Tried many approaches with the
spec: as there's only a few conditions where bundler will attempt to
retrieve gemspecs (rather than using the dependency API), this was

difficult to test effectively.

Reply to this email directly or view it on GitHub:
#2497 (comment)


Reply to this email directly or view it on GitHubhttps://github.com//pull/2497#issuecomment-19270223
.

Michael Pearson

@mipearson
Copy link
Contributor Author

Is there anything else you need me to do on this PR?

@indirect
Copy link
Member

err… no, the dependency API doesn't actually provide dependency resolution. Bundler always has to download the gemspecs in order to resolve the dependencies. :) The dependency API is just so that Bundler doesn't have to download the master index of every gem that has ever been created before the resolution starts.

On Jun 11, 2013, at 3:28 PM, mipearson notifications@github.com wrote:

No, but it does provide dependency resolution. If it's unavailable, then
the gemspecs can be used to achieve the same goal.

On Wed, Jun 12, 2013 at 1:41 AM, André Arko notifications@github.comwrote:

Hmm... the dependency API doesn't provide gemspecs, so they should need to
be downloaded if they aren't found locally. Thanks for working on this!

On Tue, Jun 11, 2013 at 4:13 AM, mipearson notifications@github.com
wrote:

Added commits to address both items. Tried many approaches with the
spec: as there's only a few conditions where bundler will attempt to
retrieve gemspecs (rather than using the dependency API), this was

difficult to test effectively.

Reply to this email directly or view it on GitHub:
#2497 (comment)


Reply to this email directly or view it on GitHubhttps://github.com//pull/2497#issuecomment-19270223
.

Michael Pearson

Reply to this email directly or view it on GitHub.

Retry by omitting gem creation entirely and only writing gemspec, not gem.
@mipearson
Copy link
Contributor Author

Ping. Anything else that you need me to do on this?

@indirect
Copy link
Member

Nope, I think this is everything I need. This week just hasn't had any time to review pull requests yet. Hoping to get to it today or tomorrow. Thanks again!

indirect added a commit that referenced this pull request Jul 3, 2013
Obtain gemspecs from the local system cache if available.

fixes #2444
@indirect indirect merged commit 4785e0d into rubygems:master Jul 3, 2013
@parndt
Copy link
Contributor

parndt commented Jul 4, 2013

Thanks to both of you ❤️

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