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

Resolve for specific platforms #4836

Merged
merged 14 commits into from
Aug 25, 2016
Merged

Conversation

segiddins
Copy link
Member

Closes #4295.

This will require adding a bunch of tests, as well as figuring out how to put this new behavior behind a feature flag (thus fixing all of the existing tests).

@@ -52,7 +52,7 @@ class Dependency < Gem::Dependency
:x64_mingw_20 => Gem::Platform::X64_MINGW,
:x64_mingw_21 => Gem::Platform::X64_MINGW,
:x64_mingw_22 => Gem::Platform::X64_MINGW,
:x64_mingw_23 => Gem::Platform::X64_MINGW
:x64_mingw_23 => Gem::Platform::X64_MINGW,
Copy link
Member

Choose a reason for hiding this comment

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

really? we're doing trailing commas now? 😝

Copy link
Member Author

Choose a reason for hiding this comment

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

we have been since introducing rubocop

Copy link
Member

Choose a reason for hiding this comment

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

😭

Copy link
Member Author

Choose a reason for hiding this comment

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

this way we don't have to touch that line when adding a new element to the array

Copy link
Member

Choose a reason for hiding this comment

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

what good is it to be in charge of a project if we adopt code style that clashes with my personal coding aesthetic 😝

@indirect
Copy link
Member

indirect commented Aug 4, 2016

omg this is the most hopeful I have felt about platforms in literally five years, no exaggeration. hooray 🎉

@segiddins segiddins force-pushed the seg-resolve-for-specific-platforms branch 4 times, most recently from 87e310f to 25d0a8e Compare August 6, 2016 00:32
@indirect
Copy link
Member

indirect commented Aug 6, 2016

@homu r+

@homu
Copy link
Contributor

homu commented Aug 6, 2016

📌 Commit 25d0a8e has been approved by indirect

homu added a commit that referenced this pull request Aug 6, 2016
…ndirect

Resolve for specific platforms

Closes #4295.

This will require adding a bunch of tests, as well as figuring out how to put this new behavior behind a feature flag (thus fixing all of the existing tests).
@homu
Copy link
Contributor

homu commented Aug 6, 2016

⌛ Testing commit 25d0a8e with merge e6813c8...

@indirect
Copy link
Member

indirect commented Aug 6, 2016

@homu r-

@homu
Copy link
Contributor

homu commented Aug 6, 2016

💔 Test failed - status

@coilysiren coilysiren added this to the 1.X -- Better Platform Support milestone Aug 8, 2016
@indirect
Copy link
Member

indirect commented Aug 8, 2016

@homu r+

@homu
Copy link
Contributor

homu commented Aug 8, 2016

📌 Commit 46f69e5 has been approved by indirect

@indirect
Copy link
Member

indirect commented Aug 8, 2016

@homu r-

@indirect
Copy link
Member

indirect commented Aug 8, 2016

(Waiting to merge this until after we stable-branch 1.13)

@mwrock
Copy link
Contributor

mwrock commented Aug 19, 2016

This fixes #4896

current_platform = Bundler.rubygems.platforms.map {|p| generic(p) }.compact.last
add_platform(current_platform)
current_platform = Bundler.rubygems.platforms.last
add_platform(current_platform) if Bundler.settings[:specific_platform]
Copy link
Member Author

Choose a reason for hiding this comment

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

we'll probably need to special-case around when in deployment mode and not add any platforms and count on the platforms check in #4895

@indirect
Copy link
Member

@homu r+

@homu
Copy link
Contributor

homu commented Aug 20, 2016

📌 Commit 18450d5 has been approved by indirect

@segiddins
Copy link
Member Author

@indirect this should finally be mergable

@indirect
Copy link
Member

hooray 🏅 @homu r+

@homu
Copy link
Contributor

homu commented Aug 25, 2016

📌 Commit 42a36b0 has been approved by indirect

@homu
Copy link
Contributor

homu commented Aug 25, 2016

🔒 Merge conflict

@homu
Copy link
Contributor

homu commented Aug 25, 2016

☔ The latest upstream changes (presumably #4654) made this pull request unmergeable. Please resolve the merge conflicts.

@segiddins segiddins force-pushed the seg-resolve-for-specific-platforms branch from 42a36b0 to 0ac668d Compare August 25, 2016 16:20
@segiddins
Copy link
Member Author

Rebase'd
@homu r=indirect

@homu
Copy link
Contributor

homu commented Aug 25, 2016

📌 Commit 0ac668d has been approved by indirect

homu added a commit that referenced this pull request Aug 25, 2016
…ndirect

Resolve for specific platforms

Closes #4295.

This will require adding a bunch of tests, as well as figuring out how to put this new behavior behind a feature flag (thus fixing all of the existing tests).
@homu
Copy link
Contributor

homu commented Aug 25, 2016

⌛ Testing commit 0ac668d with merge c71f43f...

@homu
Copy link
Contributor

homu commented Aug 25, 2016

☀️ Test successful - status

@homu homu merged commit 0ac668d into master Aug 25, 2016
@segiddins segiddins deleted the seg-resolve-for-specific-platforms branch September 21, 2016 12:07
bundlerbot added a commit that referenced this pull request Jul 5, 2017
…rect

[2.0] Enable specific_platform by default on 2.0

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

The problem was that Bundler has somewhat suspect handling of multi-platform gems. We'd assume that different platform versions of gems were generally interchangeable, so if Bundler resolved to the "ruby" platform gem we'd just blindly try to swap in the gem for the local platform, which could lead to issues (say if the sets of dependencies were different).

### Was was your diagnosis of the problem?

My diagnosis was that we needed to stop only working with the notion of "generic" platforms, which mapped everything to (basically) either java, pure ruby, and windows, and instead keep track of the actual platforms a bundle was being used on, and resolve for those specific platforms.

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

My fix enables the changes made in #4836 by default on Bundler 2.

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

I chose this fix because it means Bundler will default to more correct platforms semantics out of the box.
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.

bundle package flag --all-platforms has no effect
5 participants