summaryrefslogtreecommitdiff
path: root/spec/bundler/install/gemfile/specific_platform_spec.rb
AgeCommit message (Collapse)Author
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-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-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-02-14[rubygems/rubygems] Use preferred `:windows` value for Windows exclusivelyDavid Rodríguez
https://github.com/rubygems/rubygems/commit/aee52d2874 Co-authored-by: johnnyshields <[email protected]>
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 <[email protected]>
2025-01-28[rubygems/rubygems] Remove unnecessary platform helpersDavid Rodríguez
I think they add unnecessary indirection and inconsistency to the specs. https://github.com/rubygems/rubygems/commit/609924d985
2025-01-28[rubygems/rubygems] Refactor specs to use platform strings directlyDavid Rodríguez
https://github.com/rubygems/rubygems/commit/d24c0c20e3
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
2024-11-08[rubygems/rubygems] Warn on insecure materializationDavid Rodríguez
https://github.com/rubygems/rubygems/commit/bc2537de71
2024-11-08[rubygems/rubygems] Fix typoDavid Rodríguez
https://github.com/rubygems/rubygems/commit/f68a2c30bb
2024-11-08[rubygems/rubygems] Simplify tests that deal with lockfile using only "ruby" ↵David Rodríguez
platform Using an old bundler version was necessary at the beginning because we checked the version of Bundler being run in order to enable the new behavior. But we removed that a long time ago and now we only look at whether the lockfile only includes "ruby" as a platform or not. https://github.com/rubygems/rubygems/commit/8fc3d38ff3
2024-11-08[rubygems/rubygems] Make sure platforms in spec lockfile are properly sortedDavid Rodríguez
https://github.com/rubygems/rubygems/commit/99b4ac4548
2024-11-06[rubygems/rubygems] Add missing spec for materializing lockfiles with only ↵David Rodríguez
"ruby" platform https://github.com/rubygems/rubygems/commit/4168a7f488
2024-07-23[rubygems/rubygems] Enable checksums on Bundler 3 for fresh lockfilesDavid Rodríguez
And get specs passing. https://github.com/rubygems/rubygems/commit/c23b5f5b84
2024-07-23[rubygems/rubygems] Normalize a few specs using sourcesDavid Rodríguez
Use the standard sources to avoid having to explictly pass ENV with the repo. https://github.com/rubygems/rubygems/commit/95055dba57
2024-07-18[rubygems/rubygems] Fix another removal issueDavid Rodríguez
I failed to ignore (again) specs only considered for resolution under some platforms that are not the current one. https://github.com/rubygems/rubygems/commit/b72deec57e
2024-07-18[rubygems/rubygems] Simplify spec assertionDavid Rodríguez
All that we expect here is no changes. https://github.com/rubygems/rubygems/commit/ff984b6133
2024-07-09[rubygems/rubygems] Fix generic platform gems getting incorrectly removed ↵David Rodríguez
when locked for a specific platform If they are already in the lockfile as the most specific variant for a platform, we shouldn't change that unless explicitly unlocking. https://github.com/rubygems/rubygems/commit/a901660498
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-07-05[rubygems/rubygems] Use preferred add_dependency instead of ↵Jerome Dalbert
add_runtime_dependency https://github.com/rubygems/rubygems/commit/9a08043858
2024-06-28Synchronize Bundler & RubyGems (#11071)David Rodríguez
2024-06-20[rubygems/rubygems] Fix `bundle update <gem_name>` edge caseDavid Rodríguez
When locked only to RUBY, and some locked spec does not meet locked dependencies, Bundler would remove the only locked platform and end up creating a lockfile with empty sections. We can't rely on our criteria to remove invalid platforms if locked specs are not valid in the first place. https://github.com/rubygems/rubygems/commit/1dba05cf53
2024-06-20[rubygems/rubygems] Make sure to not re-resolve when a not fully specific ↵David Rodríguez
local platform is locked https://github.com/rubygems/rubygems/commit/36a02c6128
2024-06-20[rubygems/rubygems] Always resolve against the local platformDavid Rodríguez
If RUBY is the only platform in the lockfile, we were skipping adding the local platform to the list of resolution platforms. This generally works anyways, because we had some code to still add it if the RUBY platform is not valid for the set of locked gems. However, sometimes it can happen that "RUBY" is valid for the current set of locked gems, but when adding a new dependency, it becomes invalid. For example, when adding sorbet to a Gemfile, that will introduce `sorbet-static` as an indirect dependency which does not have a generic "RUBY" variant. This will cause resolution to take a long time continuously backtracking trying to find solutions that don't introduce `sorbet-static` as a dependency and will eventually fail. Instead, we can always add the local platform to the set of resolution platforms before resolving, and remove it as necessary after resolution so that we lock the correct set of platforms. https://github.com/rubygems/rubygems/commit/6ed1fe6050
2024-05-24[rubygems/rubygems] Fix error messages to not mention cached gems when they ↵David Rodríguez
were not used https://github.com/rubygems/rubygems/commit/5ce9a7ff17
2024-04-17[rubygems/rubygems] Excluding local platform from lockfile should not affect ↵Mike Dalessio
musl vs gnu case This case is for not locking things like `arm-darwin-23` when the lockfile already includes `arm-darwin`, so that we don't infinitely keep redundant versioned platforms in the lockfile when not necessary. We detect this with `Gem::Platform#===`. For example, `Gem::Platform.new("arm-darwin-23") === Gem::Platform.new("arm-darwin")` but they're not `==`. However, in the case of `-musl` vs `-gnu`, those act as the platform "version", but `===` is not commutative for them. This is explained in `===` docs. We only want to exclude the local platform in situations when `Gem::Platform#===` is actually commutative. https://github.com/rubygems/rubygems/commit/8099c4face
2024-03-22[rubygems/rubygems] Fix incorrect `bundle update --bundler` messageDavid Rodriguez
https://github.com/rubygems/rubygems/commit/146de56353
2024-01-31[rubygems/rubygems] Fix musl platform not being added to the lockfileDavid Rodriguez
https://github.com/rubygems/rubygems/commit/235f7b4266
2023-12-22Merge RubyGems-3.5.2 and Bundler-2.5.2Hiroshi SHIBATA
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-22[rubygems/rubygems] Fix universal lockfiles regressionDavid Rodriguez
If a platform specific variant would not match the current Ruby, we would still be considering it compatible with the initial resolution and adding its platform to the lockfile, but we would later fail to materialize it for installation due to not really being compatible. Fix is to only add platforms for variants that are also compatible with current Ruby and RubyGems versions. https://github.com/rubygems/rubygems/commit/75d1290843
2023-11-21[rubygems/rubygems] Fix invalid platform removal missing adjacent platformsBo Anderson
https://github.com/rubygems/rubygems/commit/4ce66c41a2
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-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 <[email protected]>
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] Automatically remove invalid platforms before re-resolvingDavid Rodríguez
https://github.com/rubygems/rubygems/commit/40989271dd
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-03-28[rubygems/rubygems] Fix incorrect removal of "ruby" platform from lockfileDavid Rodríguez
When dependencies have changed, we'll be re-resolving, and we can't really know whether the resolution will be valid or invalid for the Ruby platform, so skip the removal in that case. The fix worked, but made some other specs fail, and surfaced that the `@dependencies_changed` attribute was actually being incorrect set when explicitly unlocking. Fixed that with an early return. https://github.com/rubygems/rubygems/commit/20d8f5e5d9
2023-03-17[rubygems/rubygems] Simplify `lockfile_platforms` helperDavid Rodríguez
To make it easier to change the default platforms that get locked later. https://github.com/rubygems/rubygems/commit/255c4012ec
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 <[email protected]> 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-31[rubygems/rubygems] Add test for old lockfile with new ruby versionMike Dalessio
Given an existing application using native gems (e.g., nokogiri) And a lockfile generated with a stable ruby version When we test the application against ruby-head and `bundle install` Then bundler should fall back to the generic ruby platform gem Note that this test has been passing since 45931ac9 https://github.com/rubygems/rubygems/commit/0ecc6de378 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-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-12Migrate our resolver engine to PubGrubHiroshi SHIBATA
https://github.com/rubygems/rubygems/pull/5960 Co-authored-by: David Rodríguez <[email protected]>