summaryrefslogtreecommitdiff
path: root/lib/bundler/definition.rb
AgeCommit message (Collapse)Author
2 days[rubygems/rubygems] Enforce checksums strictly for registry gemsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/05199ae0c1
2 days[rubygems/rubygems] Fix incorrect error message capitalizationDavid Rodríguez
https://github.com/rubygems/rubygems/commit/d41b8d303c
2 days[rubygems/rubygems] Fix `bundle update foo` not upgrading foo to latest in a ↵David Rodríguez
specific case If upgrading `foo` needs an indirect dependency to be downgraded, Bundler would not be able to upgrade foo. This is because when calculating the latest resolvable version of foo, Bundler was still adding lower bound requirements on the locked versions of all dependencies to avoid downgrades, effectively pinning foo to a version older than the latest. To fix this, instead of creating a second "unlocked" definition to figure out the latest resolvable version, create a second unlocked resolver, and DO NOT add lower bound requirements to it. https://github.com/rubygems/rubygems/commit/00cc0ecc69
2025-07-30[rubygems/rubygems] Remove unnecessary endless loop detectionDavid Rodríguez
Fixes a TODO now that no reports have been reported in a while. https://github.com/rubygems/rubygems/commit/f10dc84e7b
2025-07-30[rubygems/rubygems] Fix truffleruby failing to install sorbet-static when ↵David Rodríguez
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. https://github.com/rubygems/rubygems/commit/a96afc5351
2025-06-11[rubygems/rubygems] Validate dependencies when doing bundle installRandy Stauner
https://github.com/rubygems/rubygems/commit/b0983f392f
2025-06-06Move most of Bundler::GemHelpers to Gem::PlatformSamuel Giddins
This will help centralize wheel platform selection logic eventually Signed-off-by: Samuel Giddins <segiddins@segiddins.me>
2025-06-05[rubygems/rubygems] Slightly simplify locked specification source replacementDavid Rodríguez
https://github.com/rubygems/rubygems/commit/22f0a07377
2025-06-05[rubygems/rubygems] Fix git source unlocking for multi-gem repositories like ↵David Rodríguez
Rails If you have ``` gem "rails", git: "https://github.com/rails/rails" ``` and then explicitly pin to an older ref, like ``` gem "rails", git: "https://github.com/rails/rails", ref: "https://github.com/rubygems/rubygems/commit/99bacb5aa8e5" ``` Then `bundle install` fails, because locked sources fail to be updated to use the new source. This commit fixes the problem by making sure get their source properly replaced. https://github.com/rubygems/rubygems/commit/5de8c2e0cf
2025-04-15[rubygems/rubygems] Let `bundle lock --normalize-platforms` remove invalid ↵David Rodríguez
platforms https://github.com/rubygems/rubygems/commit/c39d2f84fd
2025-04-15[rubygems/rubygems] Raise an error if `bundle lock` target platform is ↵David Rodríguez
incompatible https://github.com/rubygems/rubygems/commit/282e4a8593
2025-04-15[rubygems/rubygems] Rename `resolution_packages` to `resolution_base`David Rodríguez
It handles resolution packages but also other stuff. https://github.com/rubygems/rubygems/commit/4baec92c20
2025-04-14[rubygems/rubygems] Refine `bundle update --verbose` logsDavid Rodríguez
Don't mention "Found changes from the lockfile" because that's not really true in general. https://github.com/rubygems/rubygems/commit/0181c278e8
2025-04-14[rubygems/rubygems] Fix `bundle lock --normalize-platforms` regressionDavid Rodríguez
https://github.com/rubygems/rubygems/commit/458fa5dc4c
2025-03-31[rubygems/rubygems] Allow ruby platform to be remove also when dependencies ↵David Rodríguez
have changed Since we will now add it back if the final resolution is compatible, we can also get this kind of edge case (`bundle add`) working. https://github.com/rubygems/rubygems/commit/cdc5ebec77
2025-03-31[rubygems/rubygems] Remove edge cases for not removing invalid platformsDavid Rodríguez
Instead, remove them anytime we find dependencies don't match the lockfile for a platform, and then add them back after resolution if they ended up being valid. https://github.com/rubygems/rubygems/commit/220bd77887
2025-03-31[rubygems/rubygems] `SpecSet#add_extra_platforms!` doesn't need to return ↵David Rodríguez
anything https://github.com/rubygems/rubygems/commit/9fd92ade54
2025-03-31[rubygems/rubygems] Split finding and removing invalid platformsDavid Rodríguez
I don't like traversing the array and modifying it at the same time while it seems to work. https://github.com/rubygems/rubygems/commit/6551c74c27
2025-03-25[rubygems/rubygems] Remove specs with bad sources when converging dependenciesDavid Rodríguez
https://github.com/rubygems/rubygems/commit/a0f7851451
2025-03-25[rubygems/rubygems] Tweak to check specs size just onceDavid Rodríguez
https://github.com/rubygems/rubygems/commit/4497555023
2025-03-24[rubygems/rubygems] Raise an error in frozen mode if CHECKSUMS entries are ↵David Rodríguez
missing https://github.com/rubygems/rubygems/commit/054a0cd76c Notes: Merged: https://github.com/ruby/ruby/pull/12968
2025-03-24[rubygems/rubygems] Rename block variableDavid Rodríguez
It's a dependency, not a specification. https://github.com/rubygems/rubygems/commit/9d78f5aa14 Notes: Merged: https://github.com/ruby/ruby/pull/12968
2025-03-24[rubygems/rubygems] Refactor replacing locked specification path sourcesDavid Rodríguez
Instead of doing an explicit pass, let sources be replaced while checking if specifications are up to date. https://github.com/rubygems/rubygems/commit/676271e804 Notes: Merged: https://github.com/ruby/ruby/pull/12968
2025-03-24[rubygems/rubygems] Refactor replacement of locked path sourcesDavid Rodríguez
Instead of doing an explicit pass to preserve the source from the Gemfile when it's a `Source::Gemspec`, add a special case to our generic source replacement method. https://github.com/rubygems/rubygems/commit/20c8c42380 Notes: Merged: https://github.com/ruby/ruby/pull/12968
2025-03-24[rubygems/rubygems] Remove unnecessary replacement of locked dependencies ↵David Rodríguez
sources The `converge_dependencies` method already replaces the source of the dependency with an equivalent source from the Gemfile if possible. https://github.com/rubygems/rubygems/commit/a449e7ba19 Notes: Merged: https://github.com/ruby/ruby/pull/12968
2025-03-24[rubygems/rubygems] Refactor Path vs Gemspec source comparisonDavid Rodríguez
https://github.com/rubygems/rubygems/commit/58e9bd9962 Notes: Merged: https://github.com/ruby/ruby/pull/12968
2025-03-24[rubygems/rubygems] Remove unused default valueDavid Rodríguez
https://github.com/rubygems/rubygems/commit/e9f4d1e5c2 Notes: Merged: https://github.com/ruby/ruby/pull/12968
2025-03-24[rubygems/rubygems] Reword log message about current platform being missingDavid Rodríguez
It reads better this way I think. https://github.com/rubygems/rubygems/commit/ce9743290d Notes: Merged: https://github.com/ruby/ruby/pull/12968
2025-03-24[rubygems/rubygems] Improve grammar of some error messagesDavid Rodríguez
https://github.com/rubygems/rubygems/commit/558a4765c7 Notes: Merged: https://github.com/ruby/ruby/pull/12968
2025-03-24[rubygems/rubygems] Consistently use "lockfile" over "lock file"David Rodríguez
https://github.com/rubygems/rubygems/commit/e891be9197 Notes: Merged: https://github.com/ruby/ruby/pull/12968
2025-03-24[rubygems/rubygems] Fix frozen error message incorrectly mentioning the GemfileDavid Rodríguez
It meant to mention the lockfile here. https://github.com/rubygems/rubygems/commit/2f0233a0fb Notes: Merged: https://github.com/ruby/ruby/pull/12968
2025-02-27[rubygems/rubygems] Improve error message when on read-only filesystemsDavid Rodríguez
If we fail to write the lockfile, give a better error. https://github.com/rubygems/rubygems/commit/81a08d6eda
2025-02-25[rubygems/rubygems] Improve log message about adding a new platformDavid Rodríguez
This message is printed when running `bundle lock --add-platform`. This command affects the lockfile, not the gemfile, and I think it's better to use "You are adding" rather than "You added", because the addition is happening during the current invocation (as opposed to other log messages that talk about a change made to the Gemfile prior to running the command). https://github.com/rubygems/rubygems/commit/aba1e55f5b Notes: Merged: https://github.com/ruby/ruby/pull/12804
2025-02-25[rubygems/rubygems] Refactor handling platform removalsDavid Rodríguez
And make it consistent with platform additions. https://github.com/rubygems/rubygems/commit/64342ae404 Notes: Merged: https://github.com/ruby/ruby/pull/12804
2025-02-25[rubygems/rubygems] Improve log message when resolving due to local platform ↵David Rodríguez
not in lockfile Current it says "you added a new platform to your gemfile", but that's not actually the case here. https://github.com/rubygems/rubygems/commit/1e39527a38 Notes: Merged: https://github.com/ruby/ruby/pull/12804
2025-02-20[rubygems/rubygems] Fix lockfile platforms inconveniently added on JRubyDavid Rodríguez
When working with our repository on JRuby locally, I get the following changes when running `bin/rake setup` in all of our lockfiles ```diff diff --git a/tool/bundler/dev_gems.rb.lock b/tool/bundler/dev_gems.rb.lock index https://github.com/rubygems/rubygems/commit/362bf25690d..https://github.com/rubygems/rubygems/commit/74550b2a408 100644 --- a/tool/bundler/dev_gems.rb.lock +++ b/tool/bundler/dev_gems.rb.lock @@ -66,6 +66,7 @@ PLATFORMS java ruby universal-java + universal-java-22 x64-mingw-ucrt x86-linux x86_64-darwin ``` This is inconvenient, so I applied the same strategy we already use on non JRuby implementations to not add the current platform to the lockfile if a less specific platform is already there. https://github.com/rubygems/rubygems/commit/812b9cd1e8
2025-02-18[rubygems/rubygems] Fix Bundler incorrectly downgrading direct dependenciesDavid Rodríguez
There's no reason to call `converge_specs` when adding additional lower bound requirements to prevent downgrades, and it actually causes the extra requirements to be missed sometimes. Loop over the originally locked specs directly, adding the additional precaution of not adding the requirement if the Gemfile dependency has changed and it no longer matches the locked spec. https://github.com/rubygems/rubygems/commit/5154506912
2025-02-18[rubygems/rubygems] Don't try to skip requirements to prevent downgradesDavid Rodríguez
These don't really hurt, so I'm not sure why I introduced it. https://github.com/rubygems/rubygems/commit/85b6b405ac
2025-02-18[rubygems/rubygems] Fix locked gems being upgraded when locked dependencies ↵David Rodríguez
are incorrect Resolver had internal logic to prioritize locked versions when sorting versions, however part of it was not being actually hit because of how unlocking worked in the resolver: a package was allow to be unlocked when that was explicit requested or when the list of unlocks was empty. That did not make a lot of sense and other cases were working because the explicit list of unlocks was getting "artificially filled". Now we consider a package unlocked when explicitly requested (`bundle update <package>`), or when everything is being unlocked (`bundle install` with no lockfile or `bundle update`). This makes things simpler and gets the edge case added as a test case working as expected. https://github.com/rubygems/rubygems/commit/b8e55087f0
2025-02-18[rubygems/rubygems] Refactor finding dependency changesDavid Rodríguez
https://github.com/rubygems/rubygems/commit/d8c4754d8f
2025-02-18[rubygems/rubygems] Improve processing and categorizing unlock informationDavid Rodríguez
https://github.com/rubygems/rubygems/commit/516430c3ec
2025-02-17[rubygems/rubygems] Make Bundler never instantiate development dependenciesDavid Rodríguez
Bundler does not really have a concept of "development dependencies", like RubyGems has. Bundler has the more generic concept of "groups". Under the hood, the `gemspec` DSL will put gemspec development dependencies under a `:development` Gemfile group, but there's no reason to instantiate these as development dependencies, they are regular runtime dependencies, except that they belong in a group named :development. By never instantiating development dependencies at all, we avoid having to introduce hacks to "undo" the type Bundler does not know about, and I also think the error messages read better. https://github.com/rubygems/rubygems/commit/9a06fa5bda
2025-02-14[rubygems/rubygems] Raise error when lockfile is missing deps in frozen modeDavid Rodríguez
And avoid installing any gems. https://github.com/rubygems/rubygems/commit/c12700c7e4
2025-02-13[rubygems/rubygems] Fix incorrect error message in frozen modeDavid Rodríguez
When Bundler refuses to install in frozen mode, sometimes it would incorrectly claim that some dependencies have been added to the Gemfile when that's not really the case. Fix that by making sure `locked_dependencies` always has all locked dependencies, even when unlocking, Additionally, the suggestion to run `bundle install` is also confusing when unlocking, since `bundle update` is what has been run. So skip that part as well when unlocking. https://github.com/rubygems/rubygems/commit/64d84ad7d8
2025-01-20[rubygems/rubygems] Fix `--prefer-local` not respecting default gemsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/3df86cd9c6
2025-01-14[rubygems/rubygems] Don't remove platform specific variants from the ↵David Rodríguez
lockfile unless necessary Even if they don't match the current Ruby version, they could still work in other rubies. So it's better to keep them. https://github.com/rubygems/rubygems/commit/9a3e583b0c Notes: Merged: https://github.com/ruby/ruby/pull/12568
2025-01-14[rubygems/rubygems] Extract `SpecSet#version_for`David Rodríguez
https://github.com/rubygems/rubygems/commit/a76fd6d3bf Notes: Merged: https://github.com/ruby/ruby/pull/12568
2024-12-16[rubygems/rubygems] Fix `bundle lock --add-checksums` when gems are already ↵David Rodríguez
installed https://github.com/rubygems/rubygems/commit/a087c452ad
2024-11-26[rubygems/rubygems] Avoid needing a second pass to ignore unlocked gemsDavid Rodríguez
When converging locked specifications to select the ones that should be preserved while resolving, we can avoid having to do a second pass to ignore the ones that have been explicitly unlocked. https://github.com/rubygems/rubygems/commit/411742703e
2024-11-26[rubygems/rubygems] Allow some materialized specs to be missingDavid Rodríguez
As long as some spec in the materialization is complete. https://github.com/rubygems/rubygems/commit/9a673b0bbb