Commit graph

3217 commits

Author SHA1 Message Date
David Rodríguez
65612dbb38 [rubygems/rubygems] Fix daily CI
Platform specific versions of ffi-1.17.2 are not compatible with Ruby
3.5, so Bundler fails to resolve in Ruby 3.5 using recorded VCR
responses.

Use the generic version of ffi-1.17.2, which should work for all rubies,
consistently to fix that.

a192f7e35d
2025-08-04 09:27:51 +09:00
David Rodríguez
124cd77470 [rubygems/rubygems] Keep fixture Gemfiles in sync when bumping version
781443cb0f
2025-07-30 11:19:28 +09:00
dependabot[bot]
2ec5e70fdb [rubygems/rubygems] Bump thor in /bundler/spec/realworld/fixtures/tapioca
Bumps [thor](https://github.com/rails/thor) from 1.3.2 to 1.4.0.
- [Release notes](https://github.com/rails/thor/releases)
- [Commits](https://github.com/rails/thor/compare/v1.3.2...v1.4.0)

---
updated-dependencies:
- dependency-name: thor
  dependency-version: 1.4.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

0a4e5a377d
2025-07-30 11:19:27 +09:00
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
Nobuyoshi Nakada
e0818ac659
Fix stripping features from the description 2025-07-29 22:11:49 +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
Edouard CHIN
da3c47bcfc [rubygems/rubygems] Document missing options from man pages:
- The `bundle plugin uninstall --all` was missing.
- The `bundle plugin install --local-git` was missing due to being
  deprecated. We decided to reintroduce the doc for more clarity.

4da252945c
2025-07-25 11:10:42 +09:00
Edouard CHIN
4dd708bf5d [rubygems/rubygems] Add a quality spec to ensure man pages are up to date:
- Ref #8802
- ### Problem

  Whenever a bundler command options is added, we want to make
  sure that the associated command man page is updated to reflect
  the new option (e.g. this mistake was made in #8624)

  ### Solution

  In #8802 we discussed a bit on the implementation which would rely
  on parsing ronn files and introduce some conventions on how options
  documented in man pages should be written.

  I figured I would try a simpler approach by just checking if the man
  page of a command list options using a simple regex.

  Pros:

  - Simpler as we don't have to parse ronn files.
  - No need to modify all existing man pages.

  Cons:

  - We can only verify one way (CLI options -> man pages).
    If a CLI option get removed, we won't be able to warn that
    the existing document man page option needs to be removed.

e10e60bd33
2025-07-25 11:10:41 +09:00
David Rodríguez
416fde11eb [rubygems/rubygems] Fix language quality spec no longer getting run properly
c65e34a904
2025-07-25 11:10:39 +09:00
David Rodríguez
bfd0c15ffa [rubygems/rubygems] Fix man tracked files glob for ruby-core
The location has been consistent with upstream for a while so the
previous glob was no longer matching any files.

dae40b7041
2025-07-25 11:10:39 +09:00
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
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
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
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
e673bbf77b [rubygems/rubygems] Remove unused parameter
043f73586b
2025-07-25 11:10:33 +09:00
Samuel Williams
64f508ade8
Support cause: in Thread#raise and Fiber#raise. (#13967)
* Add support for `cause:` argument to `Fiber#raise` and `Thread#raise`.

The implementation behaviour is consistent with `Kernel#raise` and
`Exception#initialize` methods, allowing the `cause:` argument to be
passed to `Fiber#raise` and `Thread#raise`. This change ensures that
the `cause:` argument is handled correctly, providing a more consistent
and expected behavior when raising exceptions in fibers and threads.

[Feature #21360]

* Shared specs for Fiber/Thread/Kernel raise.

---------

Co-authored-by: Samuel Williams <samuel.williams@shopify.com>
2025-07-24 14:45:43 +12:00
Hiroshi SHIBATA
4dec4fbdfa
[rubygems/rubygems] Define dummy module for mise plugin
64bdff1e1e
2025-07-22 18:41:57 +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
David Rodríguez
45b53c0be1 [rubygems/rubygems] Remove some realworld specs
These two specs need the version of Bundler to be faked to pass. In one
of them we're doing it already, and in the other one it will be needed
when bumping the major version of Bundler. So they are no longer truly
realworld anymore.

Realworld specs are hard to maintain, particularly the ones that depend
on the version of Bundler itself, so I'm slowly moving away from them.

I checked the changes that introduced them and I believe it's really
unlikely that any of these catches turns out to be the only spec to
catch a resolver regression. We've completely changed the resolution
engine since and a lot of extra coverage has been added so I believe
it's fine to let these two go.

a363f0168c
2025-07-17 11:07:21 +09:00
David Rodríguez
fb4f9030cb [rubygems/rubygems] Regenerate VCR cassettes
8530965b9e
2025-07-17 11:07:18 +09:00
David Rodríguez
44dd27c430 [rubygems/rubygems] Fix bundle binstub --path=foo not printing a deprecation warning
Like others, it's a remembered option which we are deprecating in favor
of configuration.

801d5dd943
2025-07-17 11:07:14 +09:00
David Rodríguez
19d931b50d [rubygems/rubygems] Fix bundle cache path=foo not printing a deprecation message
0af03eea5d
2025-07-17 11:07:13 +09:00
Hiroshi SHIBATA
69d4c67347 Provide pathname.so with embedded Pathname 2025-07-15 13:36:03 +09:00
David Rodríguez
51e890030f
[rubygems/rubygems] Reset tmp directories before spec suite
If you abort running test suite with a quick double Ctrl-C, tmp files
will be left around, and they will interfere with the next test run.

To avoid this, make sure to clear them once at the beginning of the test
suite.

### Before

```
$ bin/parallel_rspec
16 processes for 175 specs, ~ 11 specs per process
.............................................................................................^C^C

Finished in 19.45 seconds (files took 0.42722 seconds to load)
94 examples, 0 failures

(... turbo tests backtrace ...)

$ bin/parallel_rspec
16 processes for 175 specs, ~ 11 specs per process
.F....F....F...F......^C

Failures:

(... failures' details ...)
```

### After

```
$ bin/parallel_rspec
16 processes for 175 specs, ~ 11 specs per process
.................................................................................^C^C

Finished in 18.18 seconds (files took 0.4383 seconds to load)
82 examples, 0 failures

(... turbo tests backtrace ...)

$ bin/parallel_rspec
16 processes for 175 specs, ~ 11 specs per process
................................................................................^C^C

Finished in 8.79 seconds (files took 0.45187 seconds to load)
80 examples, 0 failures

(... turbo tests backtrace ...)
```

6767a52711
2025-07-14 11:52:13 +09:00
Jeremy Evans
2ab38691a2 Add Set C-API
This should be a minimal C-API needed to deal with Set objects. It
supports creating the sets, checking whether an element is the set,
adding and removing elements, iterating over the elements, clearing
a set, and returning the size of the set.

Co-authored-by: Nobuyoshi Nakada <nobu.nakada@gmail.com>
2025-07-11 15:24:23 +09:00
Nobuyoshi Nakada
800de9891e
[Bug #19417] Update version guard 2025-07-10 21:42:28 +09:00
Janosch Müller
bd18238a0e [Bug #19417] Make word prop match join_control ...
... to conform to UTS 18 as mentioned in https://bugs.ruby-lang.org/issues/19417#note-3

https://unicode.org/reports/tr18/#word states word should match join_control chars.

It currently does not:

```ruby
[*0x0..0xD799, *0xE000..0x10FFFF].map { |n| n.chr 'utf-8' } => all_chars
all_chars.grep(/\p{join_control}/) => jc
jc.count # => 2
jc.grep(/\p{word}/).count # => 0
```
2025-07-10 21:28:41 +09:00
Andrew Konchin
087387794a Update to ruby/spec@ed254ba 2025-07-09 15:11:17 +02: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
6a5808965b [rubygems/rubygems] Stop allowing calling #gem on random objects
4b8570ae15
2025-07-07 11:53:12 +09:00
David Rodríguez
cd3389e5c2 [rubygems/rubygems] Cancel path_relative_to_cwd change
It only affected the `--path` flag which is actually getting removed, so
I don't think it makes sense to make such change. The current behavior
is reasonable and I tried to codify it with a few more specs.

6f520eb146
2025-07-07 11:53:11 +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
e95adbfa68 [rubygems/rubygems] Remove unnecessary nesting from standalone specs
Originally, all the specs in this file were put inside a shared examples
block, and since then all specs were run only changing the cwd (either
from root, or a subdirectory).

This was in d7291700d0, to cover a fix in
the `bundler_path` method.

However, reverting that fix does not make any of the specs in either of
the main blocks fail! Only an unrelated spec of `bundle install
--standalone --local` fails.

The reason is that all specs set `path` to an absolute path, making the
fix essentially uncovered.

In order to simplify the file structure and improve runtime, I
completely removed the shared examples block, and only run main specs
for the root directory. Then I added a couple of extra specs to cover
the original bug fix.

This cuts runtime of this spec file in half, from 1m30s to 45s on my
laptop.

cc506f17e0
2025-07-07 11:53:05 +09:00
David Rodríguez
9918ca1671 [rubygems/rubygems] Remove default_install_uses_path setting
The previous default can already be configured with `bundle config
path.system true`.

cb483b79db
2025-07-07 11:53:00 +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
35dd2b2994
[rubygems/rubygems] Split HTTP_ERRORS into retryable and non retryable
c241a640fc
2025-07-02 10:34:19 +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
David Rodríguez
46a90f9998
[rubygems/rubygems] Refactor downloader specs to better test real behavior
In particular, no route to host errors are actually fatal since they are
usually raised as `SocketError`'s, while the specs were incorrectly
testing that they are retryable.

9410ceb36b
2025-07-02 10:34:19 +09:00
David Rodríguez
b671133c06
[rubygems/rubygems] Move Bundler::Fetcher::HTTP_ERRORS to Bundler::Fetcher::DOWNLOADER
And deprecate the old constant.

It's only used in this class, and in Bundler::Fetcher there's already
FAIL_ERRORS, very similar to it. So this makes things less confusing.

d32ed63d6f
2025-07-02 10:34:19 +09:00
David Rodríguez
75cdf696e7
[rubygems/rubygems] Fix typos
2a2317249f
2025-07-02 10:34:19 +09:00