Commit graph

132 commits

Author SHA1 Message Date
David Rodríguez
6a5808965b [rubygems/rubygems] Stop allowing calling #gem on random objects
4b8570ae15
2025-07-07 11:53:12 +09:00
David Rodríguez
9e566141cd [rubygems/rubygems] Remove "double CI" for testing Bundler 4 mode
Since now every functionality that changes in Bundler 4 is under a
setting, we can enable that setting to test the new functionality,
without having to run our full CI twice.

This can actually be seen as increasing coverage, because Bundler 4
functionality will now be tested on Windows, MacOS, or any other
environment where previously "Bundler 4 mode" was not running.

1cb3e009fc
2025-06-30 12:56:50 +09:00
David Rodríguez
c115e3d974
[rubygems/rubygems] bundle exec does not need artifice in general
cb1f19573a
2025-06-24 12:10:50 +09:00
David Rodríguez
441f18df52
Skip to Bundler 4 directly 2025-06-19 10:23:36 +09:00
David Rodríguez
f3ea6c35cc
[rubygems/rubygems] Normalize Bundler version spec filters
28b6a7cf5e
2025-06-19 10:23:36 +09:00
David Rodríguez
4e2db1ff58
[rubygems/rubygems] Etc exemption on Windows is no longer necessary
228f59e3ab
2025-06-17 15:09:35 +09:00
David Rodríguez
d95f7a3c43
[rubygems/rubygems] Extract stdboth spec helper
bb13f4e702
2025-06-06 10:09:14 +09:00
David Rodríguez
afda30774c [rubygems/rubygems] Reword log message about current platform being missing
It reads better this way I think.

ce9743290d
2025-03-24 13:25:07 +09:00
David Rodríguez
4e1df25b15 [rubygems/rubygems] Improve grammar of some error messages
558a4765c7
2025-03-24 13:25:07 +09:00
David Rodríguez
51958bae66 [rubygems/rubygems] Prefer FileUtils.rm_r to FileUtils.rm_rf for specs
Because it does not swallow errors if it fails to remove the given
folders, making issues easier to debug.

0db12d7afc
2025-03-12 18:02:09 +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
3e78a2f58e
[rubygems/rubygems] Improve error message when on read-only filesystems
If we fail to write the lockfile, give a better error.

81a08d6eda
2025-02-27 13:32:32 +09:00
David Rodríguez
bd88cffd8c [rubygems/rubygems] Test with Ruby 3.4
23d06195fa
2024-11-28 15:52:16 +00:00
David Rodríguez
ffd51926bf [rubygems/rubygems] Remove the need for some bundler monkeypatches
f530f8686d
2024-10-23 08:52:45 +00:00
David Rodríguez
f8e3afd255 [rubygems/rubygems] Remove code that's not needed for the spec to pass
ce9f6285c4
2024-10-10 14:51:31 +00:00
David Rodríguez
73834f11fa [rubygems/rubygems] Fix Gem::Specification#gem_dir losing custom source for some reason
f8f589b1b8
2024-10-09 05:54:14 +00:00
Samuel Giddins
db6e6155d6 [rubygems/rubygems] Remove outdated conditionals from tests
Signed-off-by: Samuel Giddins <segiddins@segiddins.me>

06eec6d855
2024-10-04 20:01:51 +00:00
David Rodríguez
cf063c008f [rubygems/rubygems] Bump rubies in CI to 3.3.5
A spec needed changes because now loading the default `json` prints a
warning about `ostruct` getting loaded although it will be removed in
the future. Use a different default gem to test this.

7415a66906

