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

86438 Коммитов

Автор SHA1 Сообщение Дата
Kevin Newton 6298667ff5 [ruby/prism] When parsing an invalid write, still add to the local table
https://github.com/ruby/prism/commit/a54abc4d1b
2024-07-12 13:50:00 +00:00
Matt Valentine-House ca99f86bd6 Add GC.config to NEWS.md 2024-07-12 14:43:33 +01:00
Matt Valentine-House 8418df72ec Avoid extra module linkage in gc/default.c
We don't need to use rb_str_to_cstr here, which means we don't need to
include string headers anymore.
2024-07-12 14:43:33 +01:00
Matt Valentine-House 3ccc6e0b6a Document GC.config 2024-07-12 14:43:33 +01:00
Matt Valentine-House 4d77803a66 Rename full_mark -> rgengc_allow_full_mark 2024-07-12 14:43:33 +01:00
Matt Valentine-House f543c68e1c Provide GC.config to disable major GC collections
This feature provides a new method `GC.config` that configures internal
GC configuration variables provided by an individual GC implementation.

Implemented in this PR is the option `full_mark`: a boolean value that
will determine whether the Ruby GC is allowed to run a major collection
while the process is running.

It has the following semantics

This feature configures Ruby's GC to only run minor GC's. It's designed
to give users relying on Out of Band GC complete control over when a
major GC is run. Configuring `full_mark: false` does two main things:

* Never runs a Major GC. When the heap runs out of space during a minor
  and when a major would traditionally be run, instead we allocate more
  heap pages, and mark objspace as needing a major GC.
* Don't increment object ages. We don't promote objects during GC, this
  will cause every object to be scanned on every minor. This is an
  intentional trade-off between minor GC's doing more work every time,
  and potentially promoting objects that will then never be GC'd.

The intention behind not aging objects is that users of this feature
should use a preforking web server, or some other method of pre-warming
the oldgen (like Nakayoshi fork)before disabling Majors. That way most
objects that are going to be old will have already been promoted.

This will interleave major and minor GC collections in exactly the same
what that the Ruby GC runs in versions previously to this. This is the
default behaviour.

