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

[2.0] Remove RubyGems Aggregate & support transitive source pinning#4714

Merged
homu merged 22 commits into2-0-devfrom
seg-no-aggregate
Jun 28, 2016
Merged

[2.0] Remove RubyGems Aggregate & support transitive source pinning#4714
homu merged 22 commits into2-0-devfrom
seg-no-aggregate

Conversation

@segiddins
Copy link
Copy Markdown
Contributor

@segiddins segiddins commented Jun 24, 2016

Closes #3671.
Closes #3696.
Closes #4059.

ret
end
end
end
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is there an extremely good reason to make this a prod instead of a method? Procs are sooo much slower than method calls. Also, procs are much harder to read and understand than methods... like how i can't even tell if this has to be a prof instead of a method. 😝

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can actually inline it entirely -- I don't like methods because the can be used elsewhere :P

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

inline is fine, but you should get used to private methods :P

@segiddins
Copy link
Copy Markdown
Contributor Author

@indirect addressed feedback

" gem 'rails'\n" \
" end"
raise DeprecatedError, msg
end
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're sure this still works with gem "foo", path: "bar", right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah, it does what git does and uses and empty block to fetch the source when used as an option: https://github.com/bundler/bundler/blob/4327cfe160f45f1bb0f02b9ea8b7e006ec255e02/lib/bundler/dsl.rb#L343

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

👍

@indirect
Copy link
Copy Markdown

@homu r+

@homu
Copy link
Copy Markdown
Contributor

homu commented Jun 24, 2016

📌 Commit 4327cfe has been approved by indirect

homu added a commit that referenced this pull request Jun 24, 2016
[2.0] Remove RubyGems Aggregate & support transitive source pinning

Closes #3671.
Closes #3696.
@homu
Copy link
Copy Markdown
Contributor

homu commented Jun 24, 2016

⌛ Testing commit 4327cfe with merge e03d107...

@homu
Copy link
Copy Markdown
Contributor

homu commented Jun 24, 2016

💔 Test failed - status

@indirect
Copy link
Copy Markdown

Locally I get a failure at ./spec/install/gems/resolving_spec.rb:6, when running on 68d2ba3. Maybe try rm -rf tmp; rspec ./spec/install/gems/resolving_spec.rb:6?

@segiddins
Copy link
Copy Markdown
Contributor Author

@indirect I can't repro the issue locally at all

@segiddins segiddins force-pushed the seg-no-aggregate branch 3 times, most recently from 5cccf5a to 5575151 Compare June 28, 2016 14:28
@segiddins
Copy link
Copy Markdown
Contributor Author

@homu r=indirect

@homu
Copy link
Copy Markdown
Contributor

homu commented Jun 28, 2016

📌 Commit baa7112 has been approved by indirect

@homu homu merged commit baa7112 into 2-0-dev Jun 28, 2016
@homu
Copy link
Copy Markdown
Contributor

homu commented Jun 28, 2016

⚡ Test exempted - status

homu added a commit that referenced this pull request Jun 28, 2016
[2.0] Remove RubyGems Aggregate & support transitive source pinning

Closes #3671.
Closes #3696.
Closes #4059.
@segiddins
Copy link
Copy Markdown
Contributor Author

🎉🎉🎉🎉

@segiddins segiddins deleted the seg-no-aggregate branch July 28, 2016 17:49
@coilysiren coilysiren modified the milestone: Release Archive Sep 22, 2016
bundlerbot added a commit that referenced this pull request Jun 27, 2017
[2.0] Remove RubyGems Aggregate & support transitive source pinning

### What was the end-user problem that led to this PR?

The problem was that the resolver could resolve specs from _any_ of the sources specified in the Gemfile, even if that source had nothing to do with the spec in question. This was such a large security vulnerability that, when discovered, it warranted a CVE and its own minor release of Bundler.

Closes #3671.
Closes #3696.
Closes #4059.

### Was was your diagnosis of the problem?

My diagnosis was that we needed to get rid of the notion of a `rubygems aggregate` and enforce that specs could only come either from the source they were declared to come from (the top-level source if declared at the top-level of the Gemfile, else a scoped source), or a source that it transitively "inherited" from the gems that required it.

### What is your fix for the problem, implemented in this PR?

My fix is to disable multiple top-level sources in the Gemfile, remove the RubyGems aggregate, and filter the sources gems could come from as described above.

### Why did you choose this fix out of the possible options?

I chose this fix because it allows doing the filtering in a reasonably performant manner, and refactors the way we handle sources to abstract some of the grossness in such a way that the machinations to make sure that all of the necessary gem info is downloaded is encapsulated into a single method, driven from the definition, rather than being specific to rubygems sources.

See #4714 and #4930 for the prior implementation.
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.

5 participants