Commit graph

11330 commits

Author SHA1 Message Date
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>

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.

405119bd7b
2022-08-23 10:45:57 +09:00
David Rodríguez
c21c9a29ee [rubygems/rubygems] Refactor building metadata dependencies
fa60f1fe43
2022-08-23 10:45:57 +09:00
David Rodríguez
29c443fedc [rubygems/rubygems] Remove unnecessary mixin inclusion
It's already included by the parent.

3ffe389c44
2022-08-23 10:45:57 +09:00
David Rodríguez
b30fc03e92 [rubygems/rubygems] Centralize loading Bundler::MatchPlatform mixin
It's explicitly loaded when monkeypatching RubyGems, which we do very
early. So neither autoloading it, nor explicitly loading it anywhere
else is necessary.

fbc7a57161
2022-08-23 10:45:57 +09:00
David Rodríguez
59f27445ea [rubygems/rubygems] Implement extra rules for libc versioning
7e976d790a
2022-08-23 05:50:23 +09:00
David Rodríguez
492e70c7b4 [rubygems/rubygems] Fix gem install still choosing musl incorrectly
1b9f7f50a5
2022-08-23 05:50:22 +09:00
David Rodríguez
9819283044 [rubygems/rubygems] Handle non-gnu libc on linux platforms in RubyGems
Attempting to install a gem published as both *-linux and *-linux-musl
results in the incorrect gem being picked up, causing build failures due
to binary incompatibility. This is caused by the `nil` wildcard
swallowing the libc information upon version comparison.

Handle the linux case by performing only non-wildcard equality on the
version and asserting 'gnu' and nil equivalence, while preserving the
current behaviour for other OSes.

9eead86abc

Co-authored-by: Loic Nageleisen <loic.nageleisen@gmail.com>
2022-08-23 05:50:21 +09:00
Loic Nageleisen
615f79be3c [rubygems/rubygems] Test platform's version-ness consistently
The symmetry with the "for command line" case is made more apparent.

