Commit graph

41 commits

Author SHA1 Message Date
Nicholas La Roux
1f894fa2cc
[rubygems/rubygems] Remove unnecessary duplicate x64-mingw-ucrt entry
d6f1f96585
2025-06-03 07:47:14 +09:00
Nicholas La Roux
869a52f33a
[rubygems/rubygems] Partially phase out x64-mingw32 in favour of 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

b9d871022e
2025-06-03 07:47:14 +09:00
David Rodríguez
91a17fbbad
[rubygems/rubygems] Use preferred :windows value for Windows exclusively
aee52d2874

Co-authored-by: johnnyshields <27655+johnnyshields@users.noreply.github.com>
2025-02-14 16:13:27 +09:00
David Rodríguez
d8394461fd [rubygems/rubygems] Support installing arm native gems on Windows
96496e3f53

Co-authored-by: Johnny Shields <johnny.shields@gmail.com>
2025-01-28 15:31:53 +09:00
David Rodríguez
4035003fd0 [rubygems/rubygems] Remove duplicated bundle install
1774ac5db1
2025-01-28 15:31:51 +09:00
David Rodríguez
09b04fefb7 [rubygems/rubygems] Remove unnecessary platform helpers
I think they add unnecessary indirection and inconsistency to the specs.

609924d985
2025-01-28 15:31:49 +09:00
David Rodríguez
9c94b8feaf [rubygems/rubygems] Improve simulating Windows during Bundler specs
b48168bf1f
2025-01-28 15:31:48 +09:00
David Rodríguez
1758d436e7 [rubygems/rubygems] Enforce passing a block to simulate_platform
0658903e25
2024-07-23 19:40:07 +00:00
David Rodríguez
1d97c46b35 [rubygems/rubygems] Minor Bundler spec improvements
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.

e3ec32e247
2024-07-09 14:43:18 +00:00
David Rodríguez
98c923ff4b
Synchronize Bundler & RubyGems (#11071) 2024-06-28 10:12:29 -04:00
David Rodríguez
2755cb1b2f [rubygems/rubygems] Use modern hashes consistently
bb66253f2c
2023-12-07 22:29:33 +00:00
Martin Emde
5f0ea3f590 [rubygems/rubygems] Converts Bundler lockfile checksum validation to opt-in only
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.

2353cc93a4
2023-12-05 21:09:53 +00:00
David Rodríguez
60803e192e [rubygems/rubygems] Remove no longer necessary workaround for old RubyGems
ed4eaefac0
2023-11-27 15:04:40 +09:00
Mercedes Bernard
69d7e9a12e
[rubygems/rubygems] Use the server checksum, then calculate from gem on disk 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.

de00a4f153
2023-10-23 13:59:01 +09:00
Thong Kuah
ad08674d8d
[rubygems/rubygems] Add CHECKSUMS for each gem in lockfile
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.

bde37ca6bf
2023-10-23 13:59:01 +09:00
David Rodríguez
2d8b55fcd2 [rubygems/rubygems] Simplify lockfile_platforms helper
To make it easier to change the default platforms that get locked later.

255c4012ec
2023-03-17 18:50:55 +09:00
David Rodríguez
f22765f535 [rubygems/rubygems] Use splatted args to lockfile_platforms_for
Nicer :)

c0ab2893c3
2023-03-17 18:50:55 +09:00
johnnyshields
79ede4ae99 [rubygems/rubygems] Alias CurrentRuby#mswin?, mswin64?, mingw?, x64_mingw? to #windows?. (This is done instead of logging a deprecation warning.)
b9fcc7c0ab
2023-03-03 09:50:29 +00:00
David Rodríguez
f7cf641469
[rubygems/rubygems] Fix resolution hanging on musl platforms
After recent musl support was added, Bundler started hanging in musl
platforms. I identified the issue where valid candidates were being
filtered out because their platform was specified as a string, and thus
`Gem::Platform.match_spec?` which under the hood ends up calling
`Gem::Platform#===` would return `nil`, because it does not support
comparing platforms to strings.

In particular, `Bundler::EndpointSpecification`'s platform coming from
the API was not instantiated as a `Gem::Platform`, hence the issue.

Also, this spec surfaced another issue where a bug corrected in
`Gem::Platform#match_platforms` had not been yet backported to Bundler.
So this commit also backports that to get the spec green across RubyGems
versions.

Finally, the fix in `Bundler::EndpointSpecification` made a realworld
spec start failing. This spec was faking out `rails-4.2.7.1` requirement
on Bundler in the `Gemfile.lock` file to be `>= 1.17, < 3` when the real
requirement is `>= 1.17, < 2`. Due to the bug in
`Bundler::EndpointSpecification`, the real requirement provided by the
compact index API (recorded with VCR) was being ignored, and the
`Gemfile.lock` fake requirement was being used, which made the spec
pass. This is all expected, and to fix the issue I changed the spec to
be really realworld and don't fake any Bundler requirements.

faf4ef46bc
2022-09-05 11:43:14 +09:00
shields
8799c91205 [rubygems/rubygems] Add platform :windows as a shortcut for all Windows platforms
f3c49ad3f7
2022-08-29 00:33:15 +09:00
Hiroshi SHIBATA
9e6d07f346 Merge rubygems/bundler HEAD
Merge from 2af2520b4a
2022-07-26 14:38:17 +09:00
Hiroshi SHIBATA
437a5ae9d6 Merge RubyGems and Bundler master 2022-07-13 14:11:55 +09:00
David Rodríguez
c925d3b668 [rubygems/rubygems] Fix force_ruby_platform ignored when lockfile includes the current specific platform
9ca371adf8
2022-01-26 13:09:31 +09:00
Hiroshi SHIBATA
69dc2ea465 Merge RubyGems-3.3.0 and Bundler-2.3.0 2021-12-21 15:27:05 +09:00
Josef Šimánek
fd17ae8205
[rubygems/rubygems] Lock racc version in platform_spec.
- latest ruby is shipped with racc 1.6 making this spec failing
- this spec is related to platform locking, changing version should not do any harm

