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

10388 Коммитов

Автор SHA1 Сообщение Дата
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
Jun Aruga 3504be1bc1 [ruby/irb] Require RDoc in `input-method.rb` again in a limited scope.
RDoc is implemented as soft dependency in IRB. See how the rdoc is required in
the files. I reverted the commit below.

```
$ grep -ril rdoc lib/
lib/irb/cmd/help.rb
lib/irb/completion.rb
lib/irb/easter-egg.rb
lib/irb/input-method.rb
```

---

Revert "Remove `require` in signal handler to avoid ThreadError"

This reverts commit https://github.com/ruby/irb/commit/5f749c613c89.

https://github.com/ruby/irb/commit/b24852058f
2022-08-26 09:57:02 +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
Vít Ondruch 46c3a93982 [ruby/irb] Drop hard dependency on RDoc.
This has been introduced in https://github.com/ruby/irb/commit/026700499dfd,
but it seems that this is just be mistake, otherwise the later handling
of `LoadError` would not be needed.

https://github.com/ruby/irb/commit/54c8df06ff
2022-08-23 18:01:35 +09:00
Yusuke Endoh 983115cf3c [ruby/fileutils] FileUtils.rm* methods swallows only Errno::ENOENT when force is true
... instead of any StandardError.

To behave like the standard `rm` command, it should only ignore
exceptions about not existing files, not every exception. This should
make debugging some errors easier, because the expectation is that `rm
-rf` will succeed if and only if, all given files (previously existent
or not) are removed. However, due to this exception swallowing, this is
not always the case.

From the `rm` man page

> COMPATIBILITY
>
> The rm utility differs from historical implementations in that the -f
> option only masks attempts to remove non-existent files instead of
> masking a large variety of errors.

https://github.com/ruby/fileutils/commit/fa65d676ec

Co-Authored-By: David Rodríguez <deivid.rodriguez@riseup.net>
2022-08-23 16:52:41 +09:00
Yusuke Endoh 96562a517d [ruby/fileutils] Narrow the scope of ensure
The ensure in postorder_traverse was added for [Bug #6756].
The intention was to try to delete the parent directory if it failed to
get the children. (It may be possible to delete the directory if it is
empty.)

However, the ensure region rescue'ed not only "failure to get children"
but also "failure to delete each child". Thus, the following raised
Errno::ENOTEMPTY, but we expect it to raise Errno::EACCES.

```
$ mkdir foo
$ touch foo/bar
$ chmod 555 foo
$ ruby -rfileutils -e 'FileUtils.rm_rf("foo")'
```

This changeset narrows the ensure region so that it rescues only
"failure to get children".

https://github.com/ruby/fileutils/commit/ec5d3b84ea
2022-08-23 16:52:40 +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 c21c9a29ee [rubygems/rubygems] Refactor building metadata dependencies
https://github.com/rubygems/rubygems/commit/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.

https://github.com/rubygems/rubygems/commit/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.

https://github.com/rubygems/rubygems/commit/fbc7a57161
2022-08-23 10:45:57 +09:00
David Rodríguez 59f27445ea [rubygems/rubygems] Implement extra rules for libc versioning
https://github.com/rubygems/rubygems/commit/7e976d790a
2022-08-23 05:50:23 +09:00
David Rodríguez 492e70c7b4 [rubygems/rubygems] Fix `gem install` still choosing musl incorrectly
https://github.com/rubygems/rubygems/commit/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.

https://github.com/rubygems/rubygems/commit/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.

https://github.com/rubygems/rubygems/commit/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
https://github.com/ruby/fileutils/commit/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.

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
Yusuke Endoh 6bcb473d9c [ruby/error_highlight] Apply ErrorHighlight::CoreExt to TypeError and ArgumentError
https://github.com/ruby/error_highlight/commit/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.

https://github.com/ruby/cgi/commit/c2729c7f33
2022-08-16 19:12:03 +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
Yusuke Endoh d9f1b8baa3 [ruby/error_highlight] Add a note about the current limitation of ErrorHighlight.spot
https://github.com/ruby/error_highlight/commit/489ce80a62
2022-08-12 14:04:41 +09:00
Yusuke Endoh 1b32a4c7bb [ruby/error_highlight] Bump version
https://github.com/ruby/error_highlight/commit/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.

https://github.com/ruby/error_highlight/commit/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.

https://github.com/ruby/error_highlight/commit/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
https://github.com/ruby/ruby/commit/e4e054e3ce40 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.

https://github.com/ruby/rdoc/commit/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)
https://github.com/ruby/rdoc/commit/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.

https://github.com/rubygems/rubygems/commit/d2bf1b86eb
2022-08-06 15:41:46 +09:00
David Rodríguez 8dd63b89d9 [rubygems/rubygems] Move comment where the actual replacement happens
https://github.com/rubygems/rubygems/commit/d60acdf80d
2022-08-06 15:41:46 +09:00
David Rodríguez 4ea521f6c7 [rubygems/rubygems] Remove unclear comment
https://github.com/rubygems/rubygems/commit/3a843c1ac7
2022-08-06 15:41:45 +09:00
David Rodríguez af40af45b2 [rubygems/rubygems] Extract `SourceList#get_with_fallback`
https://github.com/rubygems/rubygems/commit/9dbc4757a8
2022-08-06 15:41:45 +09:00
David Rodríguez f310ac1cb2 [rubygems/rubygems] Include backtrace with crashes by default
https://github.com/rubygems/rubygems/commit/3cc3bfd371
2022-08-05 16:37:03 +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
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
https://github.com/rubygems/rubygems/commit/425b78637f
2022-08-04 13:36:45 +09:00
David Rodríguez 0591780a74 [rubygems/rubygems] Extract entry.full_name to a variable
https://github.com/rubygems/rubygems/commit/3973773005
2022-08-04 13:36:44 +09:00
tompng b54f26b704 [ruby/irb] shortcut colorize_code to speedup pretty_print
https://github.com/ruby/irb/commit/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.

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
Ilya Dyakonov 4f00ee8d47 [rubygems/rubygems] fix platform matching for index specs
https://github.com/rubygems/rubygems/commit/f087f1b590
2022-08-03 06:56:36 +09:00
David Rodríguez 20936eb3a9 [rubygems/rubygems] Warn (rather than crash) when setting `nil` specification versions
https://github.com/rubygems/rubygems/commit/a4ba1a4d97
2022-08-03 06:56:18 +09:00
David Rodríguez f70b26af47 [rubygems/rubygems] Array is already uniq, no need to deduplicate it
https://github.com/rubygems/rubygems/commit/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>

https://github.com/rubygems/rubygems/commit/3e62ca776d
2022-08-02 18:35:38 +09:00