Commit graph

77079 commits

Author SHA1 Message Date
Nobuyoshi Nakada
be81495c16
Silence dozens of useless warnings from nm on macOS 2023-01-31 19:42:01 +09:00
Takashi Kokubun
337189598a
Fix a broken matrix (#7207)
$arch and $configure seem to be just ignored in #7205.
2023-01-30 23:39:33 -08:00
Takashi Kokubun
6d1077974f
Use matrix.entry for the Ubuntu workflow (#7205)
This seems easier to understand.

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-01-30 22:44:24 -08:00
Mau Magnaguagno
5b67c15cd8
[ruby/openssl] [DOC] Remove repeated example from Digest
5a36cc3cb2
2023-01-31 13:14:06 +09:00
Hiroshi SHIBATA
fe7d4eed25
Manually merged https://github.com/ruby/net-http/pull/106
Co-authored-by: Peter Zhu <peter@peterzhu.ca>
Co-authored-by: BurdetteLamar <burdettelamar@yahoo.com>
2023-01-31 13:14:05 +09:00
Charles Oliver Nutter
0ee819b71d
Initial move to SnakeYAML Engine
See jruby/jruby#7570 for some of the justification for this move. We only
require the parser from SnakeYAML, but in the original form it is
encumbered with Java object serialization code that keeps getting
flagged as a CVE risk. We disagree with the assessment, at least
as it pertains to JRuby (we do not use the code in question) but
our inclusion of the library continues to get flagged by auditing
tools.

This commit starts the process of moving to the successor library,
SnakeYAML Engine. The parser API is largely unchanged, except as
seen in this commit. No Java exceptions are thrown, but a number
of Psych tests fail (possibly due to Engine being YAML 1.2 only).
2023-01-31 13:14:05 +09:00
Charles Oliver Nutter
29133794a3
[ruby/psych] Update for stricter 1.2 syntax
This allows these tests to pass on SnakeYAML Engine -- which is a
1.2-only YAML library -- while still passing on libyaml 1.1.

f44269fc9b
2023-01-31 13:14:05 +09:00
NARUSE, Yui
b0b61623ad Add quotes to backport field 2023-01-31 10:53:57 +09:00
Hiroshi SHIBATA
d3822c9a8a Merge RubyGems/Bundler master.
Pick from 5ace20dbec
2023-01-31 10:49:08 +09:00
David Rodríguez
4cbfd87e5a [rubygems/rubygems] Allow disabling RubyGems require decorations
Currently Bundler needs to do cumbersome operations to revert custom
RubyGems require on a `bundler/setup` context. This causes issues when
third party gems also monkeypatch require, since Bundler will also undo
those decorations.

This commit allows it to use the simpler approach of properly telling
RubyGems that it needs to default to built-in require without any extra
magic.

1df5009e14

Co-authored-by: Xavier Noria <fxn@hashref.com>
2023-01-31 10:49:08 +09:00
David Rodríguez
022acb9593 [rubygems/rubygems] Don't load Bundler from RubyGems tests
c2e4cb7b5e
2023-01-31 10:49:08 +09:00
Mike Dalessio
927141a555 [rubygems/rubygems] Add test for old lockfile with new ruby version
Given an existing application using native gems (e.g., nokogiri)
And a lockfile generated with a stable ruby version
When we test the application against ruby-head and `bundle install`
Then bundler should fall back to the generic ruby platform gem

Note that this test has been passing since 45931ac9

0ecc6de378
2023-01-31 10:49:08 +09:00
Tim Bates
369ed03cd4 [rubygems/rubygems] Fix issue with extensions not compiling properly using inline gemfile
fa6e6ea95c
2023-01-31 10:49:08 +09:00
Étienne Barrié
70eedef32a [ruby/reline] Splat is always an Array
82095bd62b
2023-01-31 09:33:49 +09:00
git
7439ccf0ed * expand tabs. [ci skip]
Please consider using misc/expand_tabs.rb as a pre-commit hook.
2023-01-30 23:43:40 +00:00
Eric Wong
0285aa87f1 file.c: add some endif labels where appropriate
"Appropriate" for me being ifdefs which:

1) span enough lines to be hard-to-follow (I need big fonts to see)

2) nested within other ifdefs, or within large functions
   (I have a short attention span)

rb_file_expand_path_internal is the prime example of a large
function I struggle to understand due to the amount of
platform-specific ifdefs.  Hopefully this helps others with poor
vision and/or short attention spans.
2023-01-30 23:43:15 +00:00
Nobuyoshi Nakada
3a7367ccc3 mkconfig: Map includedir only for system ruby
Only when installing to the system path on macOS, prepend '$(SDKROOT)'
and remap `includedir`.
Fix https://github.com/rbenv/ruby-build/discussions/2123
2023-01-31 06:33:16 +09:00
Takashi Kokubun
344c16eba4
Avoid using a weird syntax for documentation
Following up 465bd972ec.

