Граф коммитов

647 Коммитов

Автор SHA1 Сообщение Дата
Hiroshi SHIBATA f5df47d1f3 Merge RubyGems/Bundler master
6214d00b23
2022-10-18 16:33:15 +09:00
David Rodríguez 5fa18a7b0c [rubygems/rubygems] Fix bad spec wording
https://github.com/rubygems/rubygems/commit/06faad1e05
2022-10-18 16:33:15 +09:00
David Rodríguez e956caea88 [rubygems/rubygems] Extract matcher for slow perf spec
https://github.com/rubygems/rubygems/commit/1c0eb63c6a
2022-10-18 16:33:15 +09:00
David Rodríguez 804ae4ea12 [rubygems/rubygems] Simplify SpecGroup creation
https://github.com/rubygems/rubygems/commit/788e46e152
2022-10-18 16:33:15 +09:00
David Rodríguez 358fe26b31 [rubygems/rubygems] Fix little UI issue when bundler shows duplicated gems in a list
https://github.com/rubygems/rubygems/commit/3f71d882e9
2022-10-06 05:13:39 +09:00
David Rodríguez b2668248b6 [rubygems/rubygems] Make sure RSpec diffs don't omit the different part
We sometimes check assertions on lockfile contents, which involves
comparing a reasonably long string. Sometimes RSpec is not able to show
the part of the string that's actually different, making it hard to
figure out the issue.

Configuring this setting should fix the issue in most cases.

https://github.com/rubygems/rubygems/commit/5ad8ee499e
2022-10-04 06:22:50 +09:00
Victor Gama bc6c1e0e25 [rubygems/rubygems] Copy template contents instead of file and perms
This allows the file to be created without copying permissions
from Bundler's installation source. The previous behaviour was
noticed after installing Ruby through brew, and using bundle
init, which yielded a read-only Gemfile.

https://github.com/rubygems/rubygems/commit/839a06851d
2022-10-03 20:41:45 +09:00
Nobuyoshi Nakada bf72afa766
Remove warning for old TLS version connection
RubyGems.org already has refused connection requests using older than
TLS 1.2.
2022-09-15 14:48:47 +09:00
David Rodríguez e0cd466ae7 [rubygems/rubygems] Fix unused variable warning
https://github.com/rubygems/rubygems/commit/ca8d47e53a
2022-09-08 20:44:35 +09:00
David Rodríguez 24fd2f73d0 Resync Bundler & RubyGems 2022-09-08 11:25:03 +09:00
David Rodríguez 1f77cc3894 [rubygems/rubygems] Fix `set` not being found when running specs on dev rubies
https://github.com/rubygems/rubygems/commit/c5b2960388
2022-09-06 17:11:47 +09:00
David Rodríguez c664264c07 [rubygems/rubygems] Add `syntax_suggest` to exemption list in setup specs
https://github.com/rubygems/rubygems/commit/f9a51e4380
2022-09-06 17:11:47 +09:00
David Rodríguez 6bc6c8d031 [rubygems/rubygems] Remove no longer needed `fiddle` hacks
RubyInstaller has released patch versions backporting their changes to
not load `fiddle` on boot, so all these are no longer necessary.

https://github.com/rubygems/rubygems/commit/05a307deb2
2022-09-05 21:21:15 +09:00
Hiroshi SHIBATA 3eca1e438d Merge 16c3535413 2022-09-05 14:37:12 +09:00
Mike Dalessio 45fe7f7575
[rubygems/rubygems] Feature: `bundle add` supports `--path` option
https://github.com/rubygems/rubygems/commit/32bee01fbe
2022-09-05 11:43:14 +09: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.

