summaryrefslogtreecommitdiff
path: root/spec/bundler/support/builders.rb
AgeCommit message (Collapse)Author
2026-02-09Merge RubyGems/Bundler 4.0.5Hiroshi SHIBATA
2025-11-20[ruby/rubygems] Improve error messages and handling in testseileencodes
This is a first pass to improve the way errors are handled and raised in bundler's tests. The goal is to clean up tests and modernize them - these were some obvious areas that could be cleaned up. - Instead of raising "ZOMG" in the load error tests, it now tests for the actual error and gem raising. - Improve error messages where applicable. - All errors raise a specific error class, rather than falling back to a default and just setting a message. - Removed arguments and `bundle_dir` option from `TheBundle` class as it wasn't actually used so therefore we don't need to raise an error for extra arguments. - Removed error from `BundlerBuilder`, as it won't work if it's not `bundler`, also it never uses `name`. The only reaon `name` is passed in is because of metaprogramming on loading the right builder. I think that should eventually be refactored. - Replaced and removed `update_repo3` and `update_repo4` in favor of just `build_repo3` and `build_repo4`. Rather than tell someone writing tests to use a different method, automatically use the right method. https://github.com/ruby/rubygems/commit/68c39c8451
2025-11-14[ruby/rubygems] Suppress gem build message of bundler like this:Hiroshi SHIBATA
``` $ rake spec:regular Successfully built RubyGem Name: bundler Version: 4.0.0.dev File: bundler-4.0.0.dev.gem ``` https://github.com/ruby/rubygems/commit/8f0ca5eefa
2025-11-12[ruby/rubygems] Shell out fewer timesAaron Patterson
This is a follow up to #9053. We can avoid shelling out for generating the gem index. https://github.com/ruby/rubygems/commit/e40bafe9f1
2025-11-11Support out-of-place build in ruby/ruby repoHiroshi SHIBATA
2025-11-11[ruby/rubygems] Use Spec::Path.relative_gemspecHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/2142e405b0
2025-11-11[ruby/rubygems] build gems directly instead of shelling outAaron Patterson
I'm trying to speed up the bundler tests. The tests shell out a lot in order to build gems. We can build gems without creating a sub-process. This change reduced the test suite time from ~24 minutes, to about ~21 minutes on my machine. Once we have more of these "asset generation" routines done in the same process, I think we can start caching the outputs for further improvements https://github.com/ruby/rubygems/commit/ebf27056c6
2025-11-07[ruby/rubygems] Replace Pathname#rmtree to FileUtils.rm_rf directlyHiroshi SHIBATA
https://github.com/ruby/rubygems/commit/33c7a9a565
2025-07-25[rubygems/rubygems] Don't create an empty `tmp/2.1` directory when running ↵David Rodríguez
spec:deps task https://github.com/rubygems/rubygems/commit/3189d3e49b
2025-07-03Sync RubyGemsDavid Rodríguez
2025-07-02[rubygems/rubygems] Rename some helpers to avoid name classesDavid Rodríguez
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. https://github.com/rubygems/rubygems/commit/714c209e62
2025-06-03Remove hardcoded version of rake from Bundler testsDavid Rodríguez
Let them run against the version resolved by the `test_gems.rb` gemfile. This should fix ruby-core CI job that was broken by the release of rake 13.3.0.
2025-06-03[rubygems/rubygems] Partially phase out x64-mingw32 in favour of ↵Nicholas La Roux
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 https://github.com/rubygems/rubygems/commit/b9d871022e
2025-05-31Update bundled gems list as of 2025-05-31git
2025-05-31rake 13.3.0 -> 13.2.1Koichi Sasada
`make test-bundler-parallel` prints many errors, so try to downgrade rake version. ``` 219) bundle install --standalone run in a subdirectory with --binstubs creates stubs that can be symlinked Failure/Error: raise <<~ERROR #{error_header} ---------------------------------------------------------------------- #{stdboth} ---------------------------------------------------------------------- ERROR RuntimeError: Commands: $ /home/ko1/ruby/build/trunk/ruby -I/home/ko1/ruby/src/trunk/spec/bundler -r/home/ko1/ruby/src/trunk/spec/bundler/support/artifice/compact_index.rb -r/home/ko1/ruby/src/trunk/spec/bundler/support/hax.rb /home/ko1/ruby/src/trunk/tmp/2.13/gems/system/bin/bundle config set --local path /home/ko1/ruby/src/trunk/tmp/2.13/bundled_app/bundle # $? => 0 Invoking `/home/ko1/ruby/build/trunk/ruby -I/home/ko1/ruby/src/trunk/spec/bundler -r/home/ko1/ruby/src/trunk/spec/bundler/support/artifice/compact_index.rb -r/home/ko1/ruby/src/trunk/spec/bundler/support/hax.rb /home/ko1/ruby/src/trunk/tmp/2.13/gems/system/bin/bundle install --standalone --binstubs` failed with output: ---------------------------------------------------------------------- [DEPRECATED] The --binstubs option will be removed in favor of `bundle binstubs --all` Could not find compatible versions Because every version of rails depends on rake = 13.3.0 and rake = 13.3.0 could not be found in rubygems repository https://gem.repo1/ or installed locally, rails cannot be used. So, because Gemfile depends on rails >= 0, version solving has failed. Fetching gem metadata from https://gem.repo1/... Resolving dependencies... ---------------------------------------------------------------------- Shared Example Group: "bundle install --standalone" called from ./spec/bundler/install/gems/standalone_spec.rb:532 # /home/ko1/ruby/src/trunk/spec/bundler/support/command_execution.rb:26:in 'Spec::CommandExecution#raise_error!' # /home/ko1/ruby/src/trunk/spec/bundler/support/subprocess.rb:66:in 'Spec::Subprocess#sh' # /home/ko1/ruby/src/trunk/spec/bundler/support/helpers.rb:216:in 'Spec::Helpers#sys_exec' # /home/ko1/ruby/src/trunk/spec/bundler/support/helpers.rb:107:in 'Spec::Helpers#bundle' # /home/ko1/ruby/src/trunk/spec/bundler/install/gems/standalone_spec.rb:482:in 'block (3 levels) in <top (required)>' # /home/ko1/ruby/src/trunk/spec/bundler/spec_helper.rb:107:in 'block (4 levels) in <top (required)>' # /home/ko1/ruby/src/trunk/spec/bundler/spec_helper.rb:107:in 'block (3 levels) in <top (required)>' # /home/ko1/ruby/src/trunk/spec/bundler/support/helpers.rb:355:in 'block in Spec::Helpers#with_gem_path_as' # /home/ko1/ruby/src/trunk/spec/bundler/support/helpers.rb:369:in 'Spec::Helpers#without_env_side_effects' # /home/ko1/ruby/src/trunk/spec/bundler/support/helpers.rb:350:in 'Spec::Helpers#with_gem_path_as' # /home/ko1/ruby/src/trunk/spec/bundler/spec_helper.rb:106:in 'block (2 levels) in <top (required)>' ``` Notes: Merged: https://github.com/ruby/ruby/pull/13483
2025-05-30Update bundled gems list as of 2025-05-30git
2025-05-19[rubygems/rubygems] Test JRuby 10David Rodríguez
Necessary changes to get tests passing are: * Rewrite one "out of memory" error spec to not define a subclass inside a RSpec context block. Due to some [JRuby issue], that's failing in JRuby 10, so I rewrote the test so that the Bundler process really goes OOM and that class definition is not necessary. * JRuby 10, even if Ruby 3.4-compatible, has not yet adapted backtraces to include receivers, so our tests need an special case for JRuby when detecting a test method call inside backtraces. * Warbler test is upgraded to use JRuby 10. Getting it to pass needs [a PR] to warbler, so our test is temporarily pointing to that PR. [JRuby issue]: https://github.com/jruby/jruby/issues/8838 [a PR]: https://github.com/jruby/warbler/pull/557 https://github.com/rubygems/rubygems/commit/edec85d4c3
2025-04-10Sync Bundler and adapt to new spec setupDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/13083
2025-03-12[rubygems/rubygems] Refactor specs to not try to remove folders that don't existDavid Rodríguez
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. https://github.com/rubygems/rubygems/commit/ed430883e0
2025-03-10[rubygems/rubygems] Adapt specs to extraction of irb from ruby-coreDavid Rodríguez
This gets our daily Bundler CI back to green. https://github.com/rubygems/rubygems/commit/1bb70f75d2 Notes: Merged: https://github.com/ruby/ruby/pull/12890
2025-02-21[rubygems/rubygems] bin/rubocop -a --only Style/MultipleComparisonHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/677e17aa2e
2025-02-19[rubygems/rubygems] Make sure empty gems are not reinstalled every timeDavid Rodríguez
Unfortunately this requires reverting a previous enhancement of reinstalling gems if they incorrectly ship with an empty installation dir. However, there's no way to distinguish this kind of bad state from a gem that's empty for real, for example, sorbet-static-and-runtime. This reverts commit https://github.com/rubygems/rubygems/commit/9720a9b980d2, and adds a spec to make sure empty gems are not reinstalled every time. https://github.com/rubygems/rubygems/commit/7c102394af
2025-02-19[rubygems/rubygems] Don't add gemspec to specification list of our test gemsDavid Rodríguez
Real gems hardly ever do this, so don't do it ourselves for testing either. https://github.com/rubygems/rubygems/commit/2c8960cfb4
2025-01-28[rubygems/rubygems] Support installing arm native gems on WindowsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/96496e3f53 Co-authored-by: Johnny Shields <johnny.shields@gmail.com>
2024-11-21[rubygems/rubygems] Explicitly load build_metadata.rb because ↵Hiroshi SHIBATA
Spec::BuildMetadata is only called from BundlerBuilder. The current code is broken to call Spec::Builders#build_* method directly. https://github.com/rubygems/rubygems/commit/4922ae40dd
2024-11-14[rubygems/rubygems] Fix `bin/rake spec:all` taskDavid Rodríguez
Only in CI, if two different test runs are started (like `bin/rake spec:all` does), the second one would not install the dev version of Bundler and would fail to start. This commit makes it work the same locally and in CI. https://github.com/rubygems/rubygems/commit/7a5ca6c40f
2024-11-14[rubygems/rubygems] I don't see how this could happenDavid Rodríguez
https://github.com/rubygems/rubygems/commit/8b6f9b7f05
2024-10-10[rubygems/rubygems] Fix warnings about old C styleDavid Rodríguez
https://github.com/rubygems/rubygems/commit/f40610b699
2024-09-20[rubygems/rubygems] I don't think we need a conditional shebangDavid Rodríguez
https://github.com/rubygems/rubygems/commit/7ba7073a35
2024-09-20[rubygems/rubygems] Fix RubyGems warnings about missing shebangDavid Rodríguez
https://github.com/rubygems/rubygems/commit/362c960497
2024-09-20[rubygems/rubygems] Fix RubyGems warnings about incorrect executable permissionsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/92dcf60fc1
2024-09-20[rubygems/rubygems] Fix RubyGems warnings about minimum required RubyDavid Rodríguez
https://github.com/rubygems/rubygems/commit/8f262f3a47
2024-08-05[rubygems/rubygems] Extract a `build_repo3` helperDavid Rodríguez
https://github.com/rubygems/rubygems/commit/d8cf4aa0cd
2024-07-26[rubygems/rubygems] Make all tests still pass when switching from ↵David Rodríguez
truffleruby to cruby https://github.com/rubygems/rubygems/commit/4f3d9fa3bf
2024-07-23[rubygems/rubygems] Extract a `rake_path` helperDavid Rodríguez
https://github.com/rubygems/rubygems/commit/0f2db73619
2024-07-18[rubygems/rubygems] Ext is generally not in `require_paths`David Rodríguez
https://github.com/rubygems/rubygems/commit/83b417a166
2024-07-18[rubygems/rubygems] Use `caller_locations` instead of splitting `caller`Nobuyoshi Nakada
Also limit caller ranges https://github.com/rubygems/rubygems/commit/a274b1af78
2024-07-18[rubygems/rubygems] Fix detection of `gem_repo1` being updatedDavid Rodríguez
https://github.com/rubygems/rubygems/commit/9f9493c77c
2024-07-09[rubygems/rubygems] Minor Bundler spec improvementsDavid Rodríguez
While working on something else I noticed: * Usage of uppercased "RUBY" and "JAVA" as platforms, when those don't really exist. * Usage of some test gems with "1.0" as gemspec version and "1.0.0" as actual version. This commit fixes both inconsistencies to make things more expectable. https://github.com/rubygems/rubygems/commit/e3ec32e247
2024-06-28Synchronize Bundler & RubyGems (#11071)David Rodríguez
2024-06-28[rubygems/rubygems] Avoid concurrent builds of Bundler when running specsDavid Rodriguez
Instead, build it during setup when in CI. This should avoid some Windows specific test failures when Bundler copies the same files from multiple processes and runs into EACESS errors. https://github.com/rubygems/rubygems/commit/c194a1d753
2024-05-03[rubygems/rubygems] Remove `Gem::Specification#mark_version`David Rodriguez
This gets in the middle if we ever start allowing to build as if using a different RubyGems version than the one being run. This could be useful to make `gem rebuild` a little more usable, and it's already done by Bundler specs which already make this method a noop when they need this. I'm not sure forcefully setting this, even if user explicitly specified something else is helpful. Since this could potentially prevent gems explicitly setting a constant RubyGems version from building, I changed the error of incorrect RubyGems version from a hard error to a warning, since it will start happening in those cases if we stop overwriting the version. https://github.com/rubygems/rubygems/commit/45676af80d
2024-04-05Use rake-13.2.1Hiroshi SHIBATA
2024-04-02Use Rake 13.2.0Hiroshi SHIBATA
2024-02-19[rubygems/rubygems] Use FileUtils.mkdir_pHiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/af806b8dff
2024-02-16Avoid to fail with race conditionHiroshi SHIBATA
2024-02-02[rubygems/rubygems] Add missing Windows jobDavid Rodriguez
Specs that use extension gems were failing in the new job but I noticed that they were using very non standard `extconf.rb` files. The hack being removed here was added just to make specs pass when run in ruby-core but it seems the underlying issue has been fixed now, and it's causing issues with Ruby 3.3 and Windows, so necessary so I'm removing it and moving on. https://github.com/rubygems/rubygems/commit/5b78275f0e
2023-12-22Merge RubyGems-3.5.2 and Bundler-2.5.2Hiroshi SHIBATA
2023-12-12[rubygems/rubygems] Bump rake version used by testsDavid Rodríguez
And make it easier to update next time. https://github.com/rubygems/rubygems/commit/1ea4bfa5d8
2023-12-08[rubygems/rubygems] Extract generate_index command to ↵Samuel Giddins
rubygems-generate_index gem So generate_index can be implemented with dependencies, such as the compact index Took this approach from feedback in https://github.com/rubygems/rubygems/pull/6853 Running `gem generate_index` by default will use an installed rubygems-generate_index, or install and then use the command from the gem Apply suggestions from code review https://github.com/rubygems/rubygems/commit/fc1cb9bc9e Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org>