summaryrefslogtreecommitdiff
path: root/spec/bundler/commands/lock_spec.rb
AgeCommit message (Collapse)Author
2024-03-22[rubygems/rubygems] Fix incorrect `bundle update --bundler` messageDavid Rodriguez
https://github.com/rubygems/rubygems/commit/146de56353
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-12[rubygems/rubygems] bundle lock: Always touch the lockfileFranz Liedke
https://github.com/rubygems/rubygems/commit/fd2e71dfdb
2023-12-07[rubygems/rubygems] Use modern hashes consistentlyDavid Rodríguez
https://github.com/rubygems/rubygems/commit/bb66253f2c
2023-12-05[rubygems/rubygems] Converts Bundler lockfile checksum validation to opt-in onlyMartin Emde
Looks for the CHECKSUMS section in the lockfile, activating the feature only if the section exists. Without a CHECKSUMS section, Bundler will continue as normal, validating checksums when gems are installed while checksums from the compact index are present. https://github.com/rubygems/rubygems/commit/2353cc93a4
2023-11-13[rubygems/rubygems] Automatically lock extra ruby platformsDavid Rodríguez
Since we started locking the specific platform in the lockfile, that has created an annoying situation for users that don't develop on Linux. They will create a lockfile on their machines, locking their local platform, for example, darwin. But then that lockfile won't work automatically when deploying to Heroku for example, because the lockfile is frozen and the Linux platform is not included. There's the chance though that resolving against two platforms (Linux + the local platform) won't succeed while resolving for just the current platform will. So, instead, we check other platform specific variants available for the resolution we initially found, and lock those platforms and specs too if they satisfy the resolution. This is only done when generating new lockfiles from scratch, existing lockfiles should keep working as before, and it's only done for "ruby platforms", i.e., not Java or Windows which have their own complexities, and so are excluded. With this change, we expect that MacOS users can bundle locally and deploy to Heroku without needing to do anything special. https://github.com/rubygems/rubygems/commit/5f24f06bc5
2023-11-13[rubygems/rubygems] Refactor platform test helpersDavid Rodriguez
https://github.com/rubygems/rubygems/commit/7ab4c203f9
2023-11-09[rubygems/rubygems] Fix daily Bundler CIDavid Rodríguez
Daily Bundler CI against ruby-head is failing because ruby-head now uses bigdecimal 3.1.5, so that gets locked by this spec. This change should make the test stable until bigdecimal 99.1.5 is bundled with Ruby :) https://github.com/rubygems/rubygems/commit/830326041f
2023-10-23[rubygems/rubygems] Handle base64 encoded checksums in lockfile for future ↵Martin Emde
compatibility. Save checksums using = as separator. https://github.com/rubygems/rubygems/commit/a36ad7d160
2023-10-23[rubygems/rubygems] Improve errors and register checksums reliablyMartin Emde
Improve error reporting for checksums, raises a new error class. Solve for multi-source checksum errors. Add CHECKSUMS to tool/bundler/(dev|standard|rubocop)26_gems.rb https://github.com/rubygems/rubygems/commit/26ceee0e76 Co-authored-by: Samuel Giddins <segiddins@segiddins.me>
2023-10-23[rubygems/rubygems] Refactor Checksum classes and methods to reduceMartin Emde
code. (https://github.com/rubygems/rubygems/pull/6917) https://github.com/rubygems/rubygems/commit/2238bdaadc
2023-10-23[rubygems/rubygems] Refactor to checksums stored via sourceSamuel Giddins
This gets the specs passing, and handles the fact that we expect checkums to be pinned only to a particular source This also avoids reading in .gem files during lockfile generation, instead allowing us to query the source for each resolved gem to grab the checksum Finally, this opens up a route to having user-stored checksum databases, similar to how other package managers do this! Add checksums to dev lockfiles Handle full name conflicts from different original_platforms when adding checksums to store from compact index Specs passing on Bundler 3 https://github.com/rubygems/rubygems/commit/86c7084e1c
2023-10-23[rubygems/rubygems] Use the server checksum, then calculate from gem on disk ↵Mercedes Bernard
if possible 1. Use the checksum provided by the server if provided: provides security knowing if the gem you downloaded matches the gem on the server 2. Calculate the checksum from the gem on disk: provides security knowing if the gem has changed between installs 3. In some cases, neither is possible in which case we don't put anything in the checksum and we maintain functionality as it is today Add the checksums to specs in the index if we already have them Prior to checksums, we didn't lose any information when overwriting specs in the index with stubs. But now when we overwrite EndpointSpecifications or RemoteSpecifications with more generic specs, we could lose checksum info. This manually sets checksum info so we keep it in the index. https://github.com/rubygems/rubygems/commit/de00a4f153
2023-10-23[rubygems/rubygems] Add CHECKSUMS for each gem in lockfileThong Kuah
We lock the checksum for each resolved spec under a new CHECKSUMS section in the lockfile. If the locked spec does not resolve for the local platform, we preserve the locked checksum, similar to how we preserve specs. Checksum locking only makes sense on install. The compact index information is only available then. https://github.com/rubygems/rubygems/commit/bde37ca6bf
2023-10-16[rubygems/rubygems] The `lock` command should not be affected by frozen settingDavid Rodríguez
The `lock` command is specifically designed to manage the lockfile, so running it should take precedence over any "frozen" setting. Besides that, "frozen" is not specifically designed as "lockfile cannot be updated" but as "installation of gems should be prevented if gemfile is not in sync with the lockfile". The lock command does not install any gems and preserves the property of the lockfile being in sycn with its gemfile, so I think frozen should not influence it. The current behavior is quite confusing when frozen is set. On an app where rubocop can get lockfile updates ``` $ bundle lock --update rubocop Writing lockfile to /path/to/Gemfile.lock ``` Completely silent, it makes you think that it has written the lockfile, but still no updates. In verbose mode, it gives a bit more information, but still confusing and unexpected, and does not change the lockfile: ``` $ bundle lock --update rubocop --verbose Running `bundle lock --update "rubocop" --verbose` with bundler 2.4.20 Frozen, using resolution from the lockfile Writing lockfile to /path/to/Gemfile.lock ``` With this commit, it updates the lockfile as expected. https://github.com/rubygems/rubygems/commit/1d501ae8ea
2023-09-27[rubygems/rubygems] Fix `bundle lock --minor --update <dep>` edge caseDavid Rodriguez
When the latest allowed minor of `dep` adds a new dependency, that new dependency would be incorrectly resolved to the latest minor of the first major version. https://github.com/rubygems/rubygems/commit/fd50c9d4f3
2023-07-24[rubygems/rubygems] Refactor spec helpers for reading lockfilesDavid Rodríguez
https://github.com/rubygems/rubygems/commit/ea2a30ba08
2023-07-24[rubygems/rubygems] Simplify `bundle lock` specsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/6301d3eece
2023-06-20Merge rubygems/rubygems HEADHiroshi SHIBATA
Pick from https://github.com/rubygems/rubygems/commit/880dd95996c93adc1e032399816931b243c5fe17 Notes: Merged: https://github.com/ruby/ruby/pull/7961
2023-04-06[rubygems/rubygems] Fix resolver hangs when dealing with an incomplete lockfileDavid Rodríguez
While working on locking multiple platforms by default, I got an infinite resolution loop in one of our resolver specs. The culprit ended up being that when dealing with lockfile specs with incomplete dependencies (spec appears in lockfile, but its dependencies don't), those specs were not being properly expired and that tripped up resolution. The issue for some reason only manifests when dealing with multiple lockfile platforms, that's why it only manifested when working on locking multiple platforms by default. https://github.com/rubygems/rubygems/commit/4ca72913bb
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-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] Use more common linux platform for specsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/3841a58095
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-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-10Merge RubyGems and Bundler masterHiroshi SHIBATA
from https://github.com/rubygems/rubygems/commit/0635c1423db5d7c461d53bf0c3329bca75de7609 Notes: Merged: https://github.com/ruby/ruby/pull/7094
2022-12-24Merge RubyGems-3.4.0 and Bundler-2.4.0Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/6987
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-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-09Merge RubyGems/Bundler masterHiroshi SHIBATA
Pick from https://github.com/rubygems/rubygems/commit/823c776d951f3c35094611473ec77f94e8bf6610 Notes: Merged: https://github.com/ruby/ruby/pull/6890
2022-08-29[rubygems/rubygems] Add platform :windows as a shortcut for all Windows ↵shields
platforms https://github.com/rubygems/rubygems/commit/f3c49ad3f7
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-13Merge RubyGems and Bundler masterHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/6124
2022-05-11[rubygems/rubygems] Extract a `next_ruby_minor` helper method for specsDavid Rodríguez
https://github.com/rubygems/rubygems/commit/66eae0ef1d
2022-04-28Merge ↵Hiroshi SHIBATA
https://github.com/rubygems/rubygems/commit/3f7d0352e84b29d4a2d4cd93b31e5ebdb5f79cc6 Notes: Merged: https://github.com/ruby/ruby/pull/5669
2022-02-28Merge RubyGems and Bundler masterHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/5606
2022-02-01Sync latest Bundler & RubyGemsDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/5512
2021-11-12[rubygems/rubygems] Remove `lockfile_should_be` helperDavid Rodríguez
It doesn't add anything. https://github.com/rubygems/rubygems/commit/ece3c864df
2021-08-31[rubygems/rubygems] Improve "gem not found in source" errorsDavid Rodríguez
When printing sources inside these error messages, it's useful to only consider the current state of the source. For example, when requiring `bundler/setup`, the source shouldn't be configured to be able to hit the network, so the error message should only mention "locally installed gems" to make that more clear. https://github.com/rubygems/rubygems/commit/30eb14f853 Notes: Merged: https://github.com/ruby/ruby/pull/4789
2021-07-07Sync latest bundler & rubygems development versionDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/4533
2021-04-15Merge the master branch of BundlerHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4383
2021-03-08Sync latest development version of bundler & rubygemsDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/4143
2020-12-23Merge RubyGems 3.2.3 and Bundler 2.2.3Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3982
2020-12-18Merge RubyGems 3.2.2 and Bundler 2.2.2Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/3930