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

Ignore rubinius-only gems when running bundle install --local on MRI #2988

Merged
merged 2 commits into from
Apr 20, 2014

Conversation

mvz
Copy link
Contributor

@mvz mvz commented Apr 20, 2014

This is a fix for #2774. Probably, there are other cases like it which require a more thorough fix. For example, I'm guessing Bundler will try to find MRI 1.8-only gems when installing under MRI 2.0. I'll comment more on this later.

@mvz
Copy link
Contributor Author

mvz commented Apr 20, 2014

A more thorough fix could go like this:

  • Store platforms like :mri, :jruby, :mingw_18 in Gemfile.lock, instead of the current ruby, java. This way, these platforms use the same codes as the platform specifications in Gemfile.
  • Fill @dependencies in lib/bundler/definition.rb by asking current_ruby.mri_18? etc., instead of using Bundler.rubygems.platforms. This will create more specific platforms to match with the dependency's platforms, and allow a direct match instead of going through PLATFORM_MAP.

As this is a bit more involved, and likely to be incompatible with Bundler 1.x's behavior, I'd like a bit of feedback on this plan before I start coding.

@indirect
Copy link
Member

This makes rubinius a platform, and so it needs :rbx_18 and :rbx_19 etc if it's going to be able to distinguish those things. A fix for that being a bad way to declare platforms is an open ticket, #2691.

The "platforms" in the lockfile are actually rubygems platforms, which are a subset of Bundler platforms, so I think fixing platform locking in Bundler will take a few things coming together at once:

Once we've implemented #2691 (which will break backwards compatibility by itself), and started to respect each gem's required ruby version without platform blocks (which is part of the new index work that will be in the next minor release), then we can (I think) start to just check the platform we are on against the platform the gem says it works on. Ultimately, I would like platform blocks to be completely unnecessary, although there may need to be separate Gemfile sections for each Rubygems platform.

indirect added a commit that referenced this pull request Apr 20, 2014
Ignore rubinius-only gems when running bundle install --local on MRI
@indirect indirect merged commit 20892c8 into rubygems:master Apr 20, 2014
@indirect
Copy link
Member

Merging this pull request has created new warning output when running the tests:

WARNING:  Skipping misnamed gem: ./gems/only_rbx-1.0-unknown.gem should be named only_rbx-1.0-unknown (only_rbx-1.0-rbx)

Do you think you could clean that up?

@mvz
Copy link
Contributor Author

mvz commented Apr 21, 2014

@indirect I'll take a look at it.

@mvz mvz deleted the issue-2774-rbx-deps branch April 21, 2014 07:22
indirect added a commit that referenced this pull request May 5, 2014
As seen in later tests, Rubygems does not recognize a Rubinius platform.
That makes this infeasible. We either need to add Rubinius to Rubygems as
a platform, or come up with another way to exclude Rubinius-only gems.

This reverts commit 20892c8, reversing
changes made to abcb423.
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.

2 participants