If the actual implementation still resides in C, it should be
documented in C just like all other places.
2023-01-30 13:18:19 -08:00
Takashi Kokubun
006682d391
Avoid leaving an uneeded comment
465bd972ec didn't need to leave the obsoleted code.
2023-01-30 13:12:34 -08:00
Jimmy Miller
07d1b3ddc3
YJIT: Add splat optimized_send (#7167) 2023-01-30 15:54:09 -05:00
Jimmy Miller
b32e1169c9
YJIT: Initial implementation of splat with optional params (#7166) 2023-01-30 15:51:55 -05:00
Peter Zhu
c4cc3be195 Remove dead code in shapes.c and shapes.h 2023-01-30 14:55:20 -05:00
Takashi Kokubun
2e0f3b5546
YJIT: Fix BorrowMutError on GC.compact (#7176)
YJIT: Fix BorrowMutError
2023-01-30 11:16:33 -08:00
Takashi Kokubun
bc0dc9d40e
YJIT: Skip defer_compilation for fixnums if possible (#7168)
* YJIT: Skip defer_compilation for fixnums if possible

* YJIT: It should be Some(false)

* YJIT: Define two_fixnums_on_stack on Context
2023-01-30 13:55:00 -05:00
Alan Wu
e1ffafb285
YJIT: Inline return address callback (#7198)
This makes it so that the generator and the output code read in the same
order. I think it reads better this way.
2023-01-30 12:50:08 -05:00
Mat Sadler
cb06006213 [rubygems/rubygems] normalise manifest path from cargo on windows
23b5ca5fc4
2023-01-30 17:39:48 +00:00
Mat Sadler
c5a34f5b56 [rubygems/rubygems] better error message if cargo metadata doesn't contain the package we expect
cb7e6d1577
2023-01-30 17:39:48 +00:00
Mat Sadler
b4defea362 [rubygems/rubygems] install rust extensions into expected directory nesting
85ea86d348
2023-01-30 17:39:47 +00:00
Mat Sadler
ca951f6719 [rubygems/rubygems] use cargo to get crate name
the final copying of the extension into place has been slimmed
down, reflecting that it only needs to copy a single file, rather
than replicating the more involved process used for a C ext

this also refactors #build so that #cargo_crate_name only needs
to be called once, and hopefully the build flow is easier to
understand

5a0d7f2e6c
2023-01-30 17:39:47 +00:00
Mat Sadler
00e1ee4a7e [rubygems/rubygems] don't force Cargo.lock to be in gem root
371044c0ab
2023-01-30 17:39:46 +00:00
Mat Sadler
0c2b43462f [rubygems/rubygems] remove unused files in cargo builder test fixtures
233847513b
2023-01-30 17:39:46 +00:00
Jeremy Evans
eccfc978fd Fix parsing of regexps that toggle extended mode on/off inside regexp
This was broken in ec3542229b. That commit
didn't handle cases where extended mode was turned on/off inside the
regexp.  There are two ways to turn extended mode on/off:

```
/(?-x:#y)#z
/x =~ '#y'

/(?-x)#y(?x)#z
/x =~ '#y'
```

These can be nested inside the same regexp:

```
/(?-x:(?x)#x
(?-x)#y)#z
/x =~ '#y'
```

As you can probably imagine, this makes handling these regexps
somewhat complex. Due to the nesting inside portions of regexps,
the unassign_nonascii function needs to be recursive.  In
recursive mode, it needs to track both opening and closing
parentheses, similar to how it already tracked opening and
closing brackets for character classes.

When scanning the regexp and coming to `(?` not followed by `#`,
scan for options, and use `x` and `i` to determine whether to
turn on or off extended mode.  For `:`, indicting only the
current regexp section should have the extended mode
switched, recurse with the extended mode set or unset. For `)`,
indicating the remainder of the regexp (or current regexp portion
if already recursing) should turn extended mode on or off, just
change the extended mode flag and keep scanning.

While testing this, I noticed that `a`, `d`, and `u` are accepted
as options, in addition to `i`, `m`, and `x`, but I can't see
where those options are documented.  I'm not sure whether or not
handling  `a`, `d`, and `u` as options is a bug.

Fixes [Bug #19379]
2023-01-30 08:51:12 -08:00
Jean Boussier
3f54d09a5b bignum.c: rb_int_parse_cstr handle 0 strings
[Bug #19390]

We shouldn't check the string length when skipping zeros, as the
string might only contains zero characters, resulting in an empty string.
2023-01-30 14:42:40 +01:00
Nobuyoshi Nakada
4bc343b436 Extract check for RSTRING_SOCKLEN 2023-01-30 21:55:37 +09:00
git
1c7bf378a1 Update default gems list at b432867429 [ci skip] 2023-01-30 08:29:31 +00:00
Hiroshi SHIBATA
b432867429
Skip OpenSSL::TestHMAC#test_dup when running with RHEL9 2023-01-30 16:55:14 +09:00
Luke Gruber
4ffef59bb1
[DOC] Make changes to docs in ractor.rb (#7180)
* Make changes to docs in ractor.rb

Mainly English changes to make things more clear, and to fix minor
non-idiomatic phrases. Also clarified difference between frozen and
shareable objects.

* More minor changes to Ractor docs.
2023-01-29 10:01:49 +09:00
BurdetteLamar
8250b46794 [ruby/net-http] Correct doc error
dc006d8419
2023-01-28 21:41:15 +00:00
Nobuyoshi Nakada
21dced8b01 [ruby/stringio] [Bug #19389] Fix chomping with longer separator
eb322a9716
2023-01-28 13:00:08 +00:00
Daniel Colson
8429134d0d [rubygems/rubygems] Don't warn on bundler binstubs --standalone --all
Prior to this commit `bundle binstubs --standalone --all` would output a
warning about not being able to generate a standalone binstub for
bundler.

This warning predates the `--all` option, and I don't think it makes
sense in this context. The warning makes good sense when explicitly
trying to generate a bundler standalone binstub with `bundle binstubs
bundler --standalone`, since that command won't do what the user might
have expected. But `--all` is not specifically asking for bundler, and
having it report each time that the bundler binstubs could not be
generated does not seem particularly helpful. The only way to make that
warning go away would be to stop using `--standalone --all`.

This commit skips the warning when running with the `--all` option.

e6a72e19eb
2023-01-27 21:06:39 +00:00
Alan Wu
7d4395cb69 YJIT: Fix shared/static library symbol leaks
Rust 1.58.0 unfortunately doesn't provide facilities to control symbol
visibility/presence, but we care about controlling the list of
symbols exported from libruby-static.a and libruby.so.

This commit uses `ld -r` to make a single object out of rustc's
staticlib output, libyjit.a. This moves libyjit.a out of MAINLIBS and adds
libyjit.o into COMMONOBJS, which obviates the code for merging libyjit.a
into libruby-static.a. The odd appearance of libyjit.a in SOLIBS is also
gone.

To filter out symbols we do not want to export on ELF platforms, we use
objcopy after the partial link. On darwin, we supply a symbol list to
the linker which takes care of hiding unprefixed symbols.

[Bug #19255]

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-01-27 12:28:09 -05:00
Alan Wu
e7e48e8a66 configure: Keep OBJCOPY even when visibility options are available
YJIT will need it to address symbol leakage issue. Fallback to `:` when
OBJCOPY is not available on the system.

Co-authored-by: Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-01-27 12:28:09 -05:00
Alan Wu
17c8bf2c63 configure: Don't use use LD=clang, ld takes different flags
This was a difference from using a GNU toolchain previously. It wasn't a
problem because we don't invoke $(LD) in the Makefile currently. YJIT
will want to invoke LD, so needs this consistency.
2023-01-27 12:28:09 -05:00
Benoit Daloze
47b66a5acd [ruby/bigdecimal] Add truffleruby in CI
5a25e26e08
2023-01-27 11:07:06 +00:00
Samuel Giddins
71256caf7f [rubygems/rubygems] Update the list of SPDX licence identifiers
18a9b0dc7e
2023-01-27 11:31:41 +09:00
Nobuyoshi Nakada
06e30df408 [ruby/syntax_suggest] Hide internal document and detail of Kernel monkey patching
https://bugs.ruby-lang.org/issues/19285

25ca82f8f9
2023-01-27 11:31:10 +09:00
Khem Raj
f49bb1505b
[ruby/fiddle] fiddle: Use C11 _Alignof to define ALIGN_OF when
possible
(https://github.com/ruby/fiddle/pull/120)

WG14 N2350 made very clear that it is an UB having type definitions
within "offsetof" [1]. This patch enhances the implementation of macro
ALIGN_OF to use builtin "_Alignof" to avoid undefined behavior when
using std=c11 or newer

clang 16+ has started to flag this [2]

Fixes build when using -std >= gnu11 and using clang16+

Older compilers gcc < 4.9 or clang < 8 has buggy _Alignof even though it
may support C11, exclude those compiler versions

[1] https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2350.htm
[2] https://reviews.llvm.org/D133574

Signed-off-by: Khem Raj <raj.khem@gmail.com>

ad6c9aa826
2023-01-27 11:30:13 +09:00
Aaron Patterson
f4609b6bc4
[ruby/fiddle] Fix comment formatting
36b2432575
2023-01-27 11:30:13 +09:00
Aaron Patterson
1df7f359d1
[ruby/fiddle] Update documentation
(https://github.com/ruby/fiddle/pull/119)

The documentation for `Fiddle.dlwrap` and `Fiddle.dlunwrap` were not
very accurate and pretty confusing. This commit updates the
documentation so it's easier to understand what the methods do.
2023-01-27 11:30:13 +09:00
Hiroshi SHIBATA
967dec5d61
[ruby/openssl] Added CoreAssertions
520601e11d

  This commits swtich to use ruby/ruby's envutil.rb instead of
  vendored in openssl repo.
2023-01-27 11:30:13 +09:00