Commit graph

82 commits

Author SHA1 Message Date
David Rodríguez
2321091cfa [rubygems/rubygems] Don't create an empty tmp/2.1 directory when running spec:deps task
3189d3e49b
2025-07-25 11:10:38 +09:00
David Rodríguez
81da38b308 Sync RubyGems 2025-07-03 13:43:00 +09:00
David Rodríguez
83c403c4d8
[rubygems/rubygems] Rename some helpers to avoid name classes
I plan to introduce a `base_system_gems` helper to actually install gems
from `base_system_gem_path` into system gems but that would collapse
with an existing helper.

714c209e62
2025-07-02 10:34:18 +09:00
David Rodríguez
6f4eaa100f
Remove hardcoded version of rake from Bundler tests
Let them run against the version resolved by the `test_gems.rb` gemfile.

This should fix ruby-core CI job that was broken by the release of rake
13.3.0.
2025-06-03 08:12:09 +09:00
Nicholas La Roux
869a52f33a
[rubygems/rubygems] Partially phase out x64-mingw32 in favour of x64-mingw-ucrt (platforms)
- the x64-mingw32 platform has been superseded by x64-mingw-ucrt
- the mingw-ucrt platform is present as of Windows 10, which was released 10 years ago in 2015 and all versions prior to 10 are end-of-life and 10 will be by mid October 2025
- newer rubies use the mingw-ucrt platform instead of the mingw32 platform, meaning using the deprecated platform can cause issues during gem installation

b9d871022e
2025-06-03 07:47:14 +09:00
git
32c708efbd Update bundled gems list as of 2025-05-31 2025-05-31 09:43:52 +00:00
Koichi Sasada
e8b31c273c rake 13.3.0 -> 13.2.1
`make test-bundler-parallel` prints many errors, so try to
downgrade rake version.

```
  219) bundle install --standalone run in a subdirectory with --binstubs creates stubs that can be symlinked
       Failure/Error:
               raise <<~ERROR
                 #{error_header}

                 ----------------------------------------------------------------------
                 #{stdboth}
                 ----------------------------------------------------------------------
               ERROR

       RuntimeError:

         Commands:
         $ /home/ko1/ruby/build/trunk/ruby -I/home/ko1/ruby/src/trunk/spec/bundler -r/home/ko1/ruby/src/trunk/spec/bundler/support/artifice/compact_index.rb -r/home/ko1/ruby/src/trunk/spec/bundler/support/hax.rb /home/ko1/ruby/src/trunk/tmp/2.13/gems/system/bin/bundle config set --local path /home/ko1/ruby/src/trunk/tmp/2.13/bundled_app/bundle
         # $? => 0
         Invoking `/home/ko1/ruby/build/trunk/ruby -I/home/ko1/ruby/src/trunk/spec/bundler -r/home/ko1/ruby/src/trunk/spec/bundler/support/artifice/compact_index.rb -r/home/ko1/ruby/src/trunk/spec/bundler/support/hax.rb /home/ko1/ruby/src/trunk/tmp/2.13/gems/system/bin/bundle install --standalone --binstubs` failed with output:

         ----------------------------------------------------------------------
         [DEPRECATED] The --binstubs option will be removed in favor of `bundle binstubs --all`
         Could not find compatible versions

         Because every version of rails depends on rake = 13.3.0
           and rake = 13.3.0 could not be found in rubygems repository https://gem.repo1/ or installed locally,
           rails cannot be used.
         So, because Gemfile depends on rails >= 0,
           version solving has failed.
         Fetching gem metadata from https://gem.repo1/...
         Resolving dependencies...
         ----------------------------------------------------------------------
       Shared Example Group: "bundle install --standalone" called from ./spec/bundler/install/gems/standalone_spec.rb:532
       # /home/ko1/ruby/src/trunk/spec/bundler/support/command_execution.rb:26:in 'Spec::CommandExecution#raise_error!'
       # /home/ko1/ruby/src/trunk/spec/bundler/support/subprocess.rb:66:in 'Spec::Subprocess#sh'
       # /home/ko1/ruby/src/trunk/spec/bundler/support/helpers.rb:216:in 'Spec::Helpers#sys_exec'
       # /home/ko1/ruby/src/trunk/spec/bundler/support/helpers.rb:107:in 'Spec::Helpers#bundle'
       # /home/ko1/ruby/src/trunk/spec/bundler/install/gems/standalone_spec.rb:482:in 'block (3 levels) in <top (required)>'
       # /home/ko1/ruby/src/trunk/spec/bundler/spec_helper.rb:107:in 'block (4 levels) in <top (required)>'
       # /home/ko1/ruby/src/trunk/spec/bundler/spec_helper.rb:107:in 'block (3 levels) in <top (required)>'
       # /home/ko1/ruby/src/trunk/spec/bundler/support/helpers.rb:355:in 'block in Spec::Helpers#with_gem_path_as'
       # /home/ko1/ruby/src/trunk/spec/bundler/support/helpers.rb:369:in 'Spec::Helpers#without_env_side_effects'
       # /home/ko1/ruby/src/trunk/spec/bundler/support/helpers.rb:350:in 'Spec::Helpers#with_gem_path_as'
       # /home/ko1/ruby/src/trunk/spec/bundler/spec_helper.rb:106:in 'block (2 levels) in <top (required)>'
```
2025-05-31 17:15:44 +09:00
git
e577edb12e Update bundled gems list as of 2025-05-30 2025-05-30 19:14:14 +00:00
David Rodríguez
6e8be3a634 [rubygems/rubygems] Test JRuby 10
Necessary changes to get tests passing are:

* Rewrite one "out of memory" error spec to not define a subclass inside
  a RSpec context block. Due to some [JRuby issue], that's failing in
  JRuby 10, so I rewrote the test so that the Bundler process really
  goes OOM and that class definition is not necessary.
* JRuby 10, even if Ruby 3.4-compatible, has not yet adapted backtraces
  to include receivers, so our tests need an special case for JRuby when
  detecting a test method call inside backtraces.
* Warbler test is upgraded to use JRuby 10. Getting it to pass needs [a
  PR] to warbler, so our test is temporarily pointing to that PR.

[JRuby issue]: https://github.com/jruby/jruby/issues/8838
[a PR]: https://github.com/jruby/warbler/pull/557

edec85d4c3
2025-05-19 11:15:33 +09:00
David Rodríguez
756479324f Sync Bundler and adapt to new spec setup 2025-04-10 19:21:51 +09:00
David Rodríguez
f656d34f10 [rubygems/rubygems] Refactor specs to not try to remove folders that don't exist
This has the following benefits:

* Avoid duplicated work in some specs that first build a repo, and then
  overwrite it with a completely different set of gems.
* Reduce RSpec nesting and improve readability.
* The change also made surfaces several specs that were incorrect since
  they were unintentionally not testing the right thing.

ed430883e0
2025-03-12 18:02:09 +09:00
David Rodríguez
1a985d36a7 [rubygems/rubygems] Adapt specs to extraction of irb from ruby-core
This gets our daily Bundler CI back to green.

1bb70f75d2
2025-03-10 12:43:36 +09:00
Hiroshi SHIBATA
425cfcff85 [rubygems/rubygems] bin/rubocop -a --only Style/MultipleComparison
677e17aa2e
2025-02-21 11:31:47 +09:00
David Rodríguez
5d8fe7a595
[rubygems/rubygems] Make sure empty gems are not reinstalled every time
Unfortunately this requires reverting a previous enhancement of
reinstalling gems if they incorrectly ship with an empty installation
dir.

However, there's no way to distinguish this kind of bad state from a gem
that's empty for real, for example, sorbet-static-and-runtime.

This reverts commit 9720a9b980, and adds a
spec to make sure empty gems are not reinstalled every time.

7c102394af
2025-02-19 11:04:09 +09:00
David Rodríguez
da97662996
[rubygems/rubygems] Don't add gemspec to specification list of our test gems
Real gems hardly ever do this, so don't do it ourselves for testing
either.

2c8960cfb4
2025-02-19 11:04:09 +09:00
David Rodríguez
d8394461fd [rubygems/rubygems] Support installing arm native gems on Windows
96496e3f53

Co-authored-by: Johnny Shields <johnny.shields@gmail.com>
2025-01-28 15:31:53 +09:00
Hiroshi SHIBATA
f20b6e5dbc [rubygems/rubygems] Explicitly load build_metadata.rb because Spec::BuildMetadata is only called from BundlerBuilder.
The current code is broken to call Spec::Builders#build_* method directly.

4922ae40dd
2024-11-21 04:39:31 +00:00
David Rodríguez
abb6f5c8bc [rubygems/rubygems] Fix bin/rake spec:all task
Only in CI, if two different test runs are started (like `bin/rake
spec:all` does), the second one would not install the dev version of
Bundler and would fail to start.

This commit makes it work the same locally and in CI.

7a5ca6c40f
2024-11-14 11:21:39 +09:00
David Rodríguez
bf569c80ea [rubygems/rubygems] I don't see how this could happen
8b6f9b7f05
2024-11-14 11:21:39 +09:00
David Rodríguez
2f0b1874ad [rubygems/rubygems] Fix warnings about old C style
f40610b699
2024-10-10 14:51:31 +00:00
David Rodríguez
8dd87a66f5 [rubygems/rubygems] I don't think we need a conditional shebang
7ba7073a35
2024-09-20 15:57:41 +00:00
David Rodríguez
9bf3210adb [rubygems/rubygems] Fix RubyGems warnings about missing shebang
362c960497
2024-09-20 15:57:41 +00:00
David Rodríguez
c30297b3d1 [rubygems/rubygems] Fix RubyGems warnings about incorrect executable permissions
92dcf60fc1
2024-09-20 15:57:39 +00:00
David Rodríguez
42a6916a3c [rubygems/rubygems] Fix RubyGems warnings about minimum required Ruby
8f262f3a47
2024-09-20 15:57:39 +00:00
David Rodríguez
dc804bd83c [rubygems/rubygems] Extract a build_repo3 helper
d8cf4aa0cd
2024-08-05 17:27:11 +00:00
David Rodríguez
bfaccd6433 [rubygems/rubygems] Make all tests still pass when switching from truffleruby to cruby
4f3d9fa3bf
2024-07-26 08:05:53 +00:00
David Rodríguez
5b931d9de6 [rubygems/rubygems] Extract a rake_path helper
0f2db73619
2024-07-23 19:40:08 +00:00
David Rodríguez
99bf4021fb [rubygems/rubygems] Ext is generally not in require_paths
83b417a166
2024-07-18 18:07:07 +00:00
Nobuyoshi Nakada
c032e2c225 [rubygems/rubygems] Use caller_locations instead of splitting caller
Also limit caller ranges

a274b1af78
2024-07-18 04:20:07 +00:00
David Rodríguez
c639bacd45 [rubygems/rubygems] Fix detection of gem_repo1 being updated
9f9493c77c
2024-07-18 04:20:06 +00:00
David Rodríguez
1d97c46b35 [rubygems/rubygems] Minor Bundler spec improvements
While working on something else I noticed:

* Usage of uppercased "RUBY" and "JAVA" as platforms, when those don't
  really exist.
* Usage of some test gems with "1.0" as gemspec version and "1.0.0" as
  actual version.

This commit fixes both inconsistencies to make things more expectable.