ab85d3558f
2022-08-23 05:50:20 +09:00
David Rodríguez
70f69f8539 [ruby/fileutils] Fix mkdir_p hanging on Windows when trying to create a file on a offline drive
9cc6a082d7
2022-08-22 10:12:25 +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.

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
49fc54e87d
2022-08-21 17:53:40 +09:00
Yusuke Endoh
6bcb473d9c [ruby/error_highlight] Apply ErrorHighlight::CoreExt to TypeError and ArgumentError
defcaf1beb
2022-08-19 18:34:15 +09:00
schneems
490af8dbdb Sync SyntaxSuggest
```
$ tool/sync_default_gems.rb syntax_suggest
```
2022-08-19 10:02:24 +09:00
Jean Boussier
3850113e20 [ruby/cgi] Implement CGI.url_encode and CGI.url_decode
[Feature #18822]

Ruby is somewhat missing an RFC 3986 compliant escape method.

c2729c7f33
2022-08-16 19:12:03 +09:00
David Rodríguez
e77c8397c2 [rubygems/rubygems] Fix Ruby platform incorrectly removed on bundle update
0d321c9e3a
2022-08-15 17:42:16 +09:00
Yusuke Endoh
d9f1b8baa3 [ruby/error_highlight] Add a note about the current limitation of ErrorHighlight.spot
489ce80a62
2022-08-12 14:04:41 +09:00
Yusuke Endoh
1b32a4c7bb [ruby/error_highlight] Bump version
6edf0a0a5d
2022-08-10 21:51:51 +09:00
Yusuke Endoh
3a58009066 [ruby/error_highlight] Make backtrace_location keyword work
We had to keep backtrace_location before opts is overwritten.

2735e4681a
2022-08-10 21:19:10 +09:00
Yusuke Endoh
99e7fa5b37 [ruby/error_highlight] Make ErrorHighlight.spot accept Exception (https://github.com/ruby/error_highlight/pull/25)
... and move things from core_ext.rb to base.rb.
This will confine CRuby-dependent things to ErrorHighlight.spot.

22d1dd7824
2022-08-10 18:37:13 +09:00
Hiroshi SHIBATA
44264b4fee Merge rubygems/bundler HEAD.
Pick from dfbb5a3811
2022-08-09 12:05:19 +09:00
Nobuyoshi Nakada
5beb75ce8d
[ruby/rdoc] Allow multiple footnotes without in-between blank lines
e4e054e3ce used four footnotes
without blank lines.  And the ChangeLog generated from that commit
resulted in ``undefined method `parts' for nil`` error.

For now, let a footnote terminated by the next footnote mark.

Also refined the error message when undefined footnote is used.

a7f290130b
2022-08-08 01:12:49 +09:00
Burdette Lamar
23a84d53c6 [ruby/rdoc] [DOC] Removes remaining old Markup Reference (https://github.com/ruby/rdoc/pull/910)
4e44c9c6cf
2022-08-07 21:07:23 +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.

d2bf1b86eb
2022-08-06 15:41:46 +09:00
David Rodríguez
8dd63b89d9 [rubygems/rubygems] Move comment where the actual replacement happens
d60acdf80d
2022-08-06 15:41:46 +09:00
David Rodríguez
4ea521f6c7 [rubygems/rubygems] Remove unclear comment
3a843c1ac7
2022-08-06 15:41:45 +09:00
David Rodríguez
af40af45b2 [rubygems/rubygems] Extract SourceList#get_with_fallback
9dbc4757a8
2022-08-06 15:41:45 +09:00
David Rodríguez
f310ac1cb2 [rubygems/rubygems] Include backtrace with crashes by default
3cc3bfd371
2022-08-05 16:37:03 +09:00
David Rodríguez
5a9db23734 [rubygems/rubygems] Automatically remove "ruby" from lockfile if incomplete
69d0b4e10b
2022-08-05 16:36:42 +09:00
Alan Wu
e5a3f23256 Use $(bindir) for path to executable in mkmf
For the macOS -bundle_loader linker option, we need a path to the
Ruby exectuable. $(RUBY) is not necessarily a path since it could
be a command line invocation. That happens during build with
runruby.rb and can happen post installation if the user passes
the --ruby option to a extconf.rb. Use $(bindir) to locate
the executable instead.

Before installation, $(bindir) doesn't exist, so we need to be
able to override $(BUILTRUBY) in such situations so test-spec
and bundled extensions could build. Use a new mkmf global,
$builtruby, to do this; set it in fake.rb and in extmk.rb.

Our build system is quite complex...
2022-08-04 16:29:22 +09:00
Yuta Saito
50d81bfbc1 Link ext bundles with bundle loader option for newer ld64
ld64 shipped with Xcode 14 emits a warning when using `-undefined
dynamic_lookup`.

```
ld: warning: -undefined dynamic_lookup may not work with chained fixups
```

Actually, `-undefined dynamic_lookup` doesn't work when:

1. Link a *shared library* with the option
2. Link it with a program that uses the chained-fixup introduced from
   macOS 12 and iOS 15
because `-undefined dynamic_lookup` uses lazy-bindings and they won't be
bound while dyld fixes-up by traversing chained-fixup info.

However, we build exts as *bundles* and they are loaded only through
`dlopen`, so it's safe to use `-undefined dynamic_lookup` in theory.
So the warning produced by ld64 is false-positive, and it results
failure of option checking in configuration. Therefore, it would be an
option to ignore the warning during our configuration.

On the other hand, `-undefined dynamic_lookup` is already deprecated on
all darwin platforms except for macOS, so it's good time to get rid of
the option. ld64 also provides `-bundle_loader <executable>` option,
which allows to resolve symbols defined in the executable symtab while
linking. It behaves almost the same with `-undefined dynamic_lookup`,
but it makes the following changes:

1. Require that unresolved symbols among input objects must be defined
   in the executable.
2. Lazy symbol binding will lookup only the symtab of the bundle loader
   executable. (`-undefined dynamic_lookup` lookups all symtab as flat
   namespace)

This patch adds `-bundle_loader $(RUBY)` when non-EXTSTATIC
configuration by assuming ruby executable can be linked before building
exts.

See "New Features" subsection under "Linking" section for chained fixup
https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes
2022-08-04 16:29:22 +09:00
David Rodríguez
542040fb83 [rubygems/rubygems] Warn dangling symlinks
425b78637f
2022-08-04 13:36:45 +09:00
David Rodríguez
0591780a74 [rubygems/rubygems] Extract entry.full_name to a variable
3973773005
2022-08-04 13:36:44 +09:00
tompng
b54f26b704 [ruby/irb] shortcut colorize_code to speedup pretty_print
8a074a6904
2022-08-04 08:37:03 +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.

ec1e5d83c8
2022-08-03 16:33:53 +09:00
David Rodríguez
35c65e7ba6 [rubygems/rubygems] Fix conservative updates regardless of --strict
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
Ilya Dyakonov
4f00ee8d47 [rubygems/rubygems] fix platform matching for index specs
f087f1b590
2022-08-03 06:56:36 +09:00
David Rodríguez
20936eb3a9 [rubygems/rubygems] Warn (rather than crash) when setting nil specification versions
a4ba1a4d97
2022-08-03 06:56:18 +09:00
David Rodríguez
f70b26af47 [rubygems/rubygems] Array is already uniq, no need to deduplicate it
3212ae14b7
2022-08-02 21:57:52 +09:00
Takuya Noguchi
b81858cf6f [rubygems/rubygems] Fix arguments for bundle-config(1) docs
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>

3e62ca776d
2022-08-02 18:35:38 +09:00
David Rodríguez
3e4fedca4e [rubygems/rubygems] Preserve the previous behavior of raising an error when in frozen mode
6e35a6edfe
2022-08-02 16:10:19 +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.

0c0d40d417

Co-authored-by: Ian Ker-Seymer <ian.kerseymer@shopify.com>
2022-08-02 16:10:18 +09:00
David Rodríguez
9189c2d5ef [rubygems/rubygems] Materializing for resolution already filters platforms
9f4ba9ebb0
2022-08-02 16:10:17 +09:00
David Rodríguez
8c98f7be57 [rubygems/rubygems] Remove unnecessary local variable
a997210473
2022-08-02 16:10:17 +09:00
David Rodríguez
5487e76374 [rubygems/rubygems] Prefer reverse+find to select+last
ffb161bb69
2022-08-02 16:10:16 +09:00
David Rodríguez
bc0de1e162 [rubygems/rubygems] Only need to filter platforms when materialization is not strict
9d878cbda0
2022-08-02 16:10:16 +09:00
David Rodríguez
91b9bd6234 [rubygems/rubygems] This should go through the standard source search logic
087e3e4e3b
2022-08-02 16:10:15 +09:00
David Rodríguez
35e508d13e [rubygems/rubygems] Refactor materialization conditions
08e1554fb6
2022-08-02 16:10:14 +09:00