Skip to content

Conversation

@deivid-rodriguez
Copy link
Contributor

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

None, just want to make the code simpler and error messages read a bit better.

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

Bundler does not really have a concept of "development dependencies", like RubyGems has. Bundler has the more generic concept of "groups".

Under the hood, the gemspec DSL will put gemspec development dependencies under a :development Gemfile group, but there's no reason to instantiate these as development dependencies, they are regular runtime dependencies, except that they belong in a group named :development.

By never instantiating development dependencies at all, we avoid having to introduce hacks to "undo" the type Bundler does not know about, and I also think the error messages read better.

Make sure the following tasks are checked

@deivid-rodriguez deivid-rodriguez force-pushed the deivid-rodriguez/improve-error-message-on-incompatible-gemspec-development-dependencies branch from 9fd0afa to 626aa7c Compare February 13, 2025 15:11
Bundler does not really have a concept of "development dependencies",
like RubyGems has. Bundler has the more generic concept of "groups".

Under the hood, the `gemspec` DSL will put gemspec development
dependencies under a `:development` Gemfile group, but there's no reason
to instantiate these as development dependencies, they are regular
runtime dependencies, except that they belong in a group named
:development.

By never instantiating development dependencies at all, we avoid having
to introduce hacks to "undo" the type Bundler does not know about, and I
also think the error messages read better.
@deivid-rodriguez deivid-rodriguez force-pushed the deivid-rodriguez/improve-error-message-on-incompatible-gemspec-development-dependencies branch from 626aa7c to 9a06fa5 Compare February 13, 2025 18:00
@deivid-rodriguez deivid-rodriguez merged commit eaa9ad2 into master Feb 14, 2025
91 checks passed
@deivid-rodriguez deivid-rodriguez deleted the deivid-rodriguez/improve-error-message-on-incompatible-gemspec-development-dependencies branch February 14, 2025 11:02
deivid-rodriguez added a commit that referenced this pull request Feb 17, 2025
…-message-on-incompatible-gemspec-development-dependencies

Make Bundler never instantiate development dependencies

(cherry picked from commit eaa9ad2)
ccutrer added a commit to ccutrer/rubygems that referenced this pull request Apr 9, 2025
Since ruby#8486, hax to make any dependency type work inside bundler
have been removed, so we mark plugins as type: :plugin. Instead,
follow that PR's lead and just make it a dedicated option to
Bundler::Dependency.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants