Commit graph

600 commits

Author SHA1 Message Date
David Rodríguez
e42f1aaa5a [rubygems/rubygems] Fix truffleruby failing to install sorbet-static when there's no lockfile
The generic Ruby platform was getting unconditionally added in
truffleruby, preventing resolution in situations where there's no
generic ruby version (sorbet-static). Instead, the generic platform
should be considered per dependency, not globally.

a96afc5351
2025-07-30 11:19:26 +09:00
David Rodríguez
95fdaa5c3b
(Temporarily?) delay path changes and global cache changes
There are several issues with these which I'm not sure I'll have time to
address properly. I prefer to keep our default branch in a releasable
state just in case. Once they are fixed, this can be reverted.
2025-07-28 10:01:58 +09:00
David Rodríguez
0dc86fd843 [rubygems/rubygems] Remove unnecessary branching
We now run specs against a single version, so I prefer to keep a single
branch. Once we bump the major version, this will need very little
updates, and that seems fine.

3866d25a00
2025-07-28 09:39:03 +09:00
David Rodríguez
2690d21067 [rubygems/rubygems] The install_gemfile helper has not set "retry" for a long time
41dab5954f
2025-07-28 09:39:02 +09:00
David Rodríguez
e67f595e8f [rubygems/rubygems] Build bundler gem just once for specs
When we need to reset system gems during specs, there's no need to
rebuild bundler, we can copy over the original gem home.

7b4f80747b
2025-07-25 11:10:37 +09:00
David Rodríguez
63c4223775 [rubygems/rubygems] Don't create an empty bundled_app when setting up deps
Running everything in `bundled_app` by default causes the `bundled_app`
helper to be used everytime, and that will create a scoped bundled_app
folder if it does not exist. That causes `bin/rake spec:deps` to create
an empty `tmp/2.1/bundled_app` folder which is a bit weird.

This commit changes specs to not switch to a (possibly empty)
bundled_app directory when not necessary (for example, when running
`gem` commands in order to setup test dependencies).

4bf89c0705
2025-07-25 11:10:36 +09:00
David Rodríguez
ce0d71b3a7 [rubygems/rubygems] Simplify new gem spec that simulates "no git available"
I don't know why it was written like that.

ee83fddd30
2025-07-25 11:10:34 +09:00
David Rodríguez
b78406a032 [rubygems/rubygems] Fix some specs running the wrong rake
8d4eb154b1
2025-07-25 11:10:34 +09:00
David Rodríguez
60fca1defc
Cancel --force deprecation in favor of --redownload
I realized `--redownload` is not a good name, because it does not
necessarily redownloads gems. It only forces reinstallation even if gem
is already installed.

So I believe `--force` is actually a better name and the introduction of
`--force` was a misunderstanding of what the `--force` flag did at the
time.

Let's cancel the deprecation of `--force`.

For now the `--redownload` alias is left around until we decide what to
do with it.
2025-07-17 11:10:46 +09:00
Sweta Sanghavi
4ed2757543 [rubygems/rubygems] Update gemspec based on provided github username when exists
* Conditionally set changelog_url if gh username passed
and enabled
* conditionally set homepage, source code uri, homepage uri when gh
  username passed in
* update documentation to say username will also be used for gemspec file

1c1ada593b
2025-07-09 13:48:37 +09:00
David Rodríguez
9942ff7c6a [rubygems/rubygems] Use shorter questions as prompts in bundle gem
If we use long explanations as prompts, sometimes the prompt gets
printed twice due to a (I think) reline/readline bug.

987e0dfa90
2025-07-09 13:48:33 +09:00
David Rodríguez
5fa484a441 [rubygems/rubygems] Move specs independent of gem name out of shared examples
And rename the shared examples to "paths dependent on gem name".

cdcc8ba92a
2025-07-07 11:53:10 +09:00
David Rodríguez
6d696fa3b4 [rubygems/rubygems] Move specs independent from gem_name out of "generating a gem" shared specs
So that they don't run repeatedly.

