summaryrefslogtreecommitdiff
path: root/spec/bundler/commands
AgeCommit message (Collapse)Author
2023-03-28[rubygems/rubygems] Fix unnecessary downgrade of top level dependency when ↵David Rodríguez
unlocking Bundler is very conservative by default, trying to preserve versions from the lockfile as possible, and never downgrading them. However, when it runs into a resolution error, it still tries to find a valid resolution. This fallback behavior was too "brute-force" though, completely unrestricting any gem found in the resolution conflict, and that could lead to direct dependencies being downgraded in some edge cases. Instead, unlock things a bit more carefully: * First try unlocking fully pinned indirect dependencies, but leave a lower bound requirement in place to prevent downgrades. * Then try unlocking any fully pinned dependency, also leaving a lower bound requirement in place. * Finally completely unrestrict dependencies if nothing else worked. https://github.com/rubygems/rubygems/commit/7f55ed8302
2023-03-22[rubygems/rubygems] Use indented heredocNobuyoshi Nakada
https://github.com/rubygems/rubygems/commit/085d2776d8
2023-03-17When running `bundle lock --update <name>`, checkout locked revision of ↵David Rodríguez
unrelated git sources directly Since Bundler 2.4, we will try to checkout any branch specified in the Gemfile, while until Bundler 2.3 we would directly checkout the locked revision. This should not make any difference in most situations, but in some edge cases, like if the branch specified in the `Gemfile` has been renamed, but the locked revision still exist, it causes an error now while before it would update the lockfile without issues. I debated which behavior was best, since I was not sure. But my conclusion is that if the situation does not require expiring the lockfile source in favor of the Gemfile source, we should use the locked revision directly and proceed happily. So I restored Bundler 2.3 behavior. I think this is consistent with how yanked gems are handled, for example. Of course, if explicitly updating the git source itself, or all gems, we will still get any errors like missing branches related to the git source.
2023-03-17Don´t consider platform specific candidates when `force_ruby_platform` setDavid Rodríguez
This was working fine for direct dependencies using `force_ruby_platform` explicitly through Gemfile, but not for indirect dependencies. In general, indirect dependencies do not have this property set, but in truffleruby this is different and the default value is to have it set.
2023-03-17Don't ignore pre-releases when there's only one candidateDavid Rodríguez
This should be a very rare edge case, however, it does happen when using a .dev version of Bundler because in that case, that's the only version that the resolver considers, and it should not be ignored. We could've special cased this specifically for Bundler, but I think it does make sense for every gem.
2023-03-17Normalize git sourcesDavid Rodríguez
Just like gem sources, a "style-only" change, like adding a trailing slash, should not expire them.
2023-03-17[rubygems/rubygems] Remove unnecessary `specific_local_platform` test helperDavid Rodríguez
https://github.com/rubygems/rubygems/commit/86b574824d
2023-03-17[rubygems/rubygems] Remove unnecessary `local` helperDavid Rodríguez
https://github.com/rubygems/rubygems/commit/27ed6870ce
2023-03-17[rubygems/rubygems] Use more common linux platform for specsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/3841a58095
2023-03-10[rubygems/rubygems] Use `RbSys::ExtensionTask` when creating new rust gemsIan Ker-Seymer
https://github.com/rubygems/rubygems/commit/125f9fece9
2023-03-07[rubygems/rubygems] Better suggestion when `bundler/setup` fails due to ↵David Rodríguez
missing gems If the original `BUNDLE_GEMFILE` is different from the default, then the suggestion wouldn't work as is. Before: ``` $ util/rubocop Could not find rubocop-1.30.1 in locally installed gems Run `bundle install` to install missing gems. $ rubygems git:(better-cmd-suggestion) ✗ bundle install Could not locate Gemfile ``` After: ``` $ util/rubocop Could not find rubocop-1.30.1 in locally installed gems Run `bundle install --gemfile /path/to/rubygems/bundler/tool/bundler/lint_gems.rb` to install missing gems. $ bundle install --gemfile /path/to/rubygems/bundler/tool/bundler/lint_gems.rb Fetching gem metadata from https://rubygems.org/......... Using ast 2.4.2 Using bundler 2.4.7 Using parser 3.1.2.0 Using rainbow 3.1.1 Using parallel 1.22.1 Using regexp_parser 2.5.0 Using rubocop-ast 1.18.0 Using rexml 3.2.5 Using ruby-progressbar 1.11.0 Using unicode-display_width 2.1.0 Fetching rubocop 1.30.1 Installing rubocop 1.30.1 Using rubocop-performance 1.14.2 Bundle complete! 2 Gemfile dependencies, 12 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. $ util/rubocop Inspecting 345 files ......................................................................................................................................................................................................................................................................................................................................................... 345 files inspected, no offenses detected ``` https://github.com/rubygems/rubygems/commit/bf1320d805
2023-03-03[rubygems/rubygems] Alias CurrentRuby#mswin?, mswin64?, mingw?, x64_mingw? ↵johnnyshields
to #windows?. (This is done instead of logging a deprecation warning.) https://github.com/rubygems/rubygems/commit/b9fcc7c0ab
2023-03-02[rubygems/rubygems] Replace lockfile with `.locked`Tony Hsu
https://github.com/rubygems/rubygems/commit/203f3e3802
2023-02-21Merge rubygems/bundler masterHiroshi SHIBATA
Pick from https://github.com/rubygems/rubygems/commit/e9304aed7e43308b99e70c2f7b92028315fee8a5 Notes: Merged: https://github.com/ruby/ruby/pull/7345
2023-02-21[rubygems/rubygems] Fix crash in pub grub involving empty rangesDavid Rodríguez
https://github.com/rubygems/rubygems/commit/0f168516f7 Notes: Merged: https://github.com/ruby/ruby/pull/7345
2023-02-21[rubygems/rubygems] Update pub_grubJohn Hawthorn
* Replaces the wording of "is forbidden" with "cannot be used" * Fixes the method signature of VersionRange::Empty#eql? https://github.com/rubygems/rubygems/commit/8c6b3f130b Co-authored-by: Daniel Colson <danieljamescolson@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/7345
2023-02-06[rubygems/rubygems] Properly load the generated gemspecAkira Matsuda
The previous code loads bundler's gemspec which does not include the generated gemspec file, and thus the test was passing where it should indeed fail. With this change, the test properly fails now. https://github.com/rubygems/rubygems/commit/2098ea0d75
2023-01-31Merge RubyGems/Bundler master.Hiroshi SHIBATA
Pick from https://github.com/rubygems/rubygems/commit/5ace20dbecfeaf09fba5f616193f3cfcff70ba00 Notes: Merged: https://github.com/ruby/ruby/pull/7203
2023-01-27[rubygems/rubygems] Don't warn on bundler binstubs --standalone --allDaniel Colson
Prior to this commit `bundle binstubs --standalone --all` would output a warning about not being able to generate a standalone binstub for bundler. This warning predates the `--all` option, and I don't think it makes sense in this context. The warning makes good sense when explicitly trying to generate a bundler standalone binstub with `bundle binstubs bundler --standalone`, since that command won't do what the user might have expected. But `--all` is not specifically asking for bundler, and having it report each time that the bundler binstubs could not be generated does not seem particularly helpful. The only way to make that warning go away would be to stop using `--standalone --all`. This commit skips the warning when running with the `--all` option. https://github.com/rubygems/rubygems/commit/e6a72e19eb
2023-01-10Merge RubyGems and Bundler masterHiroshi SHIBATA
from https://github.com/rubygems/rubygems/commit/0635c1423db5d7c461d53bf0c3329bca75de7609 Notes: Merged: https://github.com/ruby/ruby/pull/7094
2023-01-10[rubygems/rubygems] Fix resolver edge caseDavid Rodríguez
Let it deal with legacy gems with equivalent version and different dependencies. https://github.com/rubygems/rubygems/commit/b430babe97
2023-01-04[rubygems/rubygems] Raise invalid option when bundle open --path is called ↵yoka
without a value https://github.com/rubygems/rubygems/commit/c242311158
2023-01-04[rubygems/rubygems] Enhance bundle open with --path optionyoka
https://github.com/rubygems/rubygems/commit/3bf8e59304
2022-12-24Merge RubyGems-3.4.0 and Bundler-2.4.0Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/6987
2022-12-20Merge RubyGems/Bundler masterHiroshi SHIBATA
Pick from https://github.com/rubygems/rubygems/commit/ba3adad4d80038ffd7bea015da2f11d3e8a2ff82 Notes: Merged: https://github.com/ruby/ruby/pull/6966
2022-12-20[rubygems/rubygems] Turn `--ext` option into string. Deprecate usage without ↵Josef Šimánek
explicit value. - this is preparation for onboarding Rust based extension gem generator https://github.com/rubygems/rubygems/commit/d32801bdbc Notes: Merged: https://github.com/ruby/ruby/pull/6966
2022-12-20[rubygems/rubygems] Fix crash when building resolution errors with OR ↵David Rodríguez
requirements https://github.com/rubygems/rubygems/commit/8f287479bc Notes: Merged: https://github.com/ruby/ruby/pull/6966
2022-12-20[rubygems/rubygems] Add tests for bundle lockMichael Siegfried
Ensure `bundle lock` handles pre flag just like bundle update does. https://github.com/rubygems/rubygems/commit/b9e85e3157 Notes: Merged: https://github.com/ruby/ruby/pull/6966
2022-12-20[rubygems/rubygems] Support for pre flag in `bundle update`Michael Siegfried
Passing this flag allows bumping to the current version, even if that version is prerelease. This works in concert with the current flags. https://github.com/rubygems/rubygems/commit/a6409e3509 Notes: Merged: https://github.com/ruby/ruby/pull/6966
2022-12-18[rubygems/rubygems] Add bundle lock --update --bundlerAlyssa Ross
bundle lock --update can do everything that bundle update can do, but it doesn't actually install gems. This is especially useful for generating a lockfile on a machine that doesn't have the libraries available to be able to build native extensions. But, there was no parallel for bundle update --bundler. So let's add one. https://github.com/rubygems/rubygems/commit/7fc00bd2a5
2022-12-12Merge RubyGems/Bundler masterHiroshi SHIBATA
from https://github.com/rubygems/rubygems/commit/bfb0ae69776069155d2092702bfbb5a12617d85a Notes: Merged: https://github.com/ruby/ruby/pull/6906
2022-12-09Merge RubyGems/Bundler masterHiroshi SHIBATA
Pick from https://github.com/rubygems/rubygems/commit/823c776d951f3c35094611473ec77f94e8bf6610 Notes: Merged: https://github.com/ruby/ruby/pull/6890
2022-11-11Merge RubyGems/Bundler master from ee2f8398324af4bc1b95f7565ce2fda98126e026v3_2_0_preview3Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/6715
2022-10-03[rubygems/rubygems] Copy template contents instead of file and permsVictor Gama
This allows the file to be created without copying permissions from Bundler's installation source. The previous behaviour was noticed after installing Ruby through brew, and using bundle init, which yielded a read-only Gemfile. https://github.com/rubygems/rubygems/commit/839a06851d
2022-09-08Resync Bundler & RubyGemsDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/6330
2022-09-05[rubygems/rubygems] Remove no longer needed `fiddle` hacksDavid Rodríguez
RubyInstaller has released patch versions backporting their changes to not load `fiddle` on boot, so all these are no longer necessary. https://github.com/rubygems/rubygems/commit/05a307deb2
2022-09-05[rubygems/rubygems] Feature: `bundle add` supports `--path` optionMike Dalessio
https://github.com/rubygems/rubygems/commit/32bee01fbe
2022-08-29[rubygems/rubygems] Add platform :windows as a shortcut for all Windows ↵shields
platforms https://github.com/rubygems/rubygems/commit/f3c49ad3f7
2022-08-23[rubygems/rubygems] Bundler: avoid use of "can not" in spec literalsTakuya Noguchi
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com> https://github.com/rubygems/rubygems/commit/73b5cf9bd1
2022-08-23[rubygems/rubygems] Fix conservative update downgrading top level gemsDavid Rodríguez
When `--conservative` is passed, explicit unlocks are set for top level gems via `@unlock[:gems]`, so that only those particular gems are allowed to be updated. When we compute the "base resolve" from the lockfile (the set of gems whose versions should be kept pinned by the resolver), we always exclude gems explicitly unlocked through `@unlock[:gems]` from it. This is done by the `converge_specs` method. However, the `converge_specs` method is also used for figuring out additional lower bound requirements from the lockfile. But in this case, even if gems are explicitly unlock in `@unlock[:gems]`, we still want to add the additional requirement, so that gems are not downgraded by the resolver. So the solution is to move the line filtering out gems in `@unlock[:gems]` from the `converged_specs` method out of that method, so that it only applies for computing the "base resolve", but not the addtional lower bound requirements. https://github.com/rubygems/rubygems/commit/405119bd7b Notes: Merged: https://github.com/ruby/ruby/pull/6268
2022-08-21[rubygems/rubygems] Fix `bundle platform` crash when there's a lockfile with ↵David Rodríguez
no Ruby locked https://github.com/rubygems/rubygems/commit/49fc54e87d
2022-08-03[rubygems/rubygems] Fix `bundle outdated --strict`David Rodríguez
It should be an alias of `--filter-strict`. `--update-strict` is essentially a dummy option with no special behavior associated and should be deprecated. https://github.com/rubygems/rubygems/commit/ec1e5d83c8
2022-08-03[rubygems/rubygems] Fix conservative updates regardless of `--strict`David Rodríguez
https://github.com/rubygems/rubygems/commit/c9a1d69a8d
2022-08-03Merge rubygems/bundler HEADHiroshi SHIBATA
Pick from https://github.com/rubygems/rubygems/commit/8331e63263081a6aa690d8025d2957f30c4e814a Notes: Merged: https://github.com/ruby/ruby/pull/6209
2022-08-01[rubygems/rubygems] Fix crash when running `bundle outdated` in debug modeDavid Rodríguez
Previously it would crash like this: ```` $ /Users/deivid/.asdf/installs/ruby/3.1.2/bin/ruby -I/Users/deivid/Code/rubygems/rubygems/bundler/spec -r/Users/deivid/Code/rubygems/rubygems/bundler/spec/support/artifice/fail.rb -r/Users/deivid/Code/rubygems/rubygems/bundler/spec/support/hax.rb /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/bin/bundle outdated --patch --strict --filter-patch Running `bundle outdated --filter-patch --patch --strict` with bundler 2.4.0.dev Found changes from the lockfile, re-resolving dependencies because bundler is unlocking Using a local server, bundler won't use the CompactIndex API Fetching source index from file:///Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/remote4/ Resolving dependencies... --- ERROR REPORT TEMPLATE ------------------------------------------------------- ``` RuntimeError: LazySpecification has not been materialized yet (calling :loaded_from []) /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/lazy_specification.rb:147:in `method_missing' /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli/outdated.rb:214:in `gem_column_for' /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli/outdated.rb:174:in `block in print_gems_table' /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli/outdated.rb:173:in `map' /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli/outdated.rb:173:in `print_gems_table' /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli/outdated.rb:123:in `run' /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli.rb:420:in `outdated' /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command' /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch' /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli.rb:31:in `dispatch' /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start' /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli.rb:25:in `start' /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/exe/bundle:48:in `block in <top (required)>' /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors' /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/exe/bundle:36:in `<top (required)>' /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/bin/bundle:25:in `load' /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/bin/bundle:25:in `<main>' ``` ```` https://github.com/rubygems/rubygems/commit/23c46f3b57
2022-08-01[rubygems/rubygems] Fix comment incorrectly copied from another specDavid Rodríguez
https://github.com/rubygems/rubygems/commit/9be5eae9cf
2022-07-29Merge rubygems master from ↵Hiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/446cc57a7ccdf1924deb291be9571219e7ba8523 Notes: Merged: https://github.com/ruby/ruby/pull/6198
2022-07-27[rubygems/rubygems] Use main as default branch for Bundler specsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/482077d185
2022-07-17[rubygems/rubygems] Show a proper error if extension dir is not writableDavid Rodríguez
Instead of showing the bug report template. https://github.com/rubygems/rubygems/commit/0c8b6f7dd5
2022-07-13Merge RubyGems and Bundler masterHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/6124