Commit graph

36 commits

Author SHA1 Message Date
Samuel Giddins
c0a1e877b3
Move most of Bundler::GemHelpers to Gem::Platform
This will help centralize wheel platform selection logic eventually

Signed-off-by: Samuel Giddins <segiddins@segiddins.me>
2025-06-06 10:22:18 +09:00
David Rodríguez
c8f4df4ae9 [rubygems/rubygems] Make Bundler never instantiate development dependencies
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.

9a06fa5bda
2025-02-17 11:04:39 +09:00
David Rodríguez
4c0cf2deed [rubygems/rubygems] Make Bundler::Dependency more memory efficient
When resolving from scratch a Gemfile including only `"gem "rails", "~>
8.0.1"`, I get the following results:

### Before

Total allocated: 288.21 MB (3498515 objects)
Total retained:  119.10 MB (1357976 objects)

### After

Total allocated: 277.44 MB (3383182 objects)
Total retained:  117.55 MB (1338622 objects)

2d3d6e5015
2025-02-06 15:57:55 +09:00
Edouard CHIN
2ed30c9944 [rubygems/rubygems] Consolidate the platform into a single list:
- Similar change than 29a1be0008,
  keep a single source of truth where we store the platform.

  The only change worth highlighing is the platform "maglev".
  It was not part of the supported platform of dependencies,
  so calling `gem 'foo', plaftorm: 'maglev'` would not work.
  However, it was supposed to according to 45ec86e2e5.
  That's why it was possible to do `Bundler.current_ruby.maglev?` or
  `Bundler.current_ruby.maglev_30?`.

  I didn't change the current behaviour and maglev is not supported,
  though I kept the `*maglev` methods as I believe CurrentRuby is
  public API.

29e219ebcf
2025-01-31 14:34:26 +09:00
Edouard CHIN
dc7c665105 [rubygems/rubygems] Consolidated the Ruby version list:
- We keep 2 list of supported ruby versions and each time a new ruby
  version is released we need to maintain both list. Forgetting
  to update one would prevent users from adding gem for a specific
  plaftorm (i.e. 7cd19d824d and 5462322f8f).

  Extracted the list from the Dependency class and moved it to the
  CurrentRuby class (which I believe was originally added for that
  reason).

a91edd6c1f
2025-01-31 14:34:25 +09:00
David Rodríguez
f6e7f5337b [rubygems/rubygems] Remove unnecessary @autorequire initialization
It's initialized again later on.

c3ddc81659
2025-01-28 15:31:53 +09:00
Hiroshi SHIBATA
69bb296fa6 Support Ruby 3.5 for bundler platforms 2024-12-25 20:10:18 +09:00
David Rodríguez
963f98a94f [rubygems/rubygems] Enable Performance/MapCompact cop
0c3a65871a
2024-11-26 15:11:05 +09:00
David Marshall
c4b5f3f142 [rubygems/rubygems] bundler CLI option for add gem --glob=
Bundler online documentation says that if the gem is located within a subdirectory of a git repository,
you can use the `:glob` option to specify the location of its .gemspec

`gem 'cf-copilot', git: 'https://github.com/cloudfoundry/copilot', glob: 'sdk/ruby/*.gemspec'`

This change allows for equivalent functionality from the bundler CLI

`bundle add cf-copilot --git=https://github.com/cloudfoundry/copilot --glob=sdk/ruby/*.gemspec`

91052e5868
2024-04-12 13:31:43 +00:00
Hiroshi SHIBATA
7d7a84e99f Merge RubyGems-3.5.3 and Bundler-2.5.3 2023-12-23 09:34:26 +09:00
Samuel Giddins
6aa26af683 [rubygems/rubygems] Add 3.4 as a supported ruby version
Since ruby trunk will be 3.4 very soon

36dd9a35dc
2023-12-13 19:02:24 +00:00
David Rodríguez
2755cb1b2f [rubygems/rubygems] Use modern hashes consistently
bb66253f2c
2023-12-07 22:29:33 +00:00
Samuel Giddins
0ed55bf097 [rubygems/rubygems] Reduce array allocations when loading definition
The same array was being re-created in a loop (as well as the `generic_local_platform`), which is avoidable by hoisting it to a frozen array created once

009a3c6d0d
2023-12-01 19:50:03 +00:00
johnnyshields
79ede4ae99 [rubygems/rubygems] Alias CurrentRuby#mswin?, mswin64?, mingw?, x64_mingw? to #windows?. (This is done instead of logging a deprecation warning.)
b9fcc7c0ab
2023-03-03 09:50:29 +00:00
Daniel Colson
fd71a76f55 [rubygems/rubygems] Add Ruby 3.2 and 3.3 platforms to Gemfile DSL
Along the same lines as https://github.com/rubygems/rubygems/pull/5469,
this adds support for Ruby 3.2 and 3.3 platforms: `:ruby_32`, `mri_32`,
etc.

