4055 Commits
Author SHA1 Message Date
Hiroshi SHIBATA 8f7eb9c415 [ruby/rubygems] Bump Bundler version to 4.1.0.beta3
https://github.com/ruby/rubygems/commit/f0b70a34eb
2026-10-28 04:21:02 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 8eaa862cdf [ruby/rubygems] Compare a rubygems source with itself without building its remotes
SpecGroup#merge compares the sources of candidates, which are nearly always the same object, and every comparison built the credential-less remote strings of both sides. This removes about 300,000 allocations from `bundle update` in the large scenario of tool/bench.

https://github.com/ruby/rubygems/commit/6c17f3b152

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 02:28:09 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 cf8f58a9f1 [ruby/rubygems] Point the from: and to: of 4.1.0.beta2 overrides at in: and with:
Otherwise `override "b", from: "a", to: "c"` from a beta2 Gemfile fails as an unsupported `from:` field, which does not say how to write it now.

https://github.com/ruby/rubygems/commit/28df3adad7

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 00:53:29 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 78da6e26a6 [ruby/rubygems] Rename the from: key of override to in:
`from:` next to `with:` still reads as a direction, while `override "grpc", with: "grpc-lite", in: "google-cloud-pubsub"` reads as a sentence. Gemfiles written for 4.1.0.beta2 already need editing for `to:`, so renaming `from:` in the same release adds no breakage.

https://github.com/ruby/rubygems/pull/9979#issuecomment-6451228694

https://github.com/ruby/rubygems/commit/e979da5d51

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 00:53:28 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 a5d2309e76 [ruby/rubygems] Pin that override rejects the to: key
The rename leaves no alias, so a Gemfile or OVERRIDES line still written with `to:` must fail rather than be read as `with:`.

https://github.com/ruby/rubygems/commit/43c9c015c9

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 00:53:27 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 474d1b0eae [ruby/rubygems] Rename the to: key of override to with:
Paired with `from:`, `to:` reads as converting the `from:` gem into the `to:` gem. The key is also recorded in the OVERRIDES section of Gemfile.lock, which no release has shipped yet, so rename it now without keeping `to:` as an alias.

https://github.com/ruby/rubygems/issues/9978

https://github.com/ruby/rubygems/commit/3101a39e20

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 00:53:27 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 997e41e85f [ruby/rubygems] Hash Bundler::Source::Rubygems from its remotes without credentials
eql? ignores credentials, so two sources that differ only in them were equal but hashed differently, and the uniq! in SourceList kept both. The lockfile then got a duplicate GEM section for the same remote.

https://github.com/ruby/rubygems/issues/8472

https://github.com/ruby/rubygems/commit/c8f328ab49

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 00:01:00 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 aed528a95c [ruby/rubygems] Rewrite the OVERRIDES section without resolving again
An override change made the lockfile count as needing resolution, so `bundle install` fetched the remote index and failed offline when the compact index cache was absent, and `Bundler.setup` re-resolved on boot. The section only needs to be regenerated, which #write_lock already does when the contents differ, and the frozen check still reports the change.

https://github.com/ruby/rubygems/commit/a616f3d1bb

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 00:42:50 +00:00
Yusuke EndohandClaude Opus 5.5 b861e2ba10 Skip Addrinfo specs unsupported by musl as on Android
musl getaddrinfo does not support SOCK_SEQPACKET and getnameinfo does
not support AF_UNIX.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:21:03 +09:00
Yusuke EndohandClaude Opus 5.5 21e6dea114 Fix Time specs that depend on the TZ parsing of glibc
* Time#utc_offset: use America/New_York, as musl parses "EST5EDT" as
  a POSIX TZ string instead of loading the zoneinfo file.
