Commit graph

368 commits

Author SHA1 Message Date
Nobuyoshi Nakada
6b2d9ed2a5
Handle preperly comments in middle of lines in gems/bundled_gems 2025-08-12 16:04:57 +09:00
Hiroshi SHIBATA
be7b1164e6 Split autogenerated dependency to depend file from common.mk 2025-07-25 19:50:06 +09:00
Alan Wu
1a20765074 DRY up CARGO_VERBOSE for JITs 2025-07-16 19:50:30 -04:00
Nobuyoshi Nakada
698cf146ac
Fetch only necessary commits of bundled gems 2025-06-09 23:41:13 +09:00
Nobuyoshi Nakada
7a56c31641
Revert "[Bug #21388] Make snapshots of gems"
This reverts commit e90282be7b, a commit miss.
2025-06-07 18:43:56 +09:00
Nobuyoshi Nakada
e90282be7b
[Bug #21388] Make snapshots of gems
If the revision of bundled gems is specified for ruby master (and
`git` is usable), checkout that revision and build a snapshot gem, and
use it for `test-spec` instead of the downloaded release version.
2025-06-07 18:41:36 +09:00
Koichi Sasada
7b75b1f2da prepare IDs for Ractor::monitor
To prevent the following strange error, prepare IDs at first.

```
     <internal:ractor>:596:in 'Ractor#monitor': symbol :exited is already registered with 98610c (fatal)
             from <internal:ractor>:550:in 'Ractor#join'
             from <internal:ractor>:574:in 'Ractor#value'
             from bootstraptest.test_ractor.rb_2013_1309.rb:12:in '<main>'
```

BTW, the error should be fixed on ID management system.
2025-05-31 18:29:02 +09:00
Alan Wu
8f50bb7c24 JITs: Add back MACOSX_DEPLOYMENT_TARGET=11.0 setting to avoid warning
See: 41251fdd30
2025-05-21 22:48:20 +09:00
Alan Wu
dfc0fe3679 Add jit.rs as dependency in Makefile 2025-05-21 00:35:56 +09:00
Alan Wu
92b218fbc3 YJIT: ZJIT: Allow both JITs in the same build
This commit allows building YJIT and ZJIT simultaneously, a "combo
build". Previously, `./configure --enable-yjit --enable-zjit` failed. At
runtime, though, only one of the two can be enabled at a time.

Add a root Cargo workspace that contains both the yjit and zjit crate.
The common Rust build integration mechanisms are factored out into
defs/jit.mk.

Combo YJIT+ZJIT dev builds are supported; if either JIT uses
`--enable-*=dev`, both of them are built in dev mode.

The combo build requires Cargo, but building one JIT at a time with only
rustc in release build remains supported.
2025-05-15 00:39:03 +09:00
Nobuyoshi Nakada
ed2806117a Do not let files depend on a phony target 2025-05-12 17:45:39 +09:00
Nobuyoshi Nakada
b48b841378 digest.so needs ruby/digest.h which is installed by build-ext 2025-05-12 02:50:25 +09:00
Nobuyoshi Nakada
204740b73f Revert "Try removing building C API specs in CRuby makefiles entirely"
This reverts commit 2a9236366d.
spec/ruby/optional/capi/spec_helper.rb doesn't work well for mingw.
2025-05-12 02:50:25 +09:00
Benoit Daloze
2a9236366d Try removing building C API specs in CRuby makefiles entirely
* Since it does not work when using some configure options such as:
  .../configure --with-ext=-test-/cxxanyargs,+ --enable-shared
  as the CI does.
* It also duplicates the logic of spec/ruby/optional/capi/spec_helper.rb incorrectly.
  ruby/spec maintainers have no experience and no interest in dealing with these complicated CRuby build system issues.
  We asked help on the CRuby Slack and nobody helped so far.
2025-05-09 23:22:15 +02:00
Andrew Konchin
29be534fad Try fixing building C API specs with make
* But it doesn't work because there is no .ext/include/ruby/digest.h
  when using .../configure --with-ext=-test-/cxxanyargs,+ --enable-shared
  as the CI does.
2025-05-09 23:22:15 +02:00
Takashi Kokubun
82606faaea Add zjit.mk 2025-04-18 21:52:55 +09:00
Takashi Kokubun
667a0f9f92
Revert "[Bug #20965] Define it like an ordinary argument" (#12418)
Revert "[Bug #20965] Define `it` like an ordinary argument (#12398)"

Reverts ruby/ruby#12398 as per https://bugs.ruby-lang.org/issues/20970#note-6 and https://bugs.ruby-lang.org/issues/20965#note-7.
We need more time to design the intended behavior, and it's too late for Ruby 3.4.
2024-12-23 04:46:50 +00:00
Nobuyoshi Nakada
46fec0f62a
[Bug #20965] Define it like an ordinary argument (#12398)
Also fixes [Bug #20955]
2024-12-18 23:12:16 -08:00
Nobuyoshi Nakada
4d86f3bf6d [Feature #20884] Reserve "Ruby" toplevel name 2024-12-12 17:45:06 +09:00
John Hawthorn
f1dda5ed01 Warn when redefining __id__ as well as object_id
[Feature #20912]
2024-11-29 20:41:00 -08:00
Randy Stauner
1dd40ec18a
Optimize instructions when creating an array just to call include? (#12123)
* Add opt_duparray_send insn to skip the allocation on `#include?`

If the method isn't going to modify the array we don't need to copy it.
This avoids the allocation / array copy for things like `[:a, :b].include?(x)`.

This adds a BOP for include? and tracks redefinition for it on Array.

Co-authored-by: Andrew Novoselac <andrew.novoselac@shopify.com>

* YJIT: Implement opt_duparray_send include_p

Co-authored-by: Andrew Novoselac <andrew.novoselac@shopify.com>

* Update opt_newarray_send to support simple forms of include?(arg)

Similar to opt_duparray_send but for non-static arrays.

* YJIT: Implement opt_newarray_send include_p

---------

Co-authored-by: Andrew Novoselac <andrew.novoselac@shopify.com>
2024-11-26 14:31:08 -05:00
Randy Stauner
acbb8d4fb5 Expand opt_newarray_send to support Array#pack with buffer keyword arg
Use an enum for the method arg instead of needing to add an id
that doesn't map to an actual method name.

$ ruby --dump=insns -e 'b = "x"; [v].pack("E*", buffer: b)'

before:

```
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,34)>
local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
[ 1] b@0
0000 putchilledstring                       "x"                       (   1)[Li]
0002 setlocal_WC_0                          b@0
0004 putself
0005 opt_send_without_block                 <calldata!mid:v, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0007 newarray                               1
0009 putchilledstring                       "E*"
0011 getlocal_WC_0                          b@0
0013 opt_send_without_block                 <calldata!mid:pack, argc:2, kw:[#<Symbol:0x000000000023110c>], KWARG>
0015 leave
```

after:

```
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,34)>
local table (size: 1, argc: 0 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1])
[ 1] b@0
0000 putchilledstring                       "x"                       (   1)[Li]
0002 setlocal_WC_0                          b@0
0004 putself
0005 opt_send_without_block                 <calldata!mid:v, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0007 putchilledstring                       "E*"
0009 getlocal                               b@0, 0
0012 opt_newarray_send                      3, 5
0015 leave
```
2024-07-29 16:26:58 -04:00
Burdette Lamar
8627225704
Add/revise Errno descriptions (#10897) 2024-06-04 15:19:50 +00:00
Nobuyoshi Nakada
0d44e23831
Prevent test-bundled-gems outputs from mixing
Run test-bundled-gems-run and test-bundled-gems-spec sequentially.
2024-05-26 22:17:57 +09:00
Nobuyoshi Nakada
49fcd33e13 Introduce a specialize instruction for Array#pack
Instructions for this code:

```ruby
  # frozen_string_literal: true

[a].pack("C")
```

Before this commit:

```
== disasm: #<ISeq:<main>@test.rb:1 (1,0)-(3,13)>
0000 putself                                                          (   3)[Li]
0001 opt_send_without_block                 <calldata!mid:a, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0003 newarray                               1
0005 putobject                              "C"
0007 opt_send_without_block                 <calldata!mid:pack, argc:1, ARGS_SIMPLE>
0009 leave
```

After this commit:

```
== disasm: #<ISeq:<main>@test.rb:1 (1,0)-(3,13)>
0000 putself                                                          (   3)[Li]
0001 opt_send_without_block                 <calldata!mid:a, argc:0, FCALL|VCALL|ARGS_SIMPLE>
0003 putobject                              "C"
0005 opt_newarray_send                      2, :pack
0008 leave
```

Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
2024-05-23 12:11:50 -07:00
Nobuyoshi Nakada
e937878883
Revert "Update revision.h if branch unmatch not only revision"
This reverts commit 5a332940ed.
Something does not work well on Github Actions.
2024-05-09 01:02:59 +09:00
Nobuyoshi Nakada
5a332940ed
Update revision.h if branch unmatch not only revision [ci skip] 2024-05-08 21:39:32 +09:00
Nobuyoshi Nakada
3169c15863
Fix rubyspec-capiext dependency
Not to build the rubyspec-capiext extension libraries again on the
next build after the build all extensions get built, ensure these
extensions are up to date when recursively building from exts.mk.
2024-04-19 14:12:41 +09:00
Nobuyoshi Nakada
53a8ad151b
Escape colons in pre-commit dependency [ci skip]
Colons are special in Makefiles.
2024-04-16 15:09:56 +09:00
Nobuyoshi Nakada
0fb39ab1b9
Clean intermediate files and debug info for each target
By replacing `ALLOBJS` suffix with intermediate file suffixes instead
of roughly removing by wildcards.  Made `cleanlibs` append `.dSYM`
suffix for each word in `TARGET_SO`, not the end of the entire list.
2024-03-10 22:12:00 +09:00
Nobuyoshi Nakada
2c787bf90f
Run POSTLINK for rubyspec CAPIEXT objects 2024-03-04 23:25:51 +09:00
Nobuyoshi Nakada
573bfb3a14
[DOC] Add known_errors documents
Incorporate from The Open Group.
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html
2024-01-13 11:08:03 +09:00
Nobuyoshi Nakada
9cf1c2bb0c
Refresh NEWS.md at starting new development [ci skip] 2023-12-25 20:10:37 +09:00
Kazuhiro NISHIYAMA
0fb10074e1 Fix error when gems/src is read-only
When I shared srcdir as read-only in lima-vm,
`make install` causes following error:

```
Update rbs to 33813a60752624d58dfe5ae770b39bfaf29fbaf1
error: cannot open .git/FETCH_HEAD: Read-only file system
```

I cannot find any ignore option for `git checkout --detach`
when already checked out. So I add `if`.
2023-10-11 13:32:54 +09:00
Nobuyoshi Nakada
1527246a7e
Download Unicode files once [ci skip] 2023-09-26 02:09:57 +09:00
Nobuyoshi Nakada
2b41df2477 .NOTPARALLEL with prerequisites needs recent GNU Make
GNU Make prior to 4.4 just ignores the prerequisites, and runs
everything in serial.
2023-09-21 12:18:41 +09:00
Nobuyoshi Nakada
e22086bb6a
Enable .NOTPARALLEL on ripper_srcs
And add special treats only for old GNU make.
2023-09-13 12:11:43 +09:00
Nobuyoshi Nakada
2cc32ad67c
Split commit recipe and pass more macros 2023-09-11 11:04:33 +09:00
Nobuyoshi Nakada
f339937abb RJIT: Remove macros inherited from MJIT but no longer used 2023-08-17 08:33:52 +09:00
Nobuyoshi Nakada
b76c2ec005
Use :: form workflow commands 2023-08-15 23:30:40 +09:00
Nobuyoshi Nakada
2a3acbc420
Fix test and precheck order for old GNU Make 2023-08-14 11:30:05 +09:00
Nobuyoshi Nakada
907560f5dc
Fix test-bundler dependencies 2023-08-11 15:23:48 +09:00
Nobuyoshi Nakada
8fbb79f49e
Fix order of test-syntax-suggest-prepare for old GNU Make 2023-08-11 14:47:20 +09:00
Nobuyoshi Nakada
52722ea37b
Extract common variables 2023-07-30 19:38:18 +09:00
Nobuyoshi Nakada
d516910b61
Serially update only the ripper source, even with old GNU make 2023-07-10 16:36:03 +09:00
Yuichiro Kaneko
a1b01e7701
Use Lrama LALR parser generator instead of Bison
https://bugs.ruby-lang.org/issues/19637

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2023-05-12 18:25:10 +09:00
Aaron Patterson
c5fc1ce975 Emit special instruction for array literal + .(hash|min|max)
This commit introduces a new instruction `opt_newarray_send` which is
used when there is an array literal followed by either the `hash`,
`min`, or `max` method.

```
[a, b, c].hash
```

Will emit an `opt_newarray_send` instruction.  This instruction falls
back to a method call if the "interested" method has been monkey
patched.

Here are some examples of the instructions generated:

```
$ ./miniruby --dump=insns -e '[@a, @b].max'
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,12)> (catch: FALSE)
0000 getinstancevariable                    :@a, <is:0>               (   1)[Li]
0003 getinstancevariable                    :@b, <is:1>
0006 opt_newarray_send                      2, :max
0009 leave
$ ./miniruby --dump=insns -e '[@a, @b].min'
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,12)> (catch: FALSE)
0000 getinstancevariable                    :@a, <is:0>               (   1)[Li]
0003 getinstancevariable                    :@b, <is:1>
0006 opt_newarray_send                      2, :min
0009 leave
$ ./miniruby --dump=insns -e '[@a, @b].hash'
== disasm: #<ISeq:<main>@-e:1 (1,0)-(1,13)> (catch: FALSE)
0000 getinstancevariable                    :@a, <is:0>               (   1)[Li]
0003 getinstancevariable                    :@b, <is:1>
0006 opt_newarray_send                      2, :hash
0009 leave
```

[Feature #18897] [ruby-core:109147]

Co-authored-by: John Hawthorn <jhawthorn@github.com>
2023-04-18 17:16:22 -07:00
Nobuyoshi Nakada
a4cc3fcbd2
Replace arch_flags for universal build [ci skip] 2023-04-08 20:31:51 +09:00
Hiroshi SHIBATA
59905883c4 BundledGem.dummy_spec needs to checkout revision after cloning repository.
The current BundledGem.dummy_spec always called from master branch.
  It caused to CI faiulres like
  20230305T001003Z.fail.html.gz
2023-03-08 17:48:43 +09:00
Takashi Kokubun
2e875549a9 s/MJIT/RJIT/ 2023-03-06 23:44:01 -08:00