2919 Commits

Author SHA1 Message Date
David Rodríguez
203a570f68 [rubygems/rubygems] Add additional assertions to spec
To make it consistent with the spec above it.

https://github.com/rubygems/rubygems/commit/9a00bf8db9
2025-02-18 12:12:53 +09:00
David Rodríguez
c77354157f [rubygems/rubygems] Fix locked gems being upgraded when locked dependencies 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 12:12:51 +09:00
David Rodríguez
249881690a [rubygems/rubygems] Add intermediate assertion to spec to help debugging
https://github.com/rubygems/rubygems/commit/ffabab65f2
2025-02-18 12:12:50 +09:00
David Rodríguez
63657565eb [rubygems/rubygems] Extract a TheBundle#locked_specs test helper
https://github.com/rubygems/rubygems/commit/8cbe6573b4
2025-02-18 12:12:48 +09:00
David Rodríguez
c8f4df4ae9 [rubygems/rubygems] Make Bundler never instantiate development dependencies
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-17 11:04:39 +09:00
David Rodríguez
e59c90118e
[rubygems/rubygems] Raise error when lockfile is missing deps in frozen mode
And avoid installing any gems.

https://github.com/rubygems/rubygems/commit/c12700c7e4
2025-02-14 16:13:27 +09:00
johnnyshields
e11401f799
[rubygems/rubygems] Deprecate legacy windows platforms (mswin, mingw) in the Bundler DSL, in favor of using platform :windows
This commit is only deprecation and does not change/remove any actual functionality.

https://github.com/rubygems/rubygems/commit/0ca6dc3984
2025-02-14 16:13:27 +09:00
David Rodríguez
91a17fbbad
[rubygems/rubygems] Use preferred :windows value for Windows exclusively
https://github.com/rubygems/rubygems/commit/aee52d2874

Co-authored-by: johnnyshields <27655+johnnyshields@users.noreply.github.com>
2025-02-14 16:13:27 +09:00
David Rodríguez
ccbebe9979
[rubygems/rubygems] Let :bundler filter raise if not given major versions
Otherwise it doesn't work as expected and it may skip specs.

https://github.com/rubygems/rubygems/commit/d6af077174
2025-02-14 16:13:27 +09:00
David Rodríguez
a3c05f27c3
[rubygems/rubygems] Remove spec filters
These should always run.

https://github.com/rubygems/rubygems/commit/0818eb104f
2025-02-14 16:13:27 +09:00
David Rodríguez
181cab566c
[rubygems/rubygems] Fix legacy windows platform values no longer working
https://github.com/rubygems/rubygems/commit/de8b3016db
2025-02-14 16:13:26 +09:00
David Rodríguez
ee03df26ba
[rubygems/rubygems] --prefer-local should resolve to latest version if no gems are available locally
Filtering out remote specs should only apply where there are locally
installed specs. Otherwise they should always be considered.

https://github.com/rubygems/rubygems/commit/118f8389a1
2025-02-13 09:37:51 +09:00
David Rodríguez
151b436c9d
[rubygems/rubygems] Fix incorrect error message in frozen mode
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-02-13 09:37:51 +09:00
David Rodríguez
d9267b4a71
[rubygems/rubygems] Fix type and gemfile not getting reported as invalid options
https://github.com/rubygems/rubygems/commit/5b6077a1e8
2025-02-13 09:37:51 +09:00
David Rodríguez
0423fde317
[rubygems/rubygems] Fix spec wording
This feature is not really deprecated, it's removed.

https://github.com/rubygems/rubygems/commit/e7f5f061f5
2025-02-13 09:37:51 +09:00
David Rodríguez
e7720ef8d7
[rubygems/rubygems] Materializing specs for vendor/cache should not be strict
Platforms specific gems not compatible with the current Ruby should not
make `bundle cache` fail and should not get removed from the cache since
they still may be useful in other rubies.

https://github.com/rubygems/rubygems/commit/717b43f565
2025-02-13 09:37:50 +09:00
Hiroshi SHIBATA
dc8cde479c
[rubygems/rubygems] Stub-out additional examples and removed needless Error definition
https://github.com/rubygems/rubygems/commit/d24d0b5c43
2025-02-13 09:37:50 +09:00
Andrew Konchin
5454188f6b Retry on IO::EAGAINWaitReadable when a closed socket is still not available for reading 2025-02-07 21:13:14 +01:00
David Rodríguez
ac093f4350 [rubygems/rubygems] Auto-heal empty installation directory
https://github.com/rubygems/rubygems/commit/9720a9b980
2025-02-06 15:58:00 +09:00
David Rodríguez
78ef59acf7 [rubygems/rubygems] Refine messages about gem installations being missing
The previous wording was too specific, there may be situations when the
gem has actually never installed (so never deleted either).