* Time#zone: musl accepts "hello-foo" as a POSIX TZ string.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:21:03 +09:00
Yusuke EndohandClaude Opus 5.5 e7f03c8f28 Skip the Encoding.locale_charmap spec for the C locale on musl
musl does not return "ANSI_X3.4-1968" for the C locale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:21:03 +09:00
Yusuke EndohandClaude Opus 5.5 1749dbbebe Read /proc/<pid>/cmdline to check the process title if available
Process.setproctitle and $0 specs used `ps -ocommand= -p`, but busybox
ps does not support -o/-p.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:21:03 +09:00
Yusuke EndohandClaude Opus 5.5 3d973f2b5a Skip argv[0] specs of Process.spawn and Process.exec on busybox /bin/sh
busybox is a multi-call binary which dispatches on argv[0], so it
cannot run as /bin/sh with an arbitrary argv[0] such as "argv_zero".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:21:03 +09:00
Farid Zakaria 0b5272459c [ruby/rubygems] Add checksums after platform changes in bundle lock
`bundle lock --add-checksums --add-platform arm64-darwin` wrote a
lockfile that listed arm64-darwin under PLATFORMS but carried none of
its platform-specific gems. `Definition#add_checksums` resolves the
bundle to fetch the checksums, and it ran before the platform options
were applied, so the resolution never saw the new platform.

This usually went unnoticed. `SpecSet#add_extra_platforms!` tries to
complete every platform the sources know about, and for most bundles
that added the darwin gems anyway. It stops working as soon as one gem
has a precompiled darwin build whose `required_ruby_version` excludes
the current Ruby (bcrypt_pbkdf 1.1.2 on Ruby 3.4): `complete_platform`
then gives up on darwin for every gem, and the lockfile ends up listing
a platform it has no gems for. Running `bundle lock` again does not
repair it, because the platform is already listed.

Apply `--add-checksums` after the platform changes have been recorded.

