Commit graph

232 commits

Author SHA1 Message Date
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
bc5b594946 [rubygems/rubygems] Remove some unnecessary artifice arguments
Since `sys_exec` does not actually set it.

abc0fd0599
2025-07-25 11:10:35 +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
6a5808965b [rubygems/rubygems] Stop allowing calling #gem on random objects
4b8570ae15
2025-07-07 11:53:12 +09:00
David Rodríguez
fe44e95808
[rubygems/rubygems] Remove possibly incorrect spec
I spent quite a while on this and I have not been able to reproduce or
even understand how the original issue would happen. I also suspect it
never actually reproduced the original problem properly.

Since I'm in the middle of migrating all specs away from touching the
network, I decided to remove it since I can't write an equivalent spec
without being able to understand the original problem.

c9dfa20877
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
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
7a297ad2f9
[rubygems/rubygems] Fix Bundler.original_env['GEM_HOME'] when Bundler is trampolined
4c450eb05e
2025-06-24 12:10:50 +09:00
David Rodríguez
bc6b045153
[rubygems/rubygems] Cleanup now unnecessary RUBYOPT handling
ac83c78635
2025-06-24 12:10:50 +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
6217216be2
[rubygems/rubygems] Use ENV consistently over CLI flags for specs
dafe50f171
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
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
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
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
417210c0ec [rubygems/rubygems] Make self management specs independent from version of Bundler
1257bd161e
2025-06-05 19:12:42 +09:00
Nicholas La Roux
1f894fa2cc
[rubygems/rubygems] Remove unnecessary duplicate x64-mingw-ucrt entry
d6f1f96585
2025-06-03 07:47:14 +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
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
91a17fbbad
[rubygems/rubygems] Use preferred :windows value for Windows exclusively
aee52d2874

Co-authored-by: johnnyshields <27655+johnnyshields@users.noreply.github.com>
2025-02-14 16:13:27 +09:00
David Rodríguez
451d848a76
Stop generating binstubs for Bundler itself 2025-01-31 14:34:55 +09:00
David Rodríguez
9b2ebfc729 [rubygems/rubygems] Fix bug report template incorrectly showing up
If a gem has an internal error, that should not make `bundle console`
print the bug report template.

7432a9a084
2025-01-28 15:31:57 +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
David Rodríguez
4035003fd0 [rubygems/rubygems] Remove duplicated bundle install
1774ac5db1
2025-01-28 15:31:51 +09:00
David Rodríguez
09b04fefb7 [rubygems/rubygems] Remove unnecessary platform helpers
I think they add unnecessary indirection and inconsistency to the specs.

609924d985
2025-01-28 15:31:49 +09:00
David Rodríguez
9c94b8feaf [rubygems/rubygems] Improve simulating Windows during Bundler specs
b48168bf1f
2025-01-28 15:31:48 +09:00
David Rodríguez
e7de621b5a [rubygems/rubygems] Revert RubyGems plugins getting loaded on Bundler.require
These changes were included when adding bundler plugin hooks for
`Bundler.require`, but they seem completely unrelated to that feature,
and have caused several issues.

8d56551dcf
2025-01-16 19:41:12 +09:00
David Rodríguez
9e0eb9778d Merge RubyGems-3.6.2 and Bundler-2.6.2 2024-12-24 07:21:10 +09:00
Camden Narzt
6cde41bc52 [rubygems/rubygems] Fix restarting with locked version when $PROGRAM_NAME has been changed
Use Process.argv0 instead of $PROGRAM_NAME because $PROGRAM_NAME is
liable to be changed but Process.argv0 is not.

43b747dc9e
2024-12-13 14:23:30 +00:00
David Rodríguez
bd88cffd8c [rubygems/rubygems] Test with Ruby 3.4
23d06195fa
2024-11-28 15:52:16 +00:00
sodacris
dd473cec29 [rubygems/rubygems] Fix binstub test bug
the overwritten binstub in the test has a final new line that makes it
not match "OMG" exactly from the beginning, that's why the test passes,
but `bintubs` command without `--force` flag is not supposed to update
the binstub.

This change fixes the test to test what's supposed to update the
binstub, and also fixes the assertion that that it will fail in the
future if `--force` stops updating the binstub.

dfc9023337
2024-11-19 12:56:01 +00:00
David Rodríguez
519b233695
Test with sinatra to 4.1.0 2024-11-19 08:13:10 +09: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
54065f3b7b [rubygems/rubygems] Cleanup some specs after recent support drop
9548aa6766
2024-10-22 09:04:30 +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
9d4e7b376a
Make spec file for env helpers more generic 2024-10-02 14:34:55 +09:00
David Rodríguez
5000138084
[rubygems/rubygems] Fix bundler/inline resetting ENV
72d8d4dbba
2024-10-02 14:34:55 +09:00
David Rodríguez
a3929a9ca1
[rubygems/rubygems] The BUNDLER_SETUP env should also be cleaned up
47b7e50f64
2024-10-02 14:34:55 +09:00
David Rodríguez
b48add3c65 [rubygems/rubygems] Fix bundler/inline overwriting lockfiles
This was introduced by 0b7be7bb77, because
the original patch was not adapted to some recent refactorings.

0bca60d6e5

Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>
2024-09-24 14:17:23 +00:00
David Rodríguez
5d53993a37 [rubygems/rubygems] Don't try to auto-install dev versions of Bundler not available remotely
1a7a3fdeb9
2024-09-23 10:53:32 +00:00
David Rodríguez
cf29594c03 [rubygems/rubygems] Don't try to install locked bundler when --local is passed
907d46964d
2024-09-20 09:58:24 +00:00