3e18b626cb
2021-10-29 18:00:46 +09:00
David Rodriguez
9072228a26 [ruby/rubygems] Get specs green on arm64-darwin-20
7a0bd9801d
2021-10-11 00:23:54 +09:00
David Rodríguez
6e2240a2f9 Sync latest bundler & rubygems development version 2021-07-07 13:30:20 +09:00
Hiroshi SHIBATA
ed149dbf46 Merge the master branch of Bundler 2021-04-15 15:36:15 +09:00
David Rodríguez
53468cc111 Sync latest development version of bundler & rubygems 2021-03-08 13:47:35 +09:00
David Rodríguez
696a50751b [rubygems/rubygems] s/install_gemfile!/install_gemfile
4d1a0c465a
2020-06-18 19:14:15 +09:00
David Rodríguez
1436b5026c [rubygems/rubygems] s/bundle!/bundle
746a4b3d74
2020-06-18 19:14:15 +09:00
David Rodríguez
529a9e8a1f [rubygems/rubygems] Fix a couple of specs that were loading an incorrect bundler
We have a check on an `at_exit` hook that checks that system bundler is
never loaded instead of our development copy. The check was failing in
these cases, but in a silent way because the errors were being swallowed.

This commit changes these specs to make sure they load the right
bundler.

cd1c1bc297
2020-06-18 19:14:15 +09:00
Hiroshi SHIBATA
0e60b59d58 Update the bundler version with master branch 2020-05-13 07:54:37 +09:00
Hiroshi SHIBATA
7585bc3187 Merge Bundler 2.1.0.pre.3
Features:
    - Add caller information to some deprecation messages to make them easier to fix [#7361](https://github.com/bundler/bundler/pull/7361)
    - Reconcile `bundle cache` vs `bundle package` everywhere. Now in docs, CLI help and everywhere else `bundle cache` is the preferred version and `bundle package` remains as an alias [#7389](https://github.com/bundler/bundler/pull/7389)
    - Display some basic `bundler` documentation together with ruby's RDoc based documentation [#7394](https://github.com/bundler/bundler/pull/7394)

  Bugfixes:
    - Fix typos deprecation message and upgrading docs [#7374](https://github.com/bundler/bundler/pull/7374)
    - Deprecation warnings about `taint` usage on ruby 2.7 [#7385](https://github.com/bundler/bundler/pull/7385)
    - Fix `--help` flag not correctly delegating to `man` when used with command aliases [#7388](https://github.com/bundler/bundler/pull/7388)
    - `bundle add` should cache newly added gems if an application cache exists [#7393](https://github.com/bundler/bundler/pull/7393)
    - Stop using an insecure folder as a "fallback home" when user home is not defined [#7416](https://github.com/bundler/bundler/pull/7416)
    - Fix `bundler/inline` warning about `Bundler.root` redefinition [#7417](https://github.com/bundler/bundler/pull/7417)
2019-11-11 18:56:25 +09:00
Samuel Giddins
4dea1356c3
[bundler/bundler] [CurrentRuby] Say we are ruby? when the generic local platform is Gem::Platform::RUBY
This allows us to always say we're ruby? when force_ruby_platform is
set, and fixes using gemspec & force_ruby_platform on windows.

3cb89b7e5c
2019-08-03 09:30:00 +09:00
David Rodríguez
c3ddd47ce7
[bundler/bundler] Normalize file:// handling in specs
5946d62ad0
2019-08-03 09:29:55 +09:00
hsbt
68ddd4d300 Merge Bundler 2.1.0.pre.1 as developed version from upstream.
a53709556b

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67539 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-14 06:01:35 +00:00
hsbt
59c8d50653 Added bundler as default gems. Revisit [Feature #12733]
* bin/*, lib/bundler/*, lib/bundler.rb, spec/bundler, man/*:
    Merge from latest stable branch of bundler/bundler repository and
    added workaround patches. I will backport them into upstream.
  * common.mk, defs/gmake.mk: Added `test-bundler` task for test suite
    of bundler.
  * tool/sync_default_gems.rb: Added sync task for bundler.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-11-02 23:07:56 +00:00
hsbt
7825e8363d Postponing the Bundler merge.
I faced a big issue about Bundler with ruby core.
  I have no time to resolve it issue before 2.5 final release.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22 23:08:05 +00:00
hsbt
be7b592912 Update bundled bundler to 1.16.0.
* lib/bundler, spec/bundler: Merge bundler-1.16.0.
  * common.mk: rspec examples of bundler-1.16.0 needs require option.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-01 23:29:38 +00:00
hsbt
8598f8c2dc Merge bundler to standard libraries.
rubygems 2.7.x depends bundler-1.15.x. This is preparation for
  rubygems and bundler migration.

  * lib/bundler.rb, lib/bundler/*: files of bundler-1.15.4
  * spec/bundler/*: rspec examples of bundler-1.15.4. I applied patches.
    * https://github.com/bundler/bundler/pull/6007
    * Exclude not working examples on ruby repository.
    * Fake ruby interpriter instead of installed ruby.
  * Makefile.in: Added test task named `test-bundler`. This task is only
    working macOS/linux yet. I'm going to support Windows environment later.
  * tool/sync_default_gems.rb: Added sync task for bundler.

  [Feature #12733][ruby-core:77172]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-08 08:45:41 +00:00