https://github.com/rubygems/rubygems/commit/e4a0d71fbe
2025-02-06 15:57:59 +09:00
David Rodríguez
c83370671b Improve bundled gems warning messages
Currently evenn if the require actually fails, they suggest that the
file was actually loaded, which is confusing. I reworded them to reduce
this confusion.
2025-02-06 13:07:55 +09:00
David Rodríguez
433f4e30b3 Simplify bundled gems warnings implementation
Most of the stuff is not actually necessary.
2025-02-06 13:07:55 +09:00
David Rodríguez
68bb6ceeaf Remove unnecessary SINCE_FAST_PATH constant
If anything, I think this may be causing some false positives.
2025-02-06 13:07:55 +09:00
Edouard CHIN
c204cf7cb1 [rubygems/rubygems] Deprecate CurrentRuby#maglev? and other related maglev methods:
- Follow up to https://github.com/rubygems/rubygems/pull/8430#discussion_r1927239555.

  The maglev platform was not supported by Bundler, so calling
  `gem "foo", platforms: ["maglev"]` would raise an error.

  The helpers added in the `CurrentRuby` class were used at a time
  when maglev was supported (as explained in https://github.com/rubygems/rubygems/commit/45ec86e2e528).
  Support of maglev was most likely dropped at some point and the helpers
  in the `CurrentRuby` class were not deprecated/removed.

  We decided to deprecate them now.

https://github.com/rubygems/rubygems/commit/66388babf8
2025-02-05 12:48:44 +09:00
Hiroshi SHIBATA
470784cbd9 Expand stub-out scope of Fiddle.dlopen 2025-02-05 07:36:59 +09:00
Andrii Konchyn
7317f96727
Move out from quarantine a Marshal.dump spec for Float (#12692)
* Move out from quarantine a Marshal.dump spec for Float

Co-authored-by: Benoit Daloze <eregontp@gmail.com>
2025-02-03 13:24:16 +00:00
Nobuyoshi Nakada
571f3394f2
[Bug #21106] Fix tests for custom random object
When a positive integer limit is given, `rand` method of a RNG object
is expected to return a value between 0 and the limit (exclusive).

Fix shuffle_spec.rb like as the similar code in sample_spec.rb, and
add tests for greater values.

TODO:
- Return a value that is equal to or greater than the limit given to
  the RNG object.
- Extract common code about RNG objects to a shared file.
2025-02-02 20:59:59 +09:00
Samuel Williams
0da2b12741 Prefer platform_is_not :windows. 2025-01-31 13:00:26 +01:00
David Rodríguez
451d848a76
Stop generating binstubs for Bundler itself 2025-01-31 14:34:55 +09:00
David Rodríguez
56e2ef2468 [rubygems/rubygems] Fix bundle console unnecessarily trying to load IRB twice
https://github.com/rubygems/rubygems/commit/f9bf58573f
2025-01-31 14:34:29 +09:00
David Rodríguez
e0f39d4cd3 [rubygems/rubygems] Test with JRuby 9.4.10.0
https://github.com/rubygems/rubygems/commit/770b19d859
2025-01-31 14:34:27 +09:00
Edouard CHIN
2ed30c9944 [rubygems/rubygems] Consolidate the platform into a single list:
- Similar change than https://github.com/rubygems/rubygems/commit/29a1be0008e6,
  keep a single source of truth where we store the platform.

  The only change worth highlighing is the platform "maglev".
  It was not part of the supported platform of dependencies,
  so calling `gem 'foo', plaftorm: 'maglev'` would not work.
  However, it was supposed to according to https://github.com/rubygems/rubygems/commit/45ec86e2e528.
  That's why it was possible to do `Bundler.current_ruby.maglev?` or
  `Bundler.current_ruby.maglev_30?`.

  I didn't change the current behaviour and maglev is not supported,
  though I kept the `*maglev` methods as I believe CurrentRuby is
  public API.

https://github.com/rubygems/rubygems/commit/29e219ebcf
2025-01-31 14:34:26 +09:00
Edouard CHIN
57fec1e85f [rubygems/rubygems] Add ruby_34 and ruby_35 as valid platform:
- Fix https://github.com/rubygems/rubygems/pull/8427
- Similar to https://github.com/rubygems/rubygems/commit/7cd19d824d17.
  Tweaked a bit the test supposed to prevent this error by checking
  whether the dep respond to these methods.

https://github.com/rubygems/rubygems/commit/62012eaeb6
2025-01-31 14:34:24 +09:00
Andrew Konchin
afd7d5be5e Skip a new spec for Marshal#dump and Float that fails on i686 2025-01-30 20:43:46 +01:00
Andrew Konchin
d7a5ad2a21 Update to ruby/spec@affef93 2025-01-30 20:43:46 +01:00
Andrew Konchin
ea2dd5b80e Update to ruby/mspec@0aabb3e 2025-01-30 20:43:46 +01:00
Hiroshi SHIBATA
167985dc87 Handle environment where GEM_HOME is not available 2025-01-30 18:13:19 +09:00
Hiroshi SHIBATA
895aa44b81
bin_path_spec.rb relied to available Ruby environment with after make install
But we stub-out GEM_HOME variable for test-bundled-gems and others on ruby/ruby. It means
the installation path mismatched with GEM_HOME variable always. We can't test this example
collectly.

```
1)
Gem.bin_path finds executables of default gems, which are the only files shipped for default gems FAILED
Expected File.exist? "/Users/hsbt/Documents/github.com/ruby/ruby/.bundle/gems/bundler-2.7.0.dev/exe/bundle"
to be truthy but was false
```
2025-01-30 12:52:51 +09:00
Hiroshi SHIBATA
af508a6d10 Skip irb examples, I will handle related workarounds later 2025-01-30 11:24:34 +09:00
Samuel Williams
d3abee739f
Add fallback for hostname if uname isn't available. (#12655) 2025-01-29 01:20:08 +13:00
David Rodríguez
9b2ebfc729 [rubygems/rubygems] Fix bug report template incorrectly showing up
If a gem has an internal error, that should not make `bundle console`
print the bug report template.

https://github.com/rubygems/rubygems/commit/7432a9a084
2025-01-28 15:31:57 +09:00
David Rodríguez
d8394461fd [rubygems/rubygems] Support installing arm native gems on Windows
https://github.com/rubygems/rubygems/commit/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
https://github.com/rubygems/rubygems/commit/1774ac5db1
2025-01-28 15:31:51 +09:00
David Rodríguez
10af7a6a45 [rubygems/rubygems] Use RubyGems helpers for finding a non local tag for specs
https://github.com/rubygems/rubygems/commit/a1d4ec1a3f
2025-01-28 15:31:50 +09:00
David Rodríguez
09b04fefb7 [rubygems/rubygems] Remove unnecessary platform helpers
I think they add unnecessary indirection and inconsistency to the specs.

https://github.com/rubygems/rubygems/commit/609924d985
2025-01-28 15:31:49 +09:00
David Rodríguez
8ad7834796 [rubygems/rubygems] Remove unnecessary test code
It's always going to be either the first or the second platform in the
list so no need to keep an explicit list of all platforms.

https://github.com/rubygems/rubygems/commit/5d3cdb3855
2025-01-28 15:31:49 +09:00
David Rodríguez
9c94b8feaf [rubygems/rubygems] Improve simulating Windows during Bundler specs
https://github.com/rubygems/rubygems/commit/b48168bf1f
2025-01-28 15:31:48 +09:00
David Rodríguez
22359cda1c [rubygems/rubygems] Refactor specs to use platform strings directly
https://github.com/rubygems/rubygems/commit/d24c0c20e3
2025-01-28 15:31:47 +09:00
David Rodríguez
c28ce7604f [rubygems/rubygems] Remove unnecessary mapping
I don't think any supported platform has these names, so the mapping
should be unnecessary.

https://github.com/rubygems/rubygems/commit/6b1bdfc8a8
2025-01-28 15:31:47 +09:00
David Rodríguez
77b1b3be30 [rubygems/rubygems] Fix typo
https://github.com/rubygems/rubygems/commit/639b970c64
2025-01-28 15:31:45 +09:00