e3ec32e247
2024-07-09 14:43:18 +00:00
David Rodríguez
98c923ff4b
Synchronize Bundler & RubyGems (#11071) 2024-06-28 10:12:29 -04:00
David Rodriguez
5f8375381b [rubygems/rubygems] Avoid concurrent builds of Bundler when running specs
Instead, build it during setup when in CI.

This should avoid some Windows specific test failures when Bundler
copies the same files from multiple processes and runs into EACESS
errors.

c194a1d753
2024-06-28 07:33:43 +00:00
David Rodriguez
281df1e495 [rubygems/rubygems] Remove Gem::Specification#mark_version
This gets in the middle if we ever start allowing to build as if using a
different RubyGems version than the one being run.

This could be useful to make `gem rebuild` a little more usable, and
it's already done by Bundler specs which already make this method a noop
when they need this.

I'm not sure forcefully setting this, even if user explicitly specified
something else is helpful.

Since this could potentially prevent gems explicitly setting a constant
RubyGems version from building, I changed the error of incorrect
RubyGems version from a hard error to a warning, since it will start
happening in those cases if we stop overwriting the version.

45676af80d
2024-05-03 15:12:55 +00:00
Hiroshi SHIBATA
16c5e34c74 Use rake-13.2.1 2024-04-05 17:36:16 +09:00
Hiroshi SHIBATA
a65d49ce77 Use Rake 13.2.0 2024-04-02 11:22:14 +09:00
Hiroshi SHIBATA
a52fc5df7a [rubygems/rubygems] Use FileUtils.mkdir_p
af806b8dff
2024-02-19 05:45:51 +00:00
Hiroshi SHIBATA
fbc29ce032
Avoid to fail with race condition 2024-02-16 18:16:15 +09:00
David Rodriguez
a4e4e3b1f1 [rubygems/rubygems] Add missing Windows job
Specs that use extension gems were failing in the new job but I noticed
that they were using very non standard `extconf.rb` files.

The hack being removed here was added just to make specs pass when run
in ruby-core but it seems the underlying issue has been fixed now, and
it's causing issues with Ruby 3.3 and Windows, so necessary so I'm
removing it and moving on.

5b78275f0e
2024-02-02 11:43:10 +00:00
Hiroshi SHIBATA
82496f2b38 Merge RubyGems-3.5.2 and Bundler-2.5.2 2023-12-22 07:24:04 +09:00
David Rodríguez
67940b135c [rubygems/rubygems] Bump rake version used by tests
And make it easier to update next time.

1ea4bfa5d8
2023-12-12 17:16:19 +00:00
Samuel Giddins
4817166e54 [rubygems/rubygems] Extract generate_index command to rubygems-generate_index gem
So generate_index can be implemented with dependencies, such as the compact index

Took this approach from feedback in https://github.com/rubygems/rubygems/pull/6853

Running `gem generate_index` by default will use an installed rubygems-generate_index, or install and then use the command from the gem

Apply suggestions from code review

fc1cb9bc9e

Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
2023-12-08 06:09:51 +00:00
David Rodríguez
2755cb1b2f [rubygems/rubygems] Use modern hashes consistently
bb66253f2c
2023-12-07 22:29:33 +00:00
Hiroshi SHIBATA
64530b545f [rubygems/rubygems] Added warnings targets for old version of Ruby
d0c1d97105
2023-07-25 06:23:26 +00:00
Hiroshi SHIBATA
cc2617ae3f [rubygems/rubygems] Added csv as stub gem to build_repo1
d2f2597c31
2023-07-25 06:23:24 +00:00
Hiroshi SHIBATA
1edbaa850f Merge rubygems/rubygems HEAD
Pick from 880dd95996
2023-06-20 13:35:13 +09:00
David Rodríguez
4df7c3946a [rubygems/rubygems] Remove one fallback to full indexes on big gemfiles
If Gemfile has a lot of dependencies, we have an optimization that uses
the full index in that case, assuming it's going to be faster.

I think this is an old optimization that predates compact index API
times, I believe we no longer need it these days.

Also, since a few releases ago we check for circular dependencies when
resolving by looping through all versions of each name and removing
those that have circular dependencies that would trip up the resolver.

This loop becomes actually very slow when full indexes are used because
to find dependencies of a gemspec, we need to explicitly fetch the
marshaled gemspec (`gemspec.rz` endpoint) for it, so the optimization
has the opposite effect of making things very slow.

2f46289bd3
2023-04-07 13:53:00 +00:00
Nobuyoshi Nakada
348412c7fa [rubygems/rubygems] Use indented heredoc
085d2776d8
2023-03-22 21:21:08 +00:00
Hiroshi SHIBATA
a43f1d90c2 Merge RubyGems and Bundler master
from 0635c1423d
2023-01-10 15:53:07 +09:00
Hiroshi SHIBATA
bbe56a6437 Merge RubyGems/Bundler master
from bfb0ae6977
2022-12-12 10:49:43 +09:00