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

86303 Коммитов

Автор SHA1 Сообщение Дата
Naoto Ono 8ede84aa95 Move the file location of launchable.rb 2024-07-08 10:15:04 +09:00
Naoto Ono 5b78925455 Integrate Launchable into make btest 2024-07-08 10:15:04 +09:00
KJ Tsanaktsidis dface4427d Also export CC for dtrace's benefit as well
The CFLAGS might contain flags that only work with the specified CC
2024-07-07 22:37:36 +10:00
KJ Tsanaktsidis 8ec67052e6 Do not define SHSTK feature for amd64 Context.S
We do not implement CET shadow-stack switching in amd64 Context.S. If
you compile Ruby with `-fcf-protection=full` and run it with
`GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK` exported, it will crash with a
control flow exception.

Configure the appropriate notes at the end of Context.S

[Bug #18061]
2024-07-07 20:14:44 +10:00
KJ Tsanaktsidis 3381c60836 Ensure CFLAGS are passed to probes.o generation
The dtrace python script from systemtap on Linux actually looks at the
CFLAGS environment variable when invoking gcc to make the probes.o file.
If we don't pass the CFLAGS we're using, this probes.o file can wind up
without the required annotations indicating that it supports e.g. Intel
CET.

Fix this by explicitly exporting our build flags to the environment for
this script.

[Bug #18061]
2024-07-07 20:14:44 +10:00
KJ Tsanaktsidis b940de83de Revert autoconf macros defining RUBY_AARCH64_{BTI|PAC}_ENABLED
This partially reverts https://github.com/ruby/ruby/pull/10944; now that
we decided to pass CFLAGS to $(CC) when assembling .S files, we don't
need these autoconf macros that capture the state of
__ARM_FEATURE{PAC|BTI}_DEFAULT.

[Bug #20601]
2024-07-07 20:14:44 +10:00
KJ Tsanaktsidis b18701a7ae Remove $(ASFLAGS) from build system and assemble with $(CFLAGS) instead
We already assemble our assembly files using the $(CC) compiler driver,
rather than the actual $(AS) assembler. This means that

* The C preprocessor gets run on the assembly file
* It's valid to pass gcc-style flags to it, like e.g.
  -mbranch-protection or -fcf-protection
* If you do so, the relevant preprocessor macros like __CET__ get set
* If you really wanted to pass assembler flags, you would need to do
  that using -Wa,... anyway

So I think it makes sense to pass "$(XCFLAGS) $(CFLAGS) $(CPPFLAGS)" to
gcc/clang/etc when assembling, rather than passing $(ASFLAGS) (since
the flags are not actually passed to `as`, but `cc`!).

The side effect of this is that if there are mitigation flags like
-fcf-protection in $CFLAGS, then the relevant macros like __CET__ will
be defined when assembling the files.

[Bug #20601]
2024-07-07 20:14:44 +10:00
cdfzo 087b461c83
[DOC] Fix typo `with` -> `wish` 2024-07-07 13:09:42 +09:00
git d76332e551 Update default gems list at abaa1b913d [ci skip] 2024-07-06 17:55:53 +00:00
Stan Lo abaa1b913d [ruby/irb] Bump version to v1.14.0
(https://github.com/ruby/irb/pull/980)

https://github.com/ruby/irb/commit/6a9e129714
2024-07-06 17:55:00 +00:00
Jeremy Evans 7f1fe5f091 Raise a TypeError for Thread#thread_variable{?,_get} for non-symbol
Previously, a TypeError was not raised if there were no thread
variables, because the conversion to symbol was done after that
check.  Convert to symbol before checking for whether thread
variables are set to make the behavior consistent.

Fixes [Bug #20606]
2024-07-06 12:07:32 +02:00
Alan Wu e240fc9c3c [DOC] yjit.md: Markdown fixes for RDoc
It now renders properly on both GitHub and with RDoc's darkfish theme.
2024-07-05 18:38:46 -04:00
Peter Zhu 3fede665ff Update GitHub actions for shared GC 2024-07-05 14:05:58 -04:00
Peter Zhu e2ceded2c6 Change external GC to use directory at configure
This commit changes the external GC API to use `--with-shared-gc=DIR` at
configure time with a directory of the external GC and uses
`RUBY_GC_LIBRARY` environment variable to load the external GC at
runtime.
2024-07-05 14:05:58 -04:00
Peter Zhu 8fd2df529b Revert "Load external GC using command line argument"
This reverts commit 8ddb1110c283c5cb59b6582383f36fdbcc43ab19.
2024-07-05 14:05:58 -04:00
Stan Lo 32ba86c9be [ruby/irb] Return only commands when completing help command's
argument
(https://github.com/ruby/irb/pull/973)

The command only takes command names as arguments, so we should only
return command names as candidates.

This will help users find a command faster as completion will be
another useful hint too.

https://github.com/ruby/irb/commit/7b6557cc24
2024-07-05 17:51:17 +00:00
Peter Zhu 1afcaa3e4b Fix flaky test_stat_heap_all
We only collect GC.stat_heap(nil, stat_heap_all)
once, outside of the loop, but assert_equal could
allocate objects which can cause a GC to run and
cause stat_heap_all to be out-of-sync.
2024-07-05 09:15:32 -04:00
Koichi Sasada 685a4e5be7 VM barrier needs to store GC root
On the VM barrier waiting, it needs to store machine context
as a GC root.

Also it needs to wait for barrier synchronization correctly
by `while` (for continuous barrier sync by another ractor).

This is why GC marking misses are occerred on ARM machines.
like: https://rubyci.s3.amazonaws.com/fedora40-arm/ruby-master/log/20240702T063002Z.fail.html.gz
2024-07-05 21:20:54 +09:00
なつき 88a2a46e23 [rubygems/rubygems] Restrict generic `arm` to only match 32-bit arm
https://github.com/rubygems/rubygems/commit/14c4c16e96
2024-07-05 09:02:52 +00:00
dependabot[bot] cd1ea98bdc Bump dependabot/fetch-metadata from 2.1.0 to 2.2.0
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](5e5f99653a...dbb049abf0)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-04 20:51:32 -07:00
Hiroshi SHIBATA 3b48a5a11c Use macos-14 instead of macos-arm-oss
Unfortunately, we can't use macos-arm-oss with enterprise account
2024-07-05 12:10:23 +09:00
Jerome Dalbert bbb4da78c7 [rubygems/rubygems] Use preferred add_dependency instead of add_runtime_dependency
https://github.com/rubygems/rubygems/commit/9a08043858
2024-07-05 02:24:53 +00:00
Peter Zhu c480dec1cc Fix RUBY_FREE_AT_EXIT with ASAN
When Ruby is built with ASAN and RUBY_FREE_AT_EXIT is enabled, the
following error occurs:

    READ of size 8 at 0x74c666610020 thread T0
        #0 0x593b6712ecc6 in RB_BUILTIN_TYPE include/ruby/internal/value_type.h:191:30
        #1 0x593b6712ecc6 in rb_gc_impl_shutdown_free_objects gc_impl.c:3208:17
        #2 0x593b6749a62e in ruby_vm_destruct vm.c:3133:17
2024-07-04 09:25:50 -04:00
Hiroshi SHIBATA 478ada0e2b [rubygems/rubygems] Handle OpenSSL::SSL::SSLError in local https server
https://github.com/rubygems/rubygems/commit/ccbbe84d77
2024-07-04 03:33:09 +00:00
Hiroshi SHIBATA ba4495d75a [rubygems/rubygems] Align code styles with rubocop and others.
https://github.com/rubygems/rubygems/commit/c31a1592ee
2024-07-04 03:33:09 +00:00
Hiroshi SHIBATA 7e69d74729 [rubygems/rubygems] Correctly handling fetcher leak
https://github.com/rubygems/rubygems/commit/c538558522
2024-07-04 03:33:08 +00:00
Hiroshi SHIBATA 318af23baa [rubygems/rubygems] Removed needless variable
https://github.com/rubygems/rubygems/commit/29f71ee6d2
2024-07-04 03:33:08 +00:00
Hiroshi SHIBATA 2cd270aecc [rubygems/rubygems] YAML is always enabled
https://github.com/rubygems/rubygems/commit/c755bcde62
2024-07-04 03:33:07 +00:00
Hiroshi SHIBATA 16e1565dec [rubygems/rubygems] Removed unused gzip code
https://github.com/rubygems/rubygems/commit/ee45ebb5c3
2024-07-04 03:33:07 +00:00
Hiroshi SHIBATA 6a2c799761 [rubygems/rubygems] Rewrite WEBrick server with TCPServer and Proxy
https://github.com/rubygems/rubygems/commit/3ae4358024
2024-07-04 03:33:06 +00:00
Hiroshi SHIBATA 0cb82a810d [rubygems/rubygems] Rewrite WEBrick server with TCPServer and OpenSSL::SSL::SSLServer
https://github.com/rubygems/rubygems/commit/21319eccac
2024-07-04 03:33:06 +00:00
Hiroshi SHIBATA b3e53495bb [rubygems/rubygems] Cleanup needless code from HTTP/HTTPS tests
https://github.com/rubygems/rubygems/commit/69bd962b56
2024-07-04 03:33:05 +00:00
Hiroshi SHIBATA 7e12b5e2ac [rubygems/rubygems] Split HTTP tests and HTTPS tests
https://github.com/rubygems/rubygems/commit/43f98b787b
2024-07-04 03:33:05 +00:00
Hiroshi SHIBATA f6aa774a14 [rubygems/rubygems] Extract tests with local HTTP/HTTPS server from TestGemRemoteFetcher
https://github.com/rubygems/rubygems/commit/52db9fd501
2024-07-04 03:33:04 +00:00
Hiroshi SHIBATA 127221d873 [rubygems/rubygems] Extract tests with S3 resources from TestGemRemoteFetcher
https://github.com/rubygems/rubygems/commit/d3ee8d2d3b
2024-07-04 03:33:04 +00:00
Nobuyoshi Nakada 0fe024d048 Fix the return value of `Integer#downto` called with a block
As the document states, it should return `self`, not `nil`.
Fix up of f4b313f733.
2024-07-04 12:11:12 +09:00
dependabot[bot] 70be2f4731 Bump ruby/setup-ruby from 1.183.0 to 1.184.0
Bumps [ruby/setup-ruby](https://github.com/ruby/setup-ruby) from 1.183.0 to 1.184.0.
- [Release notes](https://github.com/ruby/setup-ruby/releases)
- [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb)
- [Commits](1d0e911f61...97e35c5302)

---
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-03 19:55:27 -07:00
Vít Ondruch d9398ac430
Use `__CET__` macro to enable IBT support. (#11081)
According to the GCC documentation [1], the macro `__CET__` is dfined
when `-fcf-protection` compiler option is used. Therefore use this macro
to enable IBT support instead of special casing for `__OpenBSD__`.

[1]: https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#index-fcf-protection
2024-07-04 08:37:41 +09:00
Alan Wu b160a78d6b YJIT: Remove done TODO, fix indent
Type check now done in rb_iseqw_to_iseq().
2024-07-03 19:10:57 -04:00
Burdette Lamar f5dfadf38b
[DOC] Doc for Integer#floor (#11077) 2024-07-03 16:00:00 -04:00
Aaron Patterson b974c84606 Move Array#map to Ruby
Improves activerecord by about 1% on the interpreter:

```
before: ruby 3.4.0dev (2024-07-03T18:40:10Z master f88841b8f3) [arm64-darwin23]
after: ruby 3.4.0dev (2024-07-03T18:41:14Z ruby-map 6c0df4eb32) [arm64-darwin23]

------------  -----------  ----------  ----------  ----------  -------------  ------------
bench         before (ms)  stddev (%)  after (ms)  stddev (%)  after 1st itr  before/after
activerecord  235.2        0.8         233.6       0.7         1.01           1.01
------------  -----------  ----------  ----------  ----------  -------------  ------------
Legend:
- after 1st itr: ratio of before/after time for the first benchmarking iteration.
- before/after: ratio of before/after time. Higher is better for after. Above 1 represents a speedup.
```

Improves YJIT by about 4%:

```
before: ruby 3.4.0dev (2024-07-03T18:40:10Z master f88841b8f3) +YJIT [arm64-darwin23]
after: ruby 3.4.0dev (2024-07-03T18:41:14Z ruby-map 6c0df4eb32) +YJIT [arm64-darwin23]

------------  -----------  ----------  ----------  ----------  -------------  ------------
bench         before (ms)  stddev (%)  after (ms)  stddev (%)  after 1st itr  before/after
activerecord  142.1        1.2         137.0       0.6         1.00           1.04
------------  -----------  ----------  ----------  ----------  -------------  ------------
Legend:
- after 1st itr: ratio of before/after time for the first benchmarking iteration.
- before/after: ratio of before/after time. Higher is better for after. Above 1 represents a speedup.
```
2024-07-03 12:32:53 -07:00
Peter Zhu 6ac05ddb8a Remove unused gc_raw_obj_info_basic 2024-07-03 14:45:01 -04:00
Peter Zhu 05f840d641 Remove unused obj_info_basic 2024-07-03 14:44:31 -04:00
Peter Zhu f88841b8f3 Fix ASAN builds 2024-07-03 14:40:10 -04:00
Aaron Patterson 4c9134d2b2 Move Array#select to Ruby
This speeds up the mail benchmark by about 7% on the interpreter:

```
before: ruby 3.4.0dev (2024-07-03T17:01:41Z master f4b313f733) [arm64-darwin23]
after: ruby 3.4.0dev (2024-07-03T17:45:50Z ruby-select de282cacd5) [arm64-darwin23]

-----  -----------  ----------  ----------  ----------  -------------  ------------
bench  before (ms)  stddev (%)  after (ms)  stddev (%)  after 1st itr  before/after
mail   72.9         0.8         68.2        1.0         1.02           1.07
-----  -----------  ----------  ----------  ----------  -------------  ------------
Legend:
- after 1st itr: ratio of before/after time for the first benchmarking iteration.
- before/after: ratio of before/after time. Higher is better for after. Above 1 represents a speedup.
```

YJIT is about 13% faster:

```
before: ruby 3.4.0dev (2024-07-03T17:01:41Z master f4b313f733) +YJIT [arm64-darwin23]
after: ruby 3.4.0dev (2024-07-03T17:45:50Z ruby-select de282cacd5) +YJIT [arm64-darwin23]

-----  -----------  ----------  ----------  ----------  -------------  ------------
bench  before (ms)  stddev (%)  after (ms)  stddev (%)  after 1st itr  before/after
mail   51.0         0.8         45.2        0.6         1.00           1.13
-----  -----------  ----------  ----------  ----------  -------------  ------------
Legend:
- after 1st itr: ratio of before/after time for the first benchmarking iteration.
- before/after: ratio of before/after time. Higher is better for after. Above 1 represents a speedup.
```
2024-07-03 11:32:40 -07:00
Stan Lo 7fe5f0a1d0 [ruby/irb] Introduce cd command
(https://github.com/ruby/irb/pull/971)

It's essentially a combination of pushws and popws commands that are
easier to use.

Help message:

```
Usage: cd ([target]|..)

IRB uses a stack of workspaces to keep track of context(s), with `pushws` and `popws` commands to manipulate the stack.
The `cd` command is an attempt to simplify the operation and will be subject to change.

When given:
- an object, cd will use that object as the new context by pushing it onto the workspace stack.
- "..", cd will leave the current context by popping the top workspace off the stack.
- no arguments, cd will move to the top workspace on the stack by popping off all workspaces.

Examples:

  cd Foo
  cd Foo.new
  cd @ivar
  cd ..
  cd
```

https://github.com/ruby/irb/commit/4a0e0e89b7
2024-07-03 17:17:42 +00:00
Aaron Patterson f4b313f733 move Integer#downto to Ruby
Speeds up ChunkyPNG.

The interpreter is about 70% faster:

```
before: ruby 3.4.0dev (2024-07-03T15:16:17Z master 786cf9db48) [arm64-darwin23]
after: ruby 3.4.0dev (2024-07-03T15:32:25Z ruby-downto 0b8b744ce2) [arm64-darwin23]

----------  -----------  ----------  ----------  ----------  -------------  ------------
bench       before (ms)  stddev (%)  after (ms)  stddev (%)  after 1st itr  before/after
chunky-png  892.2        0.1         526.3       1.0         1.65           1.70
----------  -----------  ----------  ----------  ----------  -------------  ------------
Legend:
- after 1st itr: ratio of before/after time for the first benchmarking iteration.
- before/after: ratio of before/after time. Higher is better for after. Above 1 represents a speedup.
```

YJIT is 2.5x faster:

```
before: ruby 3.4.0dev (2024-07-03T15:16:17Z master 786cf9db48) +YJIT [arm64-darwin23]
after: ruby 3.4.0dev (2024-07-03T15:32:25Z ruby-downto 0b8b744ce2) +YJIT [arm64-darwin23]

----------  -----------  ----------  ----------  ----------  -------------  ------------
bench       before (ms)  stddev (%)  after (ms)  stddev (%)  after 1st itr  before/after
chunky-png  709.4        0.1         278.8       0.3         2.35           2.54
----------  -----------  ----------  ----------  ----------  -------------  ------------
Legend:
- after 1st itr: ratio of before/after time for the first benchmarking iteration.
- before/after: ratio of before/after time. Higher is better for after. Above 1 represents a speedup.
```
2024-07-03 10:01:41 -07:00
Peter Zhu cbc40aca3a Fix compilation with RGENGC_CHECK_MODE=2 2024-07-03 11:48:12 -04:00
Jean Boussier 786cf9db48 array.c: Remove outdated assertions
Following [Feature #20589] it can happen that we change the
capacity of a frozen array, so these assertions no longer make
sense.

Normally we don't hit them because `Array#freeze` shrinks the
array, but if somehow the Array was frozen using `Object#freeze`
then we may shrink it after it was frozen.
2024-07-03 17:16:17 +02:00
Peter Zhu 5f20957b85 Move ruby_load_external_gc_from_argv to gc.h 2024-07-03 09:03:40 -04:00