https://github.com/rubygems/rubygems/commit/faf4ef46bc
2022-09-05 11:43:14 +09:00
shields 8799c91205 [rubygems/rubygems] Add platform :windows as a shortcut for all Windows platforms
https://github.com/rubygems/rubygems/commit/f3c49ad3f7
2022-08-29 00:33:15 +09:00
Aleksandr Varnin 381d8e43ce [rubygems/rubygems] Bundler: make to_lock consistent between Gem::Dependency and Bundler::Dependency
https://github.com/rubygems/rubygems/commit/971d57cf5a
2022-08-28 02:04:14 +09:00
David Rodríguez ad8774f8e5 [rubygems/rubygems] Fix another regression for sorbet
Recently a changed was introduced to update the resolver platforms after
it has been created, in order to remove the "ruby" platform from it if
it's to be removed from the lockfile. However, it did not update the
`@resolving_only_for_ruby` instance variable in that case, so the
resolver was not properly doing the right thing anymore.

To fix this, I tweaked the code to restore not changing resolver
platforms after the resolver has been instantiated.

https://github.com/rubygems/rubygems/commit/8fbc30a1d0
2022-08-25 23:39:02 +09:00
David Rodríguez 0ad9cc1696 [rubygems/rubygems] Backport non-gnu libc on linux platform matching to Bundler
https://github.com/rubygems/rubygems/commit/703373b41f

Co-authored-by: Loic Nageleisen <loic.nageleisen@gmail.com>
2022-08-24 17:59:15 +09:00
Takuya Noguchi 7c784f0a67 [rubygems/rubygems] Bundler: avoid use of "can not" in spec literals
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

https://github.com/rubygems/rubygems/commit/73b5cf9bd1
2022-08-23 15:33:34 +09:00
Takuya Noguchi 22a416a3bb [rubygems/rubygems] Bundler: update the link suggested on error with the new one
Also typo is fixed.

Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

https://github.com/rubygems/rubygems/commit/9c1ea52ddf
2022-08-23 14:28:47 +09:00
Hiroshi SHIBATA f69244cee8 Merge rubygems/bundler HEAD
Pick from 6b3a5a9ab0
2022-08-23 10:45:57 +09:00
David Rodríguez 4790d0accd [rubygems/rubygems] Fix conservative update downgrading top level gems
When `--conservative` is passed, explicit unlocks are set for top level
gems via `@unlock[:gems]`, so that only those particular gems are
allowed to be updated.

When we compute the "base resolve" from the lockfile (the set of gems
whose versions should be kept pinned by the resolver), we always exclude
gems explicitly unlocked through `@unlock[:gems]` from it. This is done
by the `converge_specs` method.

However, the `converge_specs` method is also used for figuring out
additional lower bound requirements from the lockfile. But in this case,
even if gems are explicitly unlock in `@unlock[:gems]`, we still want to
add the additional requirement, so that gems are not downgraded by the
resolver.

So the solution is to move the line filtering out gems in
`@unlock[:gems]` from the `converged_specs` method out of that method,
so that it only applies for computing the "base resolve", but not the
addtional lower bound requirements.

https://github.com/rubygems/rubygems/commit/405119bd7b
2022-08-23 10:45:57 +09:00
David Rodríguez a9509068db [rubygems/rubygems] Make `compact_index_api_missing` server more strict
The compact index should not request any marshaled gemspecs whatsoever.

https://github.com/rubygems/rubygems/commit/6dbd44d0c0
2022-08-23 10:45:57 +09:00
David Rodríguez 560941e711 [rubygems/rubygems] Fix edge case where `bundler/inline` unintentionally skips install
If the application has the `no_install` setting set for `bundle
package`, then `bundler/inline` would silently skip installing any gems.

https://github.com/rubygems/rubygems/commit/7864f49b27
2022-08-21 17:54:11 +09:00
David Rodríguez b87ddd7538 [rubygems/rubygems] Fix `bundle platform` crash when there's a lockfile with no Ruby locked
https://github.com/rubygems/rubygems/commit/49fc54e87d
2022-08-21 17:53:40 +09:00
David Rodríguez e77c8397c2 [rubygems/rubygems] Fix Ruby platform incorrectly removed on `bundle update`
https://github.com/rubygems/rubygems/commit/0d321c9e3a
2022-08-15 17:42:16 +09:00
David Rodríguez 466a760e18 [rubygems/rubygems] Fix yanked gems being unintentionally update when other gems are unlocked
This is a regression from a change intended to raise errors when user
puts a gem under an incorrect source in the Gemfile by mistake. To fix
the issue, we revert the change that caused it and implement it in a
different way that restores the resolver independency from real
specifications. Now it deals only with names and versions and does not
try to materialize anything into real specifications before resolving.

https://github.com/rubygems/rubygems/commit/d2bf1b86eb
2022-08-06 15:41:46 +09:00
David Rodríguez 5a9db23734 [rubygems/rubygems] Automatically remove "ruby" from lockfile if incomplete
https://github.com/rubygems/rubygems/commit/69d0b4e10b
2022-08-05 16:36:42 +09:00
David Rodríguez 851b3aa7dd [rubygems/rubygems] Fix `bundle outdated --strict`
It should be an alias of `--filter-strict`.

`--update-strict` is essentially a dummy option with no special behavior
associated and should be deprecated.

https://github.com/rubygems/rubygems/commit/ec1e5d83c8
2022-08-03 16:33:53 +09:00
David Rodríguez 35c65e7ba6 [rubygems/rubygems] Fix conservative updates regardless of `--strict`
https://github.com/rubygems/rubygems/commit/c9a1d69a8d
2022-08-03 16:33:52 +09:00
Hiroshi SHIBATA 71794a75db Merge rubygems/bundler HEAD
Pick from 8331e63263
2022-08-03 13:14:10 +09:00
David Rodríguez 3e4fedca4e [rubygems/rubygems] Preserve the previous behavior of raising an error when in frozen mode
https://github.com/rubygems/rubygems/commit/6e35a6edfe
2022-08-02 16:10:19 +09:00
David Rodríguez bc90090672 [rubygems/rubygems] Check for errors in error stream
https://github.com/rubygems/rubygems/commit/7b0f7804f2
2022-08-02 16:10:18 +09:00
David Rodríguez f4f681463f [rubygems/rubygems] Don't discard candidates matching ruby metadata
Do dependency filtering and materialization in one step. Before,
dependency filtering would not consider ruby metadata so it would
discard variants that end up not being materializable in the end.

https://github.com/rubygems/rubygems/commit/0c0d40d417

Co-authored-by: Ian Ker-Seymer <ian.kerseymer@shopify.com>
2022-08-02 16:10:18 +09:00
David Rodríguez 13305bf0c9 [rubygems/rubygems] Fix crash when running `bundle outdated` in debug mode
Previously it would crash like this:

````
$ /Users/deivid/.asdf/installs/ruby/3.1.2/bin/ruby -I/Users/deivid/Code/rubygems/rubygems/bundler/spec -r/Users/deivid/Code/rubygems/rubygems/bundler/spec/support/artifice/fail.rb -r/Users/deivid/Code/rubygems/rubygems/bundler/spec/support/hax.rb /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/bin/bundle outdated --patch --strict --filter-patch
Running `bundle outdated --filter-patch --patch --strict` with bundler 2.4.0.dev
Found changes from the lockfile, re-resolving dependencies because bundler is unlocking Using a local server, bundler won't use the CompactIndex API
Fetching source index from file:///Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/remote4/
Resolving dependencies...
--- ERROR REPORT TEMPLATE -------------------------------------------------------

```
RuntimeError: LazySpecification has not been materialized yet (calling :loaded_from [])
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/lazy_specification.rb:147:in `method_missing'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli/outdated.rb:214:in `gem_column_for'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli/outdated.rb:174:in `block in print_gems_table'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli/outdated.rb:173:in `map'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli/outdated.rb:173:in `print_gems_table'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli/outdated.rb:123:in `run'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli.rb:420:in `outdated'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli.rb:31:in `dispatch'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/cli.rb:25:in `start'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/exe/bundle:48:in `block in <top (required)>'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/gems/bundler-2.4.0.dev/exe/bundle:36:in `<top (required)>'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/bin/bundle:25:in `load'
  /Users/deivid/Code/rubygems/rubygems/bundler/tmp/1/gems/system/bin/bundle:25:in `<main>'
```
````

https://github.com/rubygems/rubygems/commit/23c46f3b57
2022-08-01 23:14:23 +09:00
David Rodríguez 5c13adb746 [rubygems/rubygems] Fix comment incorrectly copied from another spec
https://github.com/rubygems/rubygems/commit/9be5eae9cf
2022-08-01 23:14:22 +09:00
David Rodríguez 030050cdfa [rubygems/rubygems] Make `--standalone` play nice with `--local`
I'm not sure if using relative paths in the generated script is best for
this case, since it makes the script not movable, but that can be
improved later.

https://github.com/rubygems/rubygems/commit/7f5bdbb842
2022-07-30 04:24:25 +09:00
Hiroshi SHIBATA bfd09b1116 Merge rubygems master from 446cc57a7c 2022-07-29 15:46:15 +09:00
moe c3d9849df9 [rubygems/rubygems] Add ignore_funding_requests config flag
https://github.com/rubygems/rubygems/commit/ab302f72c9
2022-07-27 05:39:40 +09:00
David Rodríguez 163e3f075f [rubygems/rubygems] Use main as default branch for Bundler specs
https://github.com/rubygems/rubygems/commit/482077d185
2022-07-27 01:04:11 +09:00
Hiroshi SHIBATA 9e6d07f346 Merge rubygems/bundler HEAD
Merge from 2af2520b4a
2022-07-26 14:38:17 +09:00
Takuya Noguchi 631b34ef95 [rubygems/rubygems] Bundler: change error/warning message for multiple global sources
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

https://github.com/rubygems/rubygems/commit/316564b8fc
2022-07-19 23:51:47 +09:00
David Rodríguez 01560e1c53 [rubygems/rubygems] Improve error message when gems cannot be found
Include the source of each gem.

https://github.com/rubygems/rubygems/commit/a0bed2fb79
2022-07-18 19:07:47 +09:00
Takuya Noguchi 5081d0dd5c [rubygems/rubygems] bundler: fix typo in inline RuboCop config
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

https://github.com/rubygems/rubygems/commit/e11f5a143b
2022-07-17 18:27:00 +09:00
David Rodríguez ef2d673052 [rubygems/rubygems] Show a proper error if extension dir is not writable
Instead of showing the bug report template.

https://github.com/rubygems/rubygems/commit/0c8b6f7dd5
2022-07-17 17:47:23 +09:00
David Rodríguez 76de7a92b9 [rubygems/rubygems] Fix misleading error if compact index cannot be copied
Previously if `~/.bundle/cache/compact_index/rubygems.org.*/version`
were owned by root with read-only access, `bundle install` would fail
with a misleading error message. For example:

```
There was an error while trying to write to `/tmp/bundler-compact-index-20220711-1823-npllre/versions`. It is
likely that you need to grant write permissions for that path.
```

This happened because the EACCESS error was caught by
`SharedHelpers.filesystem_access`, which makes it look like the target
directory is at fault instead of the source.

We can't simply drop this guard because that causes the opposite
problem: the permission error appears to come from the source instead of
the target, since `CompactIndexClient::Cache#lines` also wraps read
access errors.

Instead, bring a minimal implementation of `FileUtils.cp` and nest calls
to `SharedHelpers.filesystem_access` properly.

https://github.com/rubygems/rubygems/commit/320822c070

Co-authored-by: Stan Hu <stanhu@gmail.com>
2022-07-14 15:06:09 +09:00
Hiroshi SHIBATA 437a5ae9d6 Merge RubyGems and Bundler master 2022-07-13 14:11:55 +09:00
David Rodríguez 7dd0a22588 [rubygems/rubygems] Fix `simulate_windows` helper
It should also set the proper class variable so that `Gem.win_platform?`
returns true.

https://github.com/rubygems/rubygems/commit/0fbf6904d1
2022-07-08 02:22:35 +09:00