1f65e879f4
2025-07-07 11:53:09 +09:00
David Rodríguez
fab1323ab3 [rubygems/rubygems] Remove unnecessary nesting
eac831a1b7
2025-07-07 11:53:08 +09:00
David Rodríguez
e7f11ecc2b [rubygems/rubygems] Actually run "generating a gem" shared examples for the more standard name
They were only being run for "edge case" names, yet it tests all kind of
things about generation.

3e9d805eea
2025-07-07 11:53:08 +09:00
David Rodríguez
8a802f7e4e [rubygems/rubygems] Fix assertions to not depend on specific gem name
27a4af859e
2025-07-07 11:53:07 +09:00
David Rodríguez
f609d3395e [rubygems/rubygems] Remove unnecessary feature flag check
This spec now only runs in Bundler 2 mode.

f52cb240ca
2025-07-07 11:52:59 +09:00
David Rodríguez
81da38b308 Sync RubyGems 2025-07-03 13:43:00 +09:00
David Rodríguez
c4c646d1bb
[rubygems/rubygems] Handle connection refused and Errno::EADDRNOTAVAIL as non-retryable
cd529776d5
2025-07-02 10:34:19 +09:00
Earlopain
560edfc8f7
[rubygems/rubygems] Fix bundle console printing bug report template on NameError during require
Followup to https://github.com/rubygems/rubygems/pull/8436

It fixed showing the template when requiring a non-existant file but
user code can do much more than just trying to require other code.

I encountered this particular case because of load order issues, where a library wasn't able
to properly require itself when loaded before some other library.

1c910e5afe
2025-07-02 10:34:19 +09:00
David Rodríguez
82692b32c1
[rubygems/rubygems] Log when simulate_version is enabled
Tweak version output and verbose mode to be transparent about Bundler
simulating a different version than the real one.

179354d153
2025-07-02 10:34:18 +09:00
David Rodríguez
e5d1720e06
[rubygems/rubygems] Spec about cleaning default gems executables no longer needs realworld gems
9cf284997b
2025-07-02 10:34:18 +09:00
David Rodríguez
b953d1134a
[rubygems/rubygems] Migrate bundle viz specs to run offline
672722cd4d
2025-07-02 10:34:18 +09:00
David Rodríguez
669813a48d
[rubygems/rubygems] Realworld tsort gem should be no longer necessary
93d9b97182
2025-07-02 10:34:18 +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
e1896c1910
[rubygems/rubygems] Lock specs don't need the real rake gem
d795b8fcb4
2025-07-02 10:34:18 +09:00
David Rodríguez
99178c3ebb
[rubygems/rubygems] Migrate bundle add specs to run offline
02de767e14
2025-07-02 10:34:18 +09:00
Hiroshi SHIBATA
4e3ef1d9b3 [rubygems/rubygems] Added extra examples
a2e4d8299f
2025-06-30 12:56:50 +09:00
Hiroshi SHIBATA
4ef8cb2671 [rubygems/rubygems] Assert stdout message instead of rspec-mock
91d7abe27f
2025-06-30 12:56:50 +09:00
Hiroshi SHIBATA
7e9cbb109f [rubygems/rubygems] Added missing caller for shared_example
ab9b8c2511
2025-06-30 12:56:50 +09:00
Hiroshi SHIBATA
1cb1b15f77 [rubygems/rubygems] Added --bundle option for triggering bundle install automatically after bundle gem
59ac0db26b
2025-06-30 12:56:50 +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
90085f62fb [rubygems/rubygems] Simulate Bundler 4 in a better way
Overriding the version constant feels too magic and creates a set of
problems. For example, Bundler will lock the simulated version, and that
can cause issues when the lockfile is used under an environment not
simulating Bundler 4 (it will try to auto-install and auto-switch to a
version that does not exist).

On top of that, it can only be configured with an ENV variable which is
not too flexible.