* This new method has the following extra semantics:
  - `GC.config` with no arguments returns a hash of the keys of the
    currently configured GC
  - `GC.config` with a key pair (eg. `GC.config(full_mark: true)` sets
    the matching config key to the corresponding value and returns the
    entire known config hash, including the new values. If the key does
    not exist, `nil` is returned

* When a minor GC is run, Ruby sets an internal status flag to determine
  whether the next GC will be a major or a minor. When `full_mark:
  false` this flag is ignored and every GC will be a minor.

  This status flag can be accessed at
  `GC.latest_gc_info(:needs_major_by)`. Any value other than `nil` means
  that the next collection would have been a major.

  Thus it's possible to use this feature to check at a predetermined
  time, whether a major GC is necessary and run one if it is. eg. After
  a request has finished processing.

  ```ruby
  if GC.latest_gc_info(:needs_major_by)
    GC.start(full_mark: true)
  end
  ```

[Feature #20443]
2024-07-12 14:43:33 +01:00
Peter Zhu 00d0ddd48a Add gc/gc_impl.h for GC implementation headers 2024-07-12 08:41:33 -04:00
tomoya ishida 17a4c7cfcf [ruby/reline] Fix rendering bug of nomultiline prompt
(https://github.com/ruby/reline/pull/730)

Fix bug of `print('a'*10); Reline.readline('>')` wrong rendering

https://github.com/ruby/reline/commit/c0469a12b9
2024-07-12 12:21:26 +00:00
Nobuyoshi Nakada 94b87084a6 [ruby/win32ole] win32ole.c: repeated code
* ext/win32ole/win32ole.c (ole_variant2val): reduce repeated code
  between byref and byval.

https://github.com/ruby/win32ole/commit/e753c6abdd
2024-07-12 09:45:06 +00:00
Yusuke Endoh bb1ef81732 [ruby/error_highlight] Make test_COLON2_5 conditional again
https://github.com/ruby/error_highlight/commit/da5e76bb06
2024-07-12 06:26:53 +00:00
Hiroshi SHIBATA 371055979f Pend some tests because these are not working with macOS 15 beta and Xcode 16 beta 2024-07-12 13:38:22 +09:00
卜部昌平 fa6bf1da57 give up USE_GC_MALLOC_OBJ_INFO_DETAILS
This feature is no longer possible under current design; now that our GC
is pluggable, we cannot assume what was achieved by this compiler flag
is always possble by the dynamically-loaded GC implementation.
2024-07-12 10:21:07 +09:00
Hiroshi SHIBATA 9acc0efdc1
Use fixture certificates to fix test failure with RHEL9.
http://rubyci.s3.amazonaws.com/rhel9/ruby-master/log/20240711T213004Z.fail.html.gz

```
  1) Error:
HTTPSProxyTest#test_https_proxy_ssl_connection:
OpenSSL::X509::CertificateError: invalid digest
    /home/chkbuild/chkbuild/tmp/build/20240711T213004Z/ruby/test/net/http/test_https_proxy.rb:63:in 'OpenSSL::X509::Certificate#sign'
    /home/chkbuild/chkbuild/tmp/build/20240711T213004Z/ruby/test/net/http/test_https_proxy.rb:63:in 'HTTPSProxyTest#test_https_proxy_ssl_connection'
```
2024-07-12 09:15:12 +09:00
Peter Zhu 6fc83118bb Fix Makefile.in for non GNUmake
On OpenBSD the Makefile errors with:

    Using $< in a non-suffix rule context is a GNUmake idiom
2024-07-11 15:49:14 -04:00
Kevin Newton cfaa3e9311 [ruby/prism] Bump typecheck dependencies to fix CI
https://github.com/ruby/prism/commit/c7a4a90ee8
2024-07-11 19:46:51 +00:00
Kevin Newton 21b4c14971 [ruby/prism] (ruby_parser) Handle bare string in implicit concat
https://github.com/ruby/prism/commit/afc7c9344a
2024-07-11 19:46:50 +00:00
Kevin Newton 3c3be9c6b2 [ruby/prism] (ruby_parser) Match match3 nodes for regular expressions
https://github.com/ruby/prism/commit/47cb73ce69
2024-07-11 19:46:50 +00:00
Kevin Newton 4c696597b7 [ruby/prism] (ruby_parser) Reverse associativity of and and or nodes
https://github.com/ruby/prism/commit/073e8ba307
2024-07-11 19:46:49 +00:00
Koichi Sasada 43aee3393d fix `defined?(@ivar)` with Ractors
`defined?(@ivar)` on the non main Ractor has two issues:

1. raising an exception

```ruby
class C
  @iv1 = []
  def self.defined_iv1 = defined?(@iv1)
end

Ractor.new{
  p C.defined_iv1
  #=> can not get unshareable values from instance variables of classes/modules from non-main Ractors (Ractor::IsolationError)
}.take
```

-> Do not raise an exception but return `"instance-variable"` because
it is defined.

2. returning `"instance-variable"` if there is not defined.

```
class C
  # @iv2 is not defined
  def self.defined_iv2 = defined?(@iv2)
end

Ractor.new{
  p C.defined_iv2 #=> "instance-variable"
}.take
```

-> returns `nil`
2024-07-12 04:43:14 +09:00
Ivo Anjo ef563a696d Minor: Fix typo in bug name
This confused me for a few minutes -- the testcase for
https://bugs.ruby-lang.org/issues/14834 was mistyped in the file name,
as well as once in the source.

E.g. in some cases it was
`one-four-three-eight-four` instead of
`one-four-eight-three-four`.
2024-07-11 15:18:40 -04:00
Maxime Chevalier-Boisvert a58e3305ce
YJIT: remove doc/yjit/yjit_hacking.md (#11153)
Document is 3 years old and out of date
2024-07-11 19:17:40 +00:00
Maxime Chevalier-Boisvert 3fbf9df39a
YJIT: increase context cache size to 1024 redux (#11140)
* YJIT: increase context cache size to 1024 redux

* Move context hashing code outside of unsafe block

* Avoid allocating large table on the stack, which would cause a stack overflow

Co-authored by Alan Wu @XrXr
2024-07-11 19:01:05 +00:00
Kevin Newton 1f6aeadc82 [PRISM] Fix Windows 2015 segfault 2024-07-11 14:25:54 -04:00
Kevin Newton ac093f5a06 [PRISM] Fix up shareable constant casting 2024-07-11 14:25:54 -04:00
Kevin Newton c1df15c3e6 [PRISM] Use node ids for error highlight 2024-07-11 14:25:54 -04:00
Kevin Newton 0006fb1e9e [PRISM] Revert incorrectly merged gemfile 2024-07-11 14:25:54 -04:00
Stan Lo be4589df80 [ruby/prism] Prevent optional block parameter from accepting certain prefixed values
This commit prevents the following unary operators from being accepted
as the value prefix of a block's optional parameter:

- `+`
- `-`
- `~`
- `!`

For example, `f { |a = +b| }` will now raise a syntax error.

https://github.com/ruby/prism/commit/3024bee60c

Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2024-07-11 14:25:54 -04:00
Kevin Newton aa473489a2 [ruby/prism] Various cleanup for initializers and typechecks
https://github.com/ruby/prism/commit/86cf82794a
2024-07-11 14:25:54 -04:00
Kevin Newton 2bf9ae3fa1 [ruby/prism] Add node ids to nodes
https://github.com/ruby/prism/commit/bf16ade7f9
2024-07-11 14:25:54 -04:00
Kevin Newton 39dcfe26ee [ruby/prism] Move Node#type and Node::type documentation
https://github.com/ruby/prism/commit/08a71f6259
2024-07-11 14:25:54 -04:00
Kevin Newton 32090e2b8d [ruby/prism] Add Node#breadth_first_search
https://github.com/ruby/prism/commit/1ffb141199
2024-07-11 14:25:54 -04:00
Kevin Newton aca42a2478 [ruby/prism] Expose common flags in inspect output
https://github.com/ruby/prism/commit/d0143865c2
2024-07-11 14:25:54 -04:00
Kevin Newton 687be43c79 [ruby/prism] Expose flags on every node type
https://github.com/ruby/prism/commit/9f12a56fd6
2024-07-11 14:25:54 -04:00
Kevin Newton ca48fb76fb [ruby/prism] Move location to second position for node initializers
https://github.com/ruby/prism/commit/4cc0eda4ca
2024-07-11 14:25:54 -04:00
Kevin Newton 678dd769e5 [ruby/prism] Reconfigure error tests
https://github.com/ruby/prism/commit/fb7e1ebb7f
2024-07-11 14:25:54 -04:00
Maxime Chevalier-Boisvert c0ad0c3e43
Update yjit.md, explain how to run a single test with test-all (#11151) 2024-07-11 17:02:01 +00:00
Peter Zhu 9962e39547 Make shared GC job in ubuntu.yml use a shared GC 2024-07-11 11:38:00 -04:00
Peter Zhu d0dfd963af Remove SHARED_GC job from compilers.yml
It's a duplicate of the one in ubuntu.yml
2024-07-11 11:38:00 -04:00
Jeremy Evans c698180e68 [ruby/logger] Add reraise_write_errors keyword argument to Logger and LogDevice
This allows the user to specify exception classes to treat as regular
exceptions instead of being swallowed.  Among other things, it is
useful for having Logger work with Timeout.

Fixes Ruby Bug 9115.

https://github.com/ruby/logger/commit/436a7d680f
2024-07-11 15:25:17 +00:00
Peter Zhu a0469a4788 Rename gc/gc_impl.c to gc/default.c
Changing the name makes it clear that this is the default GC in Ruby.
2024-07-11 09:09:47 -04:00
Peter Zhu e5d12f9cce Move gc_impl.c to gc/gc_impl.c
This commit creates a new directory `gc` to put different GC
implementations and moves the default GC from gc_impl.c to gc/gc_impl.c.
The default GC can be easily switched using the `BUILTIN_GC` variable
in Makefile.in.
2024-07-11 09:09:47 -04:00
Jeremy Daer e1a034cb96
IBM864 single-byte transcoding (#10518)
Include € euro sign from CCSID 864
2024-07-11 17:03:14 +09:00
git a1f7432550 Update bundled gems list as of 2024-07-10 2024-07-11 06:59:45 +00:00
Jean Boussier 3de0e343e2 Do not warn about extra `format` argument when passed as keywords
[Bug #20593]

It's fairly common to use `format` to interpolate a number of values
into a user provided strings.

The arguments not matching are a problem when they are positional,
but when they are named, it's absolutely fine and we shouldn't
emit a warning.
2024-07-11 07:39:50 +02:00
João Pinheiro 72732af47e [ruby/open-uri] document max_redirects option
https://github.com/ruby/open-uri/commit/4a247e5ca1
2024-07-11 04:49:59 +00:00
João Pinheiro e62a0126cd [ruby/open-uri] apply default max_redirects
https://github.com/ruby/open-uri/commit/5d29e626bc
2024-07-11 04:49:59 +00:00
Yusuke Endoh e1238a1fab Enumerable#all?: Stop optimizing when a given block is not optimizable
This is a follow up to 182822683f.

Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
2024-07-11 12:28:23 +09:00
dependabot[bot] 724d95a713 Bump ruby/setup-ruby from 1.186.0 to 1.187.0
Bumps [ruby/setup-ruby](https://github.com/ruby/setup-ruby) from 1.186.0 to 1.187.0.
- [Release notes](https://github.com/ruby/setup-ruby/releases)
- [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb)
- [Commits](2a9a743e19...161cd54b69)

---
updated-dependencies:
- dependency-name: ruby/setup-ruby
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-11 12:03:49 +09:00
Dmitriy Ivliev 6dc0086d20 [rubygems/rubygems] fix s3 source configuration issue
https://github.com/rubygems/rubygems/commit/356726bd1a
2024-07-11 02:27:46 +00:00
Evgeni Golov bc1b4235fb [ruby/net-http] implement talking SSL to the proxy too
https://bugs.ruby-lang.org/issues/16482

https://github.com/ruby/net-http/commit/ae2d83f88b
2024-07-11 01:56:08 +00:00