Commit graph

66 commits

Author SHA1 Message Date
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
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
f3ea6c35cc
[rubygems/rubygems] Normalize Bundler version spec filters
28b6a7cf5e
2025-06-19 10:23:36 +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
bb1b5877a7 [rubygems/rubygems] Consistently use "lockfile" over "lock file"
e891be9197
2025-03-24 13:25:07 +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
3a273c4742 [rubygems/rubygems] Fix error when changing a path source to a git source if frozen mode
4c79ab9b2e
2024-09-30 05:09:16 +00:00
David Rodríguez
1e00763688 [rubygems/rubygems] Fix duplicated spec names
26f6600197
2024-09-30 05:09:16 +00:00
David Rodríguez
9f5860407f [rubygems/rubygems] Fix error message when Bundler refuses to install due to frozen being set without a lockfile
0857d62ca6
2024-08-23 07:00:30 +00:00
David Rodríguez
133fec4ce9 [rubygems/rubygems] Fix another strange error when running bundle add in frozen mode
If there's a lockfile, but it's out of sync with the Gemfile because a
dependency has been deleted, and frozen mode is set, Bundler will print
the following strange error:

```
$ bundle add rake
, but the lockfile can't be updated because frozen mode is set

You have deleted from the Gemfile:
* rake (~> 13.2)

Run `bundle install` elsewhere and add the updated Gemfile to version control.
```

This commit changes the error to:

```
Some dependencies were deleted from your gemfile, but the lockfile can't be updated because frozen mode is set

You have deleted from the Gemfile:
* rake (~> 13.2)

Run `bundle install` elsewhere and add the updated Gemfile to version control.
```