It also includes a spec that should help catch this earlier in the
future, failing if we don't support platforms for the version of Ruby
that is running the tests.

7cd19d824d
2023-02-07 21:12:18 +00:00
Hiroshi SHIBATA
f6620037ba Merge RubyGems-3.4.0 and Bundler-2.4.0 2022-12-24 16:57:07 +09:00
Hiroshi SHIBATA
0a9d51ee9d Migrate our resolver engine to PubGrub
https://github.com/rubygems/rubygems/pull/5960

  Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
2022-11-12 07:40:31 +09:00
David Rodríguez
24fd2f73d0 Resync Bundler & RubyGems 2022-09-08 11:25:03 +09:00
Mike Dalessio
45fe7f7575
[rubygems/rubygems] Feature: bundle add supports --path option
32bee01fbe
2022-09-05 11:43:14 +09:00
shields
8799c91205 [rubygems/rubygems] Add platform :windows as a shortcut for all Windows platforms
f3c49ad3f7
2022-08-29 00:33:15 +09:00
Aleksandr Varnin
381d8e43ce [rubygems/rubygems] Bundler: make to_lock consistent between Gem::Dependency and Bundler::Dependency
971d57cf5a
2022-08-28 02:04:14 +09:00
Hiroshi SHIBATA
9e6d07f346 Merge rubygems/bundler HEAD
Merge from 2af2520b4a
2022-07-26 14:38:17 +09:00
Hiroshi SHIBATA
437a5ae9d6 Merge RubyGems and Bundler master 2022-07-13 14:11:55 +09:00
David Rodríguez
12a5fa408b Sync RubyGems & Bundler with upstream repo 2022-06-24 10:52:02 +09:00
Bobby McDonald
ccb0572ff9 [rubygems/rubygems] Add modern rubies to the platforms
5462322f8f
2022-04-16 08:23:21 +09:00
Vyacheslav Alexeev
1a62a50c4f [rubygems/rubygems] Add github and ref options to bundle add
c3e54acab0
2021-12-11 00:13:25 +09:00
David Rodríguez
5b0abba931 Sync bundler & rubygems 2021-05-11 11:29:41 +09:00
Hiroshi SHIBATA
2fa9f3c032 Prepare to release rubygems-3.2.1 and bundler-2.2.1 2020-12-15 10:54:09 +09:00
Hiroshi SHIBATA
0e60b59d58 Update the bundler version with master branch 2020-05-13 07:54:37 +09:00
David Rodríguez
ff908983be
[bundler/bundler] Extract expanded_platforms
60d720eb06
2019-08-03 09:29:57 +09:00
Hiroshi SHIBATA
4c2255fd5c
[bundler/bundler] Added Ruby 2.6 to dsl.
1892626858
2019-08-03 09:29:55 +09:00
Hiroshi SHIBATA
8f37629519 Merge bundler master from upstream.
Pick from 8dd59e3ba97eb80a599f8149f31bf40773b69dc0
2019-06-09 12:44:10 +09:00
hsbt
59c8d50653 Added bundler as default gems. Revisit [Feature #12733]
* bin/*, lib/bundler/*, lib/bundler.rb, spec/bundler, man/*:
    Merge from latest stable branch of bundler/bundler repository and
    added workaround patches. I will backport them into upstream.
  * common.mk, defs/gmake.mk: Added `test-bundler` task for test suite
    of bundler.
  * tool/sync_default_gems.rb: Added sync task for bundler.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-02 23:07:56 +00:00
hsbt
7825e8363d Postponing the Bundler merge.
I faced a big issue about Bundler with ruby core.
  I have no time to resolve it issue before 2.5 final release.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22 23:08:05 +00:00
hsbt
be7b592912 Update bundled bundler to 1.16.0.
* lib/bundler, spec/bundler: Merge bundler-1.16.0.
  * common.mk: rspec examples of bundler-1.16.0 needs require option.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01 23:29:38 +00:00
hsbt
8598f8c2dc Merge bundler to standard libraries.
rubygems 2.7.x depends bundler-1.15.x. This is preparation for
  rubygems and bundler migration.

  * lib/bundler.rb, lib/bundler/*: files of bundler-1.15.4
  * spec/bundler/*: rspec examples of bundler-1.15.4. I applied patches.
    * https://github.com/bundler/bundler/pull/6007
    * Exclude not working examples on ruby repository.
    * Fake ruby interpriter instead of installed ruby.
  * Makefile.in: Added test task named `test-bundler`. This task is only
    working macOS/linux yet. I'm going to support Windows environment later.
  * tool/sync_default_gems.rb: Added sync task for bundler.

  [Feature #12733][ruby-core:77172]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-08 08:45:41 +00:00