https://github.com/ruby/rubygems/commit/2f1d325fc2
2026-10-26 06:39:10 +00:00
Islam Elsayed a36b26e06b [ruby/rubygems] Apply BUNDLE_RETRY to lazy gemspec downloads
Resolving through the full-index API lazily downloads individual
gemspecs from /quick/Marshal.4.8/*.gemspec.rz. `Fetcher#fetch_spec` made
that request bare:

    Bundler.safe_load_marshal Bundler.rubygems.inflate(downloader.fetch(uri).body)

while `specs_with_retry`, in the same class, wraps its network call in
`Bundler::Retry`. So a single transient failure — a read timeout, say —
aborted the whole resolution, no matter what BUNDLE_RETRY was set to.
That is most painful without a lockfile, where a resolve can fetch a
great many gemspecs one at a time and any one of them can end it.

Wrap the download in the same `Bundler::Retry.new("fetcher", FAIL_ERRORS)`
the index path already uses. FAIL_ERRORS is what keeps this from retrying
things that will not change, such as authentication failures.

Only the download branch is wrapped. The file:// and cached-gemspec
branches do no network I/O, so retrying them would just repeat a local
failure.

Closes https://github.com/ruby/rubygems/pull/9817

https://github.com/ruby/rubygems/commit/9578cf9e93
2026-10-26 06:23:37 +00:00
Richard Janita 3541b9e034 [ruby/rubygems] Fix file locks letting multiple processes in when lock files are removed
Gem.open_file_with_lock removed its lock file after releasing the lock.
Since flock locks the file itself rather than its path, a process that
was waiting on the old file could acquire it after it had been removed,
while a newly arriving process created a fresh lock file and locked it
immediately, so both ran at the same time.

Remove the lock file while still holding the lock, and after acquiring
it, check that the locked file is still the one at the lock path,
retrying otherwise.

https://github.com/ruby/rubygems/commit/9a93c235e7
2026-10-26 05:29:46 +00:00
Shaisolaris 05fc71fb34 [ruby/rubygems] Preload git sources that share a cache one after another
Gems sourced from the same git repository share one cache directory.
Since git sources are preloaded in parallel, two workers could run git
fetch in that directory at the same time, and the fetches collided on
the shallow file and its lock, failing bundle install.

Group the sources by cache path and preload each group in a single job,
so sources sharing a cache run one after another while separate
repositories still run in parallel.

Fixes https://github.com/ruby/rubygems/pull/9946

https://github.com/ruby/rubygems/commit/c20901e6a1
2026-10-26 05:29:30 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 0440959f9a [ruby/rubygems] Reject ill-formed requirements while reading OVERRIDES
Override.from_lock accepted a line such as `"rake", version: "garbage"`, and the bad requirement only failed later as a Gem::Requirement::BadRequirementError outside the parser. Normalizing it while parsing turns it into a LockfileError that names the line.

https://github.com/ruby/rubygems/commit/4f594ea354

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 03:21:34 +00:00
Ufuk Kayserilioglu 510c0d69da [ruby/rubygems] Record overrides in the OVERRIDES section of Gemfile.lock
Bundler now writes the Gemfile overrides to an OVERRIDES section, one
line per field, sorted, with normalized requirements. The lockfile
parser reads the section without evaluating it. A change to the
overrides now changes the lockfile, and a frozen install fails with a
summary of the added and deleted overrides.

OVERRIDES is a known section, but it is not in
SECTIONS_BY_VERSION_INTRODUCED. Thus Bundler also compares it for
lockfiles that are still bundled with an older Bundler.

Override targets, from: and to: must now be valid gem names.

https://github.com/ruby/rubygems/commit/72bcc33d07
2026-10-26 02:13:55 +00:00
John Hawthorn b4ae8a7189 Skip Dir.scan device specs when readdir reports DT_REG 2026-10-21 12:01:58 -07:00
Nobuyoshi Nakada 5564c8f2bd Update ruby/spec for ruby/ipaddr#130
With ipaddr 1.3, bracketed IPv6 addresses with a prefix length are
warned and will result in an error in future versions (likely ipaddr
1.4).  Also, future versions of Ruby (likely 4.2) will bundle this
version.
2026-10-20 08:38:55 +09:00
Yusuke EndohandClaude Opus 5.5 c4eadc74c3 [ruby/rubygems] Rescue the LoadError in the spec for nested bundle exec with monkeypatches
The spec checks that the Kernel.require monkeypatch is still used, by
comparing the whole stdout. However, the script ended with an uncaught
LoadError for the non-existent "foo", and Ruby lazily loads
error_highlight, did_you_mean, and syntax_suggest when displaying an
error. If they are loaded through Kernel.require, the monkeypatch also
prints them and the spec fails, although that is unrelated to what the
spec checks. Rescue the LoadError so that no error is displayed.

https://github.com/ruby/rubygems/commit/5e1a0bd5af

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 03:53:43 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 2bd5b04e60 Read GNUmakefile when the build directory has no Makefile
`configure.bat --with-gnu-make` writes only `GNUmakefile`. The tests under `test/mkmf` failed to load with `Errno::ENOENT`, and `spec/default.mspec` lost `srcdir` and ran specs without `tool/runruby.rb`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 08:00:21 +09:00
John Hawthorn 0adee861cb Prevent uninitialized classes from being allocated 2026-10-13 17:02:46 -07:00
Hiroshi SHIBATAandClaude Opus 5.5 08a554ecfb Accept the long long conversion error in the IO::Buffer.string spec
The size is converted to rb_len_t, and the message names long long instead of long once rb_len_t widens on mswin.

https://bugs.ruby-lang.org/issues/22400

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:31:01 +09:00
Yusuke EndohandBenoit Daloze f423e416ce Update spec/ruby/fixtures/source_range_helpers.rb
Co-authored-by: Benoit Daloze <eregontp@gmail.com>
2026-10-11 04:27:15 +09:00
Yusuke EndohandClaude Fable 5.1 0816eec9ca Use Ruby::Prism in #syntax_tree and drop the version-mismatch warning
Method#syntax_tree & co. now parse with Ruby::Prism, the parser built
into the interpreter, instead of `require "prism"`.  The returned
nodes always come from the parser that parsed the code, so the
"a prism gem other than the default gem is loaded" warning, the
Gem.loaded_specs check, and the ArgumentError rescue for a prism that
does not know the running Ruby's grammar are no longer needed.

The specs are updated to expect Ruby::Prism nodes.

[Bug #22379]

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-11 04:27:15 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 d0d40dab7d [ruby/rubygems] Use a local git repository in the install_if lockfile spec
The spec cloned rack from github.com, so it timed out or failed to resolve the host on CI runners with unreliable network access.

https://github.com/ruby/rubygems/commit/1d074c386e

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 06:46:39 +00:00
Hiroshi SHIBATAandClaude Opus 5 cc3ba11012 Use rb_len_t in the C API for lengths and indices
Once rb_len_t widens this changes the `long *` output parameters of rb_range_beg_len(), rb_str_subpos(), rb_arithmetic_sequence_beg_len_step(), ruby_enc_find_basename() and ruby_enc_find_extname(), so extensions passing `long *` to them will need to be updated. The extension guides list these signatures verbatim and follow along.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-10-09 14:00:15 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 21f68cfec7 [ruby/rubygems] Stop retrying a 416 response to a request without Range
A server that answers 416 even after Range is dropped made Bundler::Fetcher::Downloader#fetch recurse until SystemStackError. Raise Bundler::HTTPError instead, as Gem::CompactIndexClient::HTTPFetcher does.

https://github.com/ruby/rubygems/commit/65835147fa

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 00:54:42 +00:00
Hiroshi SHIBATA 3a667ef647 [ruby/rubygems] Bump Bundler version to 4.1.0.beta2
https://github.com/ruby/rubygems/commit/3eba567a10
2026-10-08 04:22:44 +00:00
3cfbd9f6c1 [ruby/rubygems] Update gem build flags to include --content-addressable to build a content addressable gem
https://github.com/ruby/rubygems/commit/47fc8bf7df

Co-authored-by: Gira Chawda <gira.chawda@shopify.com>
Co-authored-by: Jenny Shen <jenny.shen@shopify.com>
2026-10-08 00:58:59 +00:00
Harriet Oughton e73601aa54 [ruby/rubygems] Update gem build flags to include --content-addressable to build a content addressable gem
https://github.com/ruby/rubygems/commit/6f327d8987
2026-10-07 23:25:40 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 8e8ad6ff6c [ruby/rubygems] Re-resolve when an override cuts a locked gem loose
Adding `to: nil` to an existing bundle left the dropped gem in the lockfile, because nothing marked the lockfile as changed. Frozen installs accepted that stale lockfile too.

https://github.com/ruby/rubygems/commit/6b3d576a8b

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 04:29:57 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 104b7ed98a [ruby/rubygems] Let override drop or replace one dependency of a gem
Some gems depend on a gem that only one of their features loads, or on a gem that an API-compatible one can stand in for. `override "B", from: "A", to: nil` drops the dependency of A on B, and `to: "C"` makes A depend on C instead.

The lockfile keeps every dependency as published, the same way `version:` overrides leave it, and the completeness checks, the installer and the source lookup apply the override instead.

https://github.com/ruby/rubygems/pull/9517#issuecomment-5992001829

https://github.com/ruby/rubygems/commit/231ecdf564

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 04:29:57 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 fd8e1c47c2 Prefer /dev/null as the character device in file type specs
Terminal devices picked by `find` can disappear while the specs run, and without a terminal on stdin `tty` prints "not a tty" to stdout, which became the path when `find` printed nothing. `File.lstat` matches how the specs check the type, so a symlinked /dev/null, as on Solaris, still falls back to the search.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 19:23:51 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 2f64f05420 [ruby/rubygems] Rename ruby_core_tarball? to git_repository?
It only checks whether the source root has .git, and nothing about ruby core.

https://github.com/ruby/rubygems/commit/fc8fa31bfe

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 06:23:52 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 635e6b9a05 [ruby/rubygems] Expect an unknown commit in bundle version only without git
The spec build metadata records unknown only when the source has no .git, so a git checkout of ruby core should report a real SHA as well.

https://github.com/ruby/rubygems/commit/f07a60f778

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 06:23:50 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 bdcdf98363 [ruby/rubygems] Skip specs based on what RUBYLIB provides instead of ruby core
These examples break when a library on RUBYLIB takes precedence over the gem they rely on. ruby core puts its source and extension directories there, but the condition is about RUBYLIB, not about being ruby core.

https://github.com/ruby/rubygems/commit/3031023478

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 06:23:50 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 1a09df1d6d [ruby/rubygems] Gate RubyGems 4.1 specs on 4.1.0.a instead of 4.1.0.dev
4.1.0.beta1 sorts before 4.1.0.dev, so these examples have been excluded everywhere since https://github.com/ruby/ruby/commit/4020342576a bumped the version.

https://github.com/ruby/rubygems/commit/25b40782db

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 06:23:49 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 10171f88e4 [ruby/rubygems] Skip content-addressed gem specs on prerelease Ruby instead of ruby core
Gem::ContentAddress is available in ruby core. What actually blocks these examples is that a prerelease Ruby never satisfies the ~> X.Y.0 pin of content-addressed gems, so they can still run on a release build.

https://github.com/ruby/rubygems/commit/8f3972f031

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 06:23:49 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 347a80c8c9 [ruby/rubygems] Skip the newgem linter specs only when ast.rb is on RUBYLIB
An in-tree build of ruby core puts the source root on RUBYLIB, and its ast.rb shadows the ast gem that rubocop-ast requires. Out-of-source builds, as on CI, can run them.

https://github.com/ruby/rubygems/commit/9b08921212

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 06:23:48 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 412fc158b2 [ruby/rubygems] Run the specs that the flat layout made work in ruby core
Since https://github.com/ruby/ruby/commit/4eb711b8e92, spec subprocesses load the in-development Bundler from lib upstream as well, so these examples no longer depend on ruby core having lib in $LOAD_PATH.

https://github.com/ruby/rubygems/commit/1ab7acd331

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 06:23:48 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 dc65216a5b [ruby/rubygems] Fix the extension caching spec with dSYM bundles
Ruby built from source on macOS runs dsymutil on every extension, and the recursive glob matched both the .dSYM directory and the files inside it, so rm_r failed on entries it had already removed. This was the unknown failure that made the spec skipped in ruby core.

https://github.com/ruby/rubygems/commit/bee3cf9694

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 06:23:47 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 df54b3f805 [ruby/rubygems] Run the corrupted global cache spec in ruby core
It failed only when XDG_CACHE_HOME was set, which made the global cache point outside the test home. spec_helper has cleared it since https://github.com/ruby/ruby/commit/773786415e3.

https://github.com/ruby/rubygems/commit/01d70d0119

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 06:23:47 +00:00
Samuel Williams 5b6f593531 Introduce (internal) IO::Buffer::Storage and Slice. (#19186) 2026-10-03 10:46:24 +13:00
Samuel Williams 3c01c256ce Add IO::Buffer#advance. (#19122) 2026-10-02 14:58:52 +13:00
Hiroshi SHIBATAandClaude Opus 5.5 79b4ef8252 [ruby/rubygems] Look up gemspecs within the sparse_checkout directories by default
Gemspecs outside the cone are never checked out, so a sparse_checkout without glob made users repeat the directory in both options.

https://github.com/ruby/rubygems/commit/110bdab9ba

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 04:48:40 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 beb93270c5 [ruby/rubygems] Accept an array of directories for sparse_checkout
A gem in a monorepo can need a sibling directory besides its own, and git takes several cone directories. Values that are not directory names now raise a Gemfile error instead of a TypeError from computing the install path.

https://github.com/ruby/rubygems/commit/9a2fae7b06

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 04:48:40 +00:00
Hiroshi SHIBATAandClaude Opus 5.5 ebe78435a1 [ruby/rubygems] Enable sparse-checkout cone mode on git before 2.35
`git sparse-checkout set` only learned --cone in git 2.35. Older versions take it as a pattern and fall back to non-cone matching, which drops the top-level files a cone checkout keeps.

https://github.com/ruby/rubygems/commit/5c8945d7df

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 04:48:39 +00:00