summaryrefslogtreecommitdiff
path: root/test/rubygems
AgeCommit message (Collapse)Author
13 days[ruby/rubygems] Bump the rb-sys group across 2 directories with 1 updatedependabot[bot]
Bumps the rb-sys group with 1 update in the /test/rubygems/test_gem_ext_cargo_builder/custom_name/ext/custom_name_lib directory: [rb-sys](https://github.com/oxidize-rb/rb-sys). Bumps the rb-sys group with 1 update in the /test/rubygems/test_gem_ext_cargo_builder/rust_ruby_example directory: [rb-sys](https://github.com/oxidize-rb/rb-sys). Updates `rb-sys` from 0.9.117 to 0.9.123 - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.117...v0.9.123) Updates `rb-sys` from 0.9.117 to 0.9.123 - [Release notes](https://github.com/oxidize-rb/rb-sys/releases) - [Commits](https://github.com/oxidize-rb/rb-sys/compare/v0.9.117...v0.9.123) --- updated-dependencies: - dependency-name: rb-sys dependency-version: 0.9.123 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rb-sys - dependency-name: rb-sys dependency-version: 0.9.123 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: rb-sys ... Signed-off-by: dependabot[bot] <support@github.com> https://github.com/ruby/rubygems/commit/551c665b6b
2025-12-26[ruby/rubygems] Write gem files atomicallyeileencodes
This change updates `write_binary` to use a new class, `AtomicFileWriter.open` to write the gem's files. This implementation is borrowed from Active Support's [`atomic_write`](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/core_ext/file/atomic.rb). Atomic write will write the files to a temporary file and then once created, sets permissions and renames the file. If the file is corrupted - ie on failed download, an error occurs, or for some other reason, the real file will not be created. The changes made here make `verify_gz` obsolete, we don't need to verify it if we have successfully created the file atomically. If it exists, it is not corrupt. If it is corrupt, the file won't exist on disk. While writing tests for this functionality I replaced the `RemoteFetcher` stub with `FakeFetcher` except for where we really do need to overwrite the `RemoteFetcher`. The new test implementation is much clearer on what it's trying to accomplish versus the prior test implementation. https://github.com/ruby/rubygems/commit/0cd4b54291
2025-12-24Fix a fragile testNobuyoshi Nakada
`Dir.mktmpdir` concatenates a random base-36 number separated by "-", so may generate pathnames containing "-j2".
2025-12-23Fix a fragile testNobuyoshi Nakada
`Dir.mktmpdir` concatenates a random base-36 number separated by "-", so may generate pathnames containing "-j4".
2025-12-23Merge RubyGems 4.0.3 and Bundler 4.0.3Hiroshi SHIBATA
2025-12-20Fix a fragile testNobuyoshi Nakada
`Dir.mktmpdir` concatenates a random base-36 number separated by "-", so may generate pathnames containing "-j4".
2025-12-17Bundle RubyGems 4.0.2 and Bundler 4.0.2Hiroshi SHIBATA
2025-12-16[ruby/rubygems] Added assertion for Windows and nmakeHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/be5c4e27d9
2025-12-16[ruby/rubygems] Reset MAKEFLAGS option for build jobs testsHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/09e6031a11
2025-12-16[ruby/rubygems] Allow to specify the number of `make` jobs when installing gems:Edouard CHIN
- Added a new `-j` option to `gem install` and `gem update`. This option allows to specify the number of jobs we pass to `make` when compiling gem with native extensions. By default its the number of processors, but users may want a way to control this. You can use it like so: `gem install json -j8` https://github.com/ruby/rubygems/commit/67aad88ca6
2025-12-15[ruby/rubygems] Write gem files atomicallyeileencodes
This change updates `write_binary` to use a new class, `AtomicFileWriter.open` to write the gem's files. This implementation is borrowed from Active Support's [`atomic_write`](https://github.com/rails/rails/blob/main/activesupport/lib/active_support/core_ext/file/atomic.rb). Atomic write will write the files to a temporary file and then once created, sets permissions and renames the file. If the file is corrupted - ie on failed download, an error occurs, or for some other reason, the real file will not be created. The changes made here make `verify_gz` obsolete, we don't need to verify it if we have successfully created the file atomically. If it exists, it is not corrupt. If it is corrupt, the file won't exist on disk. While writing tests for this functionality I replaced the `RemoteFetcher` stub with `FakeFetcher` except for where we really do need to overwrite the `RemoteFetcher`. The new test implementation is much clearer on what it's trying to accomplish versus the prior test implementation. https://github.com/ruby/rubygems/commit/0cd4b54291
2025-12-08[ruby/rubygems] Extract and generate only bundler bin files instead of full ↵Hiroshi SHIBATA
installation. https://github.com/ruby/rubygems/commit/a70e573973
2025-12-04[ruby/rubygems] Increase connection pool to allow for up to 70% speed increase:Edouard CHIN
- ### TL;DR Bundler is heavily limited by the connection pool which manages a single connection. By increasing the number of connection, we can drastiscally speed up the installation process when many gems need to be downloaded and installed. ### Benchmark There are various factors that are hard to control such as compilation time and network speed but after dozens of tests I can consistently get aroud 70% speed increase when downloading and installing 472 gems, most having no native extensions (on purpose). ``` # Before bundle install 28.60s user 12.70s system 179% cpu 23.014 total # After bundle install 30.09s user 15.90s system 281% cpu 16.317 total ``` You can find on this gist how this was benchmarked and the Gemfile used https://gist.github.com/Edouard-chin/c8e39148c0cdf324dae827716fbe24a0 ### Context A while ago in #869, Aaron introduced a connection pool which greatly improved Bundler speed. It was noted in the PR description that managing one connection was already good enough and it wasn't clear whether we needed more connections. Aaron also had the intuition that we may need to increase the pool for downloading gems and he was right. > We need to study how RubyGems uses connections and make a decision > based on request usage (e.g. only use one connection for many small > requests like bundler API, and maybe many connections for > downloading gems) When bundler downloads and installs gem in parallel https://github.com/ruby/rubygems/blob/4f85e02fdd89ee28852722dfed42a13c9f5c9193/bundler/lib/bundler/installer/parallel_installer.rb#L128 most threads have to wait for the only connection in the pool to be available which is not efficient. ### Solution This commit modifies the pool size for the fetcher that Bundler uses. RubyGems fetcher will continue to use a single connection. The bundler fetcher is used in 2 places. 1. When downloading gems https://github.com/ruby/rubygems/blob/4f85e02fdd89ee28852722dfed42a13c9f5c9193/bundler/lib/bundler/source/rubygems.rb#L481-L484 2. When grabing the index (not the compact index) using the `bundle install --full-index` flag. https://github.com/ruby/rubygems/blob/4f85e02fdd89ee28852722dfed42a13c9f5c9193/bundler/lib/bundler/fetcher/index.rb#L9 Having more connections in 2) is not any useful but tweaking the size based on where the fetcher is used is a bit tricky so I opted to modify it at the class level. I fiddle with the pool size and found that 5 seems to be the sweet spot at least for my environment. https://github.com/ruby/rubygems/commit/6063fd9963
2025-11-21[ruby/rubygems] Undeprecate Gem::Version#<=> against stringsJean Boussier
This pattern is extremely common across the ecosystem, I don't think it's reasonable to deprecate it. I understand the performance argument, but perhaps the dependency resolution algorithm can use another method that is private API and only works with two `Version` instance. https://github.com/ruby/rubygems/commit/024b4b547a
2025-11-21[ruby/rubygems] bin/rubocop -aHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/fbf6fb667e
2025-11-21Use assert_match for uplevel optionHiroshi SHIBATA
2025-11-21[ruby/rubygems] Respect `BUNDLE_VERSION` config at Gem::BundlerVersionFinderHiroshi SHIBATA
If we use "system" variable in BUNDLE_VERSION on Bundler configuration, we can use bundler version provided by system installation. But the current logic returns the first activated version of bundler like 2.7.2. It makes to confuse users. https://github.com/ruby/rubygems/commit/4eb66d9549
2025-11-21[ruby/rubygems] Deprecate comparing Gem::Version objects with stringsAaron Patterson
Comparing version objects is a huge bottleneck in dependency solvers (like inside Bundler). I would like to make comparing version objects cheaper. Right now we support comparing version objects with strings by trying to coerce the string to a version. So for example: ```ruby Gem::Version.new("1") <=> "12" ``` I would like to deprecate and remove support for this feature so that we can reduce the overhead of `def <=>`. I'm not sure what version of RubyGems we could remove this from though. https://github.com/ruby/rubygems/commit/81b7602183
2025-11-19[ruby/rubygems] Handle BUNDLER_VERSION being set to an empty stringCody Cutrer
This is useful, in case you're using Docker, and an upstream Dockerfile sets BUNDLER_VERSION to something you don't want. It's impossible to unset it... only override to be the empty string. https://github.com/ruby/rubygems/commit/ffa3eb9ac6
2025-11-18[ruby/rubygems] Undeprecate `Gem::Version.new(nil)`Aaron Patterson
It seems like we were trying to deprecate passing `nil` to Gem::Version.new. This breaks existing code, and I don't think there is a good reason to deprecate this usage. I believe what we want to prevent is the following code: ```ruby Gem::Specification.new do |spec| spec.version = nil # suddenly the spec version is 0! p spec.version end ``` This commit allows people to manually construct `Gem::Version.new(nil)`, but when someone assigns `nil` as the Gem specification version, it sets the spec version to `nil` (making the specification invalid). People who manually construct `Gem::Version` objects and use nil should be allowed to do it, and `Gem::Version.new(nil) == Gem::Version.new("0")`, but people who assign `nil` in a gemspec will get an invalid gemspec. I think deprecation started [here](https://github.com/ruby/rubygems/pull/2203) but there doesn't seem to be a reason to do it. Fixes https://github.com/ruby/rubygems/pull/9052 https://github.com/ruby/rubygems/commit/ded5e909c2
2025-11-18[ruby/rubygems] Removed deprecated -C option from gem buildHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/3471646d43
2025-11-14[ruby/rubygems] Removed deprecated Gem::Specification#has_rdoc, has_rdoc= ↵Hiroshi SHIBATA
and has_rdoc? https://github.com/ruby/rubygems/commit/b043538576
2025-11-14[ruby/rubygems] Add pattern matching support to Gem::NameTupleBrandon Weaver
https://github.com/ruby/rubygems/commit/9b19e1f555
2025-11-14[ruby/rubygems] Removed files for `gem query`Hiroshi SHIBATA
https://github.com/ruby/rubygems/commit/de269cfbb6
2025-11-14[ruby/rubygems] Removed deprecated ↵Hiroshi SHIBATA
Gem::DependencyInstaller#find_gems_with_sources https://github.com/ruby/rubygems/commit/1b3f3bf194
2025-11-14[ruby/rubygems] Removed deprecated Gem::Util.silent_systemHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/728269cc4a
2025-11-14[ruby/rubygems] Removed deprecated Gem::Platform.matchHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/f4b4f12f91
2025-11-14[ruby/rubygems] Removed deprecated Gem::Installer#unpackHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/96cef34041
2025-11-14[ruby/rubygems] bin/rubocop -a --only Style/RedundantParenthesesHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/be3b09c786
2025-11-14[ruby/rubygems] Use `method_defined?` instead of `instance_methods.include?`Nobuyoshi Nakada
While the latter creates an intermediate array of all method names including all ancestors, the former just traverse the inheritance chain and can stop if found once. https://github.com/ruby/rubygems/commit/b291070b3b
2025-11-13[ruby/rubygems] Fixed with Performance/RegexpMatch copHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/93b8492bc0
2025-11-13Ractor support Windows platform. We need to skip only failing tests of RubyGemsHiroshi SHIBATA
2025-11-12[ruby/rubygems] Re-use assert_headers_equal from Gem::Package::TarTestCaseHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/0cf49e22af
2025-11-12[ruby/rubygems] Add pattern matching support to Gem::PlatformBrandon Weaver
https://github.com/ruby/rubygems/commit/b59917447c
2025-11-12Make alias `Ractor#value` only if undefinedNobuyoshi Nakada
`Ractor#value` replaces `Ractor#take`; if the former is defined the latter is undefined, and vice versa.
2025-11-12[ruby/rubygems] Workaround for test failure of ruby_3_4 branchHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/d7bc3a6d82
2025-11-12[ruby/rubygems] Support ruby_3_4 branch with assert_ractor argumentHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/da0a14801a
2025-11-12[ruby/rubygems] Inject assert_ractor if TestGemPackageTarHeaderRactor is ↵Hiroshi SHIBATA
running under the ruby/rubygems repo https://github.com/ruby/rubygems/commit/47f41ce2df
2025-11-12Split Ractor tests for Gem::PackageHiroshi SHIBATA
2025-11-12Reapply "[ruby/rubygems] Fix constants in TAR to be frozen"Hiroshi SHIBATA
This reverts commit 136157e772ab2b2ea08555d0ad821da7dc2bde96.
2025-11-10[ruby/rubygems] Make verification methods privateAaron Patterson
I would like to start making some of the methods in Gem::Package private so that we can refactor them better. Right now we have many methods that are public, and since they are public we can't refactor them. Historically, I think "private" methods have just been tagged with :nodoc:, but I would like to be more strict about our APIs https://github.com/ruby/rubygems/commit/fb352e9176
2025-11-04Revert "[ruby/rubygems] Fix constants in TAR to be frozen"Hiroshi SHIBATA
This reverts commit 2c2eaa3103e5cf1cbfc2b16d9db975a9b8a0399a.
2025-11-04[ruby/rubygems] Fix constants in TAR to be frozenAaron Patterson
I would like to use the tar implementation inside a Ractor, but two of the constants are not frozen. This patch freezes the constants so we can use it in a Ractor. https://github.com/ruby/rubygems/commit/0ff4790f4c
2025-11-04[ruby/rubygems] Remove open-ended and prerelease dependency warnings when ↵Jeremy Evans
building gems In general, rubygems should provide mechanism and not policy. Pessimistic versioning is not universally better, and in many cases, it can cause more problems than it solves. Rubygems should not be warning against open-ended versioning when building gems. The majority of the default gems with dependencies do not use pessimistic versioning, which indicates that Ruby itself recognizes that open-ended versioning is generally better. In some cases, depending on a prerelease gem is the only choice other than not releasing a gem. If you are building an extension gem for a feature in a prerelease version of another gem, then depending on the prerelease version is the only way to ensure a compatible dependency is installed. https://github.com/ruby/rubygems/commit/beba8dd065
2025-10-28[ruby/rubygems] Added install_default_gem method for testingHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/81dbd42abf
2025-10-28[ruby/rubygems] Completely removed install_as_default featureHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/15e46a3a68
2025-10-23[ruby/rubygems] Removed credential assertion from stdoutHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/3946be008c
2025-10-20[ruby/rubygems] Now ruby/rubygems is the canonical repository urlHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/c637007e91
2025-10-17[rubygems/rubygems] :Revamp CmakeBuilder to fix the issues described in ↵Charlie Savage
#8572. Specifically: * Correctly pass command line arguments to CMake * Call CMake twice - once to configure a project and a second time to build (which is the standard way to use CMake). This fixes the previously incorrect assumption that CMake generates a Make file. * Update the tests to specify a CMake minimum version of 3.26 (which is already two years old). 3.26 is a bit arbritary but it aligns with Rice, and updates from the ancient 3.5 version being used (which CMake generates a warning message saying stop using it!) * Update the CMake call to use CMAKE_RUNTIME_OUTPUT_DIRECTORY and CMAKE_LIBRARY_OUTPUT_DIRECTORY to tell CMake to copy compiled binaries to the a Gem's lib directory. Note the updated builder took inspiration from the Cargo Builder, meaning you first create an instance of CmakeBuilder versus just calling class methods. https://github.com/rubygems/rubygems/commit/9e248d4679
2025-09-11Revert "test_gem_command_manager.rb.Hiroshi SHIBATA
This reverts commit 8aa885c460aeb70878538eebdd155c6318989fd2 and cd07c3cbae7e287350d713ead237aeef27cc2b9e.