452da4048d
2024-07-10 08:04:07 +00:00
David Rodríguez
98c923ff4b
Synchronize Bundler & RubyGems (#11071) 2024-06-28 10:12:29 -04:00
David Rodriguez
bc652d7568
[rubygems/rubygems] Never write credentials to lockfiles
e8a363713e
2024-04-18 11:07:09 +09:00
Martin Emde
1e5c8afb15 [rubygems/rubygems] Ensure that the lockfile mtime is not altered on frozen install
6847709ee0
2023-12-12 02:39:57 +00:00
David Rodríguez
2755cb1b2f [rubygems/rubygems] Use modern hashes consistently
bb66253f2c
2023-12-07 22:29:33 +00:00
David Rodriguez
a812f1fed0 [rubygems/rubygems] Reword a couple of error messages
When a path does not make a lot of sense.

d173c79e9a
2023-09-27 05:20:57 +00:00
David Rodríguez
0e7536bf49 [rubygems/rubygems] Prefer squiggly heredocs over custom helper
258476c38a
2023-07-24 14:59:34 +09:00
David Rodríguez
3e7f5b02ae [rubygems/rubygems] Improve error message in frozen mode edge case
When a top level dependency is missing from the lockfile, and we're in
frozen mode, we should also print a "frozen error".

3e82b835e3
2023-06-15 07:01:25 +09:00
David Rodríguez
e86f4c581b [rubygems/rubygems] Improve frozen mode error message
This error message is also printed when using `bundler/setup` in frozen
model, so we're not necessarily installing any gems when it happens.

This new message play nicer with all situations.

6874bbacce
2023-06-15 07:01:25 +09:00
David Rodríguez
23ecaab8dd [rubygems/rubygems] Use "frozen" rather than "deployment" in error message
I think it communicates better what's going on.

07a25767a4
2023-06-15 07:01:24 +09:00
David Rodríguez
96e3f31c1e [rubygems/rubygems] Make frozen mode spec also pass on Bundler 3
ad52f840f2
2023-06-15 07:01:20 +09:00
David Rodríguez
e1038f943f [rubygems/rubygems] This spec is independent from global sources
d91c245921
2023-06-15 07:01:20 +09:00
David Rodríguez
03246719cc [rubygems/rubygems] Fix path vs deployment precedence when path set through ENV
The `deployment` setting sets `path` to `vendor/bundle` implicitly, but
that should only apply if `path` is not set explicitly, at any level.

3552c064c1
2023-06-06 10:52:57 +09:00
David Rodríguez
7b317243ad [rubygems/rubygems] Unexclude some specs on bundler 3
These should all be passing on Bundler 3.

4a8c172965
2023-06-06 10:52:56 +09:00
David Rodríguez
6353f1d5e8 [rubygems/rubygems] Fill in missing deployment specs
e16aa47b8f
2023-06-06 10:52:56 +09:00
David Rodríguez
603772440c [rubygems/rubygems] Remove redundant specs
They are already tested above.

23073dcece
2023-06-06 10:52:55 +09:00
David Rodríguez
9492efbe71 [rubygems/rubygems] Remove unnecessary local helper
27ed6870ce
2023-03-17 18:50:55 +09:00
David Rodríguez
0e60bc118b [rubygems/rubygems] Ignore dependencies not actually locked from frozen check
Only needed if there can be no explicit global source (bundler < 3).

73923f4af5
2021-12-10 19:09:55 +09:00
David Rodríguez
4c5e862434 [rubygems/rubygems] Improve source gemfile/lockfile equivalence checks
Since we no longer have multiple global sources, each top level dependency is
always pinned to a single source, so it makes little sense to talk about
adding or removing a source. Instead, source changes always mean to
change the source one or more dependencies are pinned to. This logic can
now be much simpler.

f1d33fa0df
2021-12-03 20:00:51 +09:00
David Rodríguez
7d974cc56f [rubygems/rubygems] Don't overwrite locked dependency sources too early
Otherwise we hide some useful message about dependency source changes.

c926673c5b
2021-12-03 20:00:50 +09:00
David Rodríguez
aa87780f8f [rubygems/rubygems] Fix incorrect order in changed sources message
6f1b5f68de
2021-12-03 20:00:49 +09:00
Daniel Niknam
2f9e0cf181
[rubygems/rubygems] Explicitly define a global source for tests
This is in preparation for deprecating source-less gemfiles.

d6493fa3e2
2021-07-27 09:25:57 +09:00
Hiroshi SHIBATA
ed149dbf46 Merge the master branch of Bundler 2021-04-15 15:36:15 +09:00
David Rodríguez
53468cc111 Sync latest development version of bundler & rubygems 2021-03-08 13:47:35 +09:00
Hiroshi SHIBATA
69ed64949b Track Bundler master(2.3.0.dev) branch at 55634a8af18a52df86c4275d70fa1179118bcc20 2021-01-04 13:14:43 +09:00
Hiroshi SHIBATA
473f9d2df0 Merge prepare version of Bundler 2.2.0 2020-12-08 17:30:02 +09:00
Hiroshi SHIBATA
d386a58f6f Merge bundler-2.2.0.rc.2 2020-10-15 17:19:02 +09:00
David Rodríguez
2fafc08aa3 [rubygems/rubygems] Remove unneeded trailing conditions on exitstatus
27e0e4ecb6
2020-07-15 16:05:12 +09:00
David Rodríguez
ea4824ee0f [rubygems/rubygems] s/run!/run
e3f60d8aec
2020-06-18 19:14:15 +09:00
David Rodríguez
696a50751b [rubygems/rubygems] s/install_gemfile!/install_gemfile
4d1a0c465a
2020-06-18 19:14:15 +09:00
David Rodríguez
1436b5026c [rubygems/rubygems] s/bundle!/bundle
746a4b3d74
2020-06-18 19:14:15 +09:00
David Rodríguez
61b6f53337 [rubygems/rubygems] Make helpers raise by default
ade0c441d5
2020-06-18 19:14:15 +09:00
David Rodríguez
8c686475c8 [rubygems/rubygems] Migrate some specs to use "the new way"
The commands these specs run were throwing warnings in bundler 2, and
failing on bundler 3, effectively testing a different scenario to what
they were supposed to.

97ac1ced49
2020-06-18 19:14:15 +09:00
David Rodríguez
117b504b98 Fix most exec specs
The `gem_command` helper was failing to require `support/hax.rb`, which
takes care of making sure rubygems actually picks up the right `ruby`
executable under ruby-core setup (`ENV["RUBY"]`). This caused binstubs
to be generated with a wrong shebang, and that caused `bundle exec` to
not work. The error message was pretty confusing though due to
https://bugs.ruby-lang.org/issues/16952.
2020-06-15 12:38:39 +09:00
David Rodríguez
e413e746af [rubygems/rubygems] Remove forgotten_command_line_usages from specs
Instead, use the non-deprecated option except when specifically testing
deprecated CLI flags. In that case, pass the flag directly and limit
the specs to `bundler < 3`.

3d5e186241
2020-06-05 07:32:42 +09:00
David Rodríguez
61b61f426a [rubygems/rubygems] Reword specs to not mention deprecated flags
f878a81f22
2020-06-05 07:32:42 +09:00
David Rodríguez
5a12fc7c7f [rubygems/rubygems] Unskip "monorepo issues"
They seem to be passing?

a00d1e6896
2020-06-05 07:32:42 +09:00
Hiroshi SHIBATA
26367367ec Marked the failing examples with the current master branch on ruby repository 2020-05-22 20:32:30 +09:00
Hiroshi SHIBATA
c7ebeb7eda Sync Bundler PR #3624 2020-05-22 20:32:30 +09:00
Hiroshi SHIBATA
0e60b59d58 Update the bundler version with master branch 2020-05-13 07:54:37 +09:00
Hiroshi SHIBATA
13f4f07f21 Merge bundler-2.1.4 2020-01-08 18:00:32 +09:00