This commit takes a different approach of using a setting, which is
configurable through ENV or `bundle config`, and pass the simulated
version to `Bundler::FeatureFlag`. The real version is still the one set
by `VERSION`, but anything that `Bundler::FeatureFlag` controls will use
the logic of the "simulated version".

In particular, all feature flags and deprecation messages will respect
the simulated version, and this is exactly the set of functionality that
we want users to be able to easily try before releasing it.

8129402193
2025-06-26 08:06:48 +09:00
David Rodríguez
938ab128a4 [rubygems/rubygems] Remove unnecessary version check
The `inject` command is deprecated, so these specs only run for Bundler
3 and checking this is unnecessary.

c89fb788f8
2025-06-26 08:06:47 +09:00
David Rodríguez
54e51f1fc3 [rubygems/rubygems] Make yet one more update spec independent of running version
07762f6c1f
2025-06-26 08:06:46 +09:00
David Rodríguez
782d8287c3 [rubygems/rubygems] Remove hardcoded version check from one clean spec
9244cca381
2025-06-26 08:06:46 +09:00
David Rodríguez
7e0358e04f [rubygems/rubygems] Make one more update spec independent of running version
dcd8e8210f
2025-06-26 08:06:45 +09:00
David Rodríguez
a2fb1d7dca [rubygems/rubygems] Reorganize post bundle message specs to run independently of major version
70c69c45ba
2025-06-26 08:06:42 +09:00
David Rodríguez
4e74f55db7 [rubygems/rubygems] Use nicer indentation
7e959adce6
2025-06-26 08:06:41 +09:00
David Rodríguez
428627ab68 [rubygems/rubygems] Simplify pristine spec to not need checking major version
bd2a170330
2025-06-26 08:06:40 +09:00
David Rodríguez
32a9f29cc8
[rubygems/rubygems] Remove no longer necessary workarounds for restarts
Since we no longer pass ruby CLI flags in our spec commands, we no
longer need the previous workaround and can get the realworld code
tested.

fd92c855fb
2025-06-24 12:10: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
8f009601f9 [rubygems/rubygems] Handle Errno::EADDRNOTAVAIL gracefully
As showed by the unskiped spec, on Windows trying to use the 0.0.0.0
interface raises this error, and it's raised as a generic system error
when trying to create a `bundler.lock` file. Here's is a better place to
handle that.

e32c5a9e5c
2025-06-23 11:07:02 +09:00
David Rodríguez
441f18df52
Skip to Bundler 4 directly 2025-06-19 10:23:36 +09:00
David Rodríguez
6d8460e0a0
[rubygems/rubygems] Fix running gem commands in a bundle exec context
They should only load plugins from gems in the bundle.

a229507820
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
4245d522b2
[rubygems/rubygems] Allow enabling "Bundler 3 mode" more easily
Currently to test Bundler 3 mode we have to actually edit the version
file to simulate we're running a future version. This is inconvenient.

Instead, allow passing an environment variable, `BUNDLER_3_MODE`, to set
the "working mode" Bundler should use.

This can now be set easily by end users to enable them to try out the
changes in the future version and give us feedback.

It's unclear how version auto-switching should work when this
environment variable is set, so the auto-switching feature will be
disabled in that case.

4e92e9b209
2025-06-19 10:23:36 +09:00
David Rodríguez
459f265b56
[rubygems/rubygems] Cleanup dead code, RubyGems 3.3 is no longer supported
945a29a477
2025-06-17 15:09:34 +09:00
Randy Stauner
b5beb19825 [rubygems/rubygems] Validate dependencies when doing bundle install
b0983f392f
2025-06-11 08:48:55 +09:00
David Rodríguez
ca1c46d33c [rubygems/rubygems] Ignore local specifications if they have incorrect dependencies
Currently ruby-dev installs an incorrect gemspec for rdoc, that does not
declare its dependency on psych.

This seems like a ruby-core bug, but it seems best for Bundler to ignore
it, go with the remote specification instead, and print a warning.

227cafd657
2025-06-06 10:22:29 +09:00