ruby / ruby/rubygems

feature request: allow me to not specify a platform, allow bundler to always use the fallback behavior

Open
#9,472 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Bundler
Dominant language
Ruby
Stars
4k
Forks
1.9k
Avg merge
1d 2h
Merged PRs (30d)
81

Description

First of all, thank you for bundler! It's by far the best package manager I've ever used, whenever I'm in another ecosystem I miss bundler 🫶

Problem

In our large Gemfile for a many-years old successful product, we only have the ruby platform specified. We use a handful of gems which support multiple platforms, and we benefit from bundler's behavior of falling back to the local platform when doing an install (right?). So far so good.

We have now encountered our first gem that has no ruby variant. (email me for which one it is if interested). So, if we want to install it, we need to remove the ruby platform and add all our specific platforms. Theoretically this is fine, but can introduce problems in the future with developer confusion when adding new gems, or maybe someone is working on a new platform (unlikely but possible).

Another option is to ask the gem maintainer to distribute a "dummy" ruby variant to facilitate bundler users who want to just depend on the fallback at install time. I believe some gems we use already do this, but I may be wrong, maybe they have legit ruby variants.

The fact that the fallback behavior at install time works so well (or maybe there are risks/drawbacks I'm not aware of) really confuses me about the goals of the platform system. Every time I have asked around about this in slack groups and such, I get the same confusion about what the goals are, from other very experienced engineers.

Solution

Allow me to specify in Gemfile.lock that I want bundler to always use the fallback logic and install local platform specific gems, and i don't want to specify any platforms in my lockfile

bundle lock --add-platform auto

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the proposed bundle lock --add-platform auto entry point and how it writes platform data to Gemfile.lock. Review the existing fallback behavior described in the issue and define how an automatic platform mode should be represented; done means a lockfile can request that mode and installs consistently select local platform-specific gems without listing platforms individually.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.