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

Fix using gemspec & force_ruby_platform on windows #6809

Merged
3 commits merged into from
Jul 26, 2019

Conversation

segiddins
Copy link
Member

@segiddins segiddins commented Nov 25, 2018

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

The problem was using gemspec and force_ruby_platform on Windows would lead to gems not being requirable.

Fixes #6801.

What was your diagnosis of the problem?

My diagnosis was there was a place where force_ruby_platform wasn't being taken into account, namely the query methods on Bundler.current_ruby

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

My fix was to add a check for the local platform in current_ruby, so the force_ruby_platform override would be taken into account.

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

I chose this fix because it avoids hard-coding knowledge of the setting in more places.

Copy link
Member

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this!

@segiddins segiddins force-pushed the segiddins/gemspec-force-ruby-platform branch from fae7715 to 7d84ff4 Compare December 8, 2018 19:33
@deivid-rodriguez deivid-rodriguez force-pushed the segiddins/gemspec-force-ruby-platform branch from 7d84ff4 to d0fcdb9 Compare March 17, 2019 21:23
@deivid-rodriguez deivid-rodriguez force-pushed the segiddins/gemspec-force-ruby-platform branch from d0fcdb9 to 9bf9864 Compare April 13, 2019 16:20
@deivid-rodriguez deivid-rodriguez force-pushed the segiddins/gemspec-force-ruby-platform branch 3 times, most recently from e90c562 to b0294c1 Compare June 25, 2019 14:52
@deivid-rodriguez deivid-rodriguez force-pushed the segiddins/gemspec-force-ruby-platform branch 2 times, most recently from f8b0c92 to 2dbc323 Compare July 4, 2019 11:30
@deivid-rodriguez
Copy link
Member

@segiddins I reverted 2 of the commits in this PR, and that fixed the new test that you added. I also squashed the added test, with the commit that's making it pass. 493ff58 is not needed for this PR, but I left it there because I think it's a good refactoring :)

@deivid-rodriguez
Copy link
Member

By the way, this PR as it is now seems to reduce the number of Windows spec failures from 356 to 349 😃

deivid-rodriguez and others added 3 commits July 9, 2019 12:31
…::Platform::RUBY

This allows us to always say we're ruby? when force_ruby_platform is
set, and fixes using gemspec & force_ruby_platform on windows.
@deivid-rodriguez deivid-rodriguez force-pushed the segiddins/gemspec-force-ruby-platform branch from 2dbc323 to 3cb89b7 Compare July 9, 2019 10:32
@deivid-rodriguez
Copy link
Member

I did try this PR, and it fixed the original problem. It also includes a regression spec, so I plan to merge it tomorrow unless there's feedback.

@deivid-rodriguez
Copy link
Member

@bundlerbot r+

ghost pushed a commit that referenced this pull request Jul 26, 2019
6809: Fix using gemspec & force_ruby_platform on windows r=deivid-rodriguez a=segiddins

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

The problem was using `gemspec` and `force_ruby_platform` on Windows would lead to gems not being requirable.

Fixes #6801.

### What was your diagnosis of the problem?

My diagnosis was there was a place where `force_ruby_platform` wasn't being taken into account, namely the query methods on `Bundler.current_ruby`

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

My fix was to add a check for the local platform in `current_ruby`, so the `force_ruby_platform` override would be taken into account.

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

I chose this fix because it avoids hard-coding knowledge of the setting in more places.

Co-authored-by: Samuel Giddins <[email protected]>
Co-authored-by: David Rodríguez <[email protected]>
@ghost
Copy link

ghost commented Jul 26, 2019

Build succeeded

@ghost ghost merged commit 3cb89b7 into master Jul 26, 2019
@ghost ghost deleted the segiddins/gemspec-force-ruby-platform branch July 26, 2019 07:13
This pull request was closed.
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.

force_ruby_platform misses gemspec dependencies on Windows
2 participants