Co-authored-by: Samuel Giddins <segiddins@segiddins.me>
2024-09-17 11:10:58 +00:00
David Rodríguez
ad6b2e8985 [rubygems/rubygems] Test using latest rubies
6d6646b8bc
2024-07-09 11:26:10 +00:00
Jerome Dalbert
bbb4da78c7 [rubygems/rubygems] Use preferred add_dependency instead of add_runtime_dependency
9a08043858
2024-07-05 02:24:53 +00:00
David Rodríguez
98c923ff4b
Synchronize Bundler & RubyGems (#11071) 2024-06-28 10:12:29 -04:00
David Rodríguez
4d29d219b9 [rubygems/rubygems] Enable one spec on truffleruby that reproduces the Pathname problem
Recent refactorings in test suite to not load `pathname` for launching
Bundler subprocesses make some specs fail due to the warnings Ruby prints
when autoloading `pathname` under a namespace. But enabling this spec
also reproduces the hard error it produces on truffleruby.

e47cd78081
2024-06-06 18:44:53 +00:00
David Rodríguez
939d389c54 [rubygems/rubygems] Improve default gem handling by treating default gems as any other gem
For backwards compatibility, make sure default gems are still used as a
last resort when materializing, in case no remote, cached, or installed
specs are found.

93788f689f
2024-05-29 13:55:25 +00:00
David Rodríguez
744dd5a362 [rubygems/rubygems] Fix performance regression on applications with a local cache
Even if all gems are properly installed and no resolve is needed, we
recently started always reading all packages in `vendor/cache` and
extracting specifications from them.

This commit fixes the problem by longer making considering cached specs
the default and only enable them when a resolve is actually needed.

edeb2c42bf
2024-05-24 15:02:30 +00:00
David Rodríguez
53571de8e9 [rubygems/rubygems] Fix circular require warning
241d0aafcd
2024-04-29 09:04:33 +00:00
Josh Nichols
6f4f360fc4 [rubygems/rubygems] Add auto_install support to require "bundler/setup"
We have some places that already use `bundle config auto_install true`,
ie:

7a144f3374/bundler/lib/bundler/cli.rb (L11)

This applies the same logic (copy and pasted) to happen when you
`require "bundler/setup"`.

bb3c922341
2024-04-25 18:46:05 +00:00
Hiroshi SHIBATA
7b568b1f78 [rubygems/rubygems] bin/rubocop -a
f79a6a004d
2024-02-16 05:38:41 +00:00
Yusuke Endoh
92eab382e4 Update the error message format in bundler 2024-02-15 18:42:31 +09:00
David Rodríguez
5a884c2e00 [rubygems/rubygems] Add a spec to prove uri is no longer loaded
3a262f55c8
2024-01-29 12:15:37 +09:00
David Rodríguez
b300f5a0e1
[rubygems/rubygems] Revert "Improve default gem handling"
This reverts commit 091b4fcf2b.

dcade3235f
2023-12-14 20:22:48 +08:00
David Rodríguez
ac939d9ca3 [rubygems/rubygems] Improve default gem handling
If a gem is specified in the Gemfile (or resolved as a transitive
dependency), it's always resolved from remote/installed sources. Default
gems are only used as a fallback for gems not included in the bundle.

I believe this leads to more consistent behavior and more portable apps,
since all gems will be installed to the configured bundle path,
regardless of whether they are default gems or not.

091b4fcf2b
2023-12-13 13:02:22 +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
David Rodríguez
2755cb1b2f [rubygems/rubygems] Use modern hashes consistently
bb66253f2c
2023-12-07 22:29:33 +00:00
Martin Emde
5f0ea3f590 [rubygems/rubygems] Converts Bundler lockfile checksum validation to opt-in only
Looks for the CHECKSUMS section in the lockfile, activating the feature
only if the section exists. Without a CHECKSUMS section, Bundler will
continue as normal, validating checksums when gems are installed while
checksums from the compact index are present.

2353cc93a4
2023-12-05 21:09:53 +00:00
David Rodríguez
60803e192e [rubygems/rubygems] Remove no longer necessary workaround for old RubyGems
ed4eaefac0
2023-11-27 15:04:40 +09:00
Nobuyoshi Nakada
8e64c87f64 [rubygems/rubygems] Make sure to require "rubygems" explicitly
This is also done in bundler/lib/bundler/rubygems_integration.rb, but
bundler/lib/bundler.rb loads this file before it.

8840d8507b
2023-11-13 11:33:00 +00:00
David Rodríguez
50482cd1e5 [rubygems/rubygems] Drop support for Ruby 2.6 and Ruby 2.7 in Bundler
93619c97ff
2023-11-13 11:06:10 +09:00
Thong Kuah
ad08674d8d
[rubygems/rubygems] Add CHECKSUMS for each gem in lockfile
We lock the checksum for each resolved spec under a new CHECKSUMS
section in the lockfile.

If the locked spec does not resolve for the local platform, we preserve
the locked checksum, similar to how we preserve specs.

Checksum locking only makes sense on install. The compact index
information is only available then.

bde37ca6bf
2023-10-23 13:59:01 +09:00
Hiroshi SHIBATA
ba4fed47ec Removed examples for warning bundled gems 2023-10-13 16:22:09 +09:00
Martin Emde
c3fc70cc93 [rubygems/rubygems] Exempt default gem 'etc' in setup tests for rubies before 3.2 on windows
834ae8a29a
2023-10-09 20:15:47 +00:00
Peter Boling
16a97c7bbb
[rubygems/rubygems] 🚨 Rubocop Linting
2851e051c3
2023-10-03 16:13:18 +09:00
Samuel Giddins
e9ed0b3068 [rubygems/rubygems] Stop bundler eagerly loading all specs with exts
We were setting the wrong `extension_dir` for git specs stubs

Additionally, the call to `self.extension_dir` was loading the
remote spec, which was avoidable since the stub had an extension dir
(and in fact its #gem_build_complete_path does exactly what we want
anyway)

Finally, now set the base_dir when loading the remote_spec from a
stub specification, since the git source sets the base dir for stubs
based on where the spec _will_ be installed to, and we want to preserve
that so the base_dir for the loaded spec & the stub are the same

a94acb465b
2023-09-21 18:28:54 +00:00
Hiroshi SHIBATA
2efd59e2eb [rubygems/rubygems] Use assertion message strictly
98da5b9826
2023-09-01 07:04:43 +00:00
Nobuyoshi Nakada
0d86cc4caf [rubygems/rubygems] Use the dedicated method to convert file path
The dedicated method `File.path` to deal with pathname-like objects
has been provided since ruby 1.9.0.
Also adds a test for rubygems/rubygems#6837.

258c6eda80
2023-07-30 01:36:23 +00:00
Hiroshi SHIBATA
35517baae5 Use Gem::BUNDLED_GEMS::SINCE 2023-07-28 14:57:10 +09:00
Hiroshi SHIBATA
cf1f2e9d06 [rubygems/rubygems] bin/rubocop -A
e8a4184429
2023-07-25 06:23:29 +00:00
Hiroshi SHIBATA
979d1fa5fe [rubygems/rubygems] Extract Gem::BUNDLED_GEMS from Bundler
e30e86aa60
2023-07-25 06:23:28 +00:00
Hiroshi SHIBATA
8fbe7d0295 [rubygems/rubygems] Skip warnings if bundled gems is already loaded
9583a7eb82
2023-07-25 06:23:28 +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
fc5dbea4c3 [rubygems/rubygems] Added Ruby version for bundled gems to warnings
d61c1362e7
2023-07-25 06:23:26 +00:00