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

506 Коммитов

Автор SHA1 Сообщение Дата
Takashi Kokubun 38be9a9b72
Clean up OPT_STACK_CACHING (#8132) 2023-07-27 17:27:05 -07:00
Nobuyoshi Nakada 99162dee7a [Bug #19751] Remove linemarkers in middle 2023-07-25 19:30:15 +09:00
Nobuyoshi Nakada 47c7c188e0
Add comments to id.h and undef finished macros 2023-07-21 14:52:43 +09:00
Nobuyoshi Nakada cceb410087 leaked-globals: check leaked symbols in libruby.so if enable-shared 2023-07-08 11:31:17 +09:00
Janosch Müller 08b3fb1152
[Bug #19728] Auto-generate unicode property docs
https://bugs.ruby-lang.org/issues/19728
2023-07-01 23:22:17 +09:00
卜部昌平 d4b662d6f8 template/Doxyfile.tmpl: modernise
applied doxygen -g for Doxygen 1.9.7.
2023-06-29 09:27:12 +09:00
Jemma Issroff d53e1f42ff [Feature #19741] Add yarp to builds
Add yarp to common.mk and windows builds to enable us to run yarp
correctly with CI.
2023-06-21 11:25:39 -07:00
Nobuyoshi Nakada 2a80bac9f0
Remove `--jobserver-auth` option which varies for each run 2023-06-19 18:28:10 +09:00
yui-knk 1740482d06 Fix rb_compile_option_t comments [ci skip] 2023-06-18 14:39:15 +09:00
yui-knk b481b673d7 [Feature #19719] Universal Parser
Introduce Universal Parser mode for the parser.
This commit includes these changes:

* Introduce `UNIVERSAL_PARSER` macro. All of CRuby related functions
  are passed via `struct rb_parser_config_struct` when this macro is enabled.
* Add CI task with 'cppflags=-DUNIVERSAL_PARSER' for ubuntu.
2023-06-12 18:23:48 +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
Nobuyoshi Nakada 3785049c9f
Use RUBY_PROGRAM_VERSION as version in pkg-config file [ci skip]
So that ABI version is not included in it even on the develepment
branch.
2023-04-13 11:31:34 +09:00
Nobuyoshi Nakada 2f1586f6f2 Check leaked global symbols by default 2023-04-03 10:07:22 +09:00
Nobuyoshi Nakada 677c3228d0 Check loading built-in binaries 2023-03-08 13:59:21 +09:00
Takashi Kokubun 23ec248e48 s/mjit/rjit/ 2023-03-06 23:44:01 -08:00
Takashi Kokubun 2e875549a9 s/MJIT/RJIT/ 2023-03-06 23:44:01 -08:00
Takashi Kokubun 011c08b643 Remove obsoleted mjit_sp_inc.inc.erb 2023-03-06 23:05:50 -08:00
Takashi Kokubun b2130d5f5d Remove obsoleted tool/mjit_tabs.rb 2023-03-06 22:53:38 -08:00
Takashi Kokubun 2702d615f5 Remove obsoleted mjit_config.h 2023-03-06 22:31:43 -08:00
Takashi Kokubun f68580890f Stop building mjit_build_dir.so 2023-03-06 22:14:44 -08:00
Takashi Kokubun 31f4b2d86b
Drop obsoleted MJIT header (#7458)
RJIT doesn't need this.
2023-03-06 21:41:48 -08:00
Nobuyoshi Nakada 72811deaa8
MSWin: Use MESSAGE_BEGIN/MESSAGE_END instead of bare `echo`
To strip enclosing double quotes.
2023-03-02 19:18:13 +09:00
Alan Wu 675e296641
Add .DELETE_ON_ERROR to Makefile
This instructs make to delete target files if the recipe fails midway, like
when make itself is interrupted. This is mostly for development since it
protects against corrupt builds that need a `make clean` to repair. Release
builds normally don't fail mid-recipe.

GNU make and BSD make support this.

From GNU make's manual:

> This is almost always what you want make to do, but it is not historical
> practice; so for compatibility, you must explicitly request it. 

See https://innolitics.com/articles/make-delete-on-error/
2023-02-06 14:50:06 -05:00
Nobuyoshi Nakada be81495c16
Silence dozens of useless warnings from `nm` on macOS 2023-01-31 19:42:01 +09: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
Nobuyoshi Nakada 1e2523fad7
Silence dozens of useless warnings from `ranlib` on macOS [ci skip] 2023-01-23 19:02:36 +09:00
Nobuyoshi Nakada 418b03c750
tool/leaked-globals: ignore function typedef [ci skip] 2023-01-21 19:26:16 +09:00
Hiroshi SHIBATA 18d8333c30 Switch to use gem version of simplecov, not git clone 2023-01-18 20:19:08 +09:00
Nobuyoshi Nakada 1ddeb7473d
Move the dependency of makefiles on revision header [ci skip]
Since `REVISION_H` is defined in common.mk which is appended or
included after Makefile.in, it was undefined yet at the point of the
dependency.
2023-01-14 20:30:19 +09:00
Nobuyoshi Nakada 5716c0f1f8
MSVS lacks `touch` [ci skip] 2022-12-20 17:53:41 +09:00
Nobuyoshi Nakada 0344283fd3
Fix missing parentheses [ci skip] 2022-12-20 16:07:10 +09:00
Nobuyoshi Nakada 7a976c1060
[Bug #19181] Separate the rule for unicode_normalize/tables.rb timestamp
It should depends on only existing data files (except for the tools),
unless `ALWAYS_UPDATE_UNICODE=yes`.
2022-12-10 13:58:20 +09:00
卜部昌平 940b3170c1 document for commit 5bbba76489 [ci skip] 2022-12-07 15:09:12 +09:00
Nobuyoshi Nakada 30379e33c3
Handle depend files on nmake 2022-12-05 17:09:49 +09:00
Takashi Kokubun a1d70f5b12 MJIT: Rename mjit_compile_attr to mjit_sp_inc
There's no mjit_compile.inc, so no need to use this prefix anymore.
2022-11-29 21:45:34 -08:00
Nobuyoshi Nakada 2f7d2662dd
Control non-parallel parts with `.WAIT` if available 2022-11-13 23:54:43 +09:00
Nobuyoshi Nakada 60f12c7d2e
Fix infinite loop when out-of-place build 2022-11-02 11:33:08 +09:00
Nobuyoshi Nakada 9b462aec4a
Follow up "Rework `first_lineno` to be `int`." 2022-10-28 19:33:19 +09:00
Hiroshi SHIBATA a25c033805 Suppress warning for fgrep
>fgrep: warning: fgrep is obsolescent; using ggrep -F
2022-10-19 21:10:00 +09:00
Nobuyoshi Nakada dc7d929e54
Extract `RUBY_RELEASE_DATE` from also revision.h
This make variable is very useful for daily build.
2022-09-25 22:40:05 +09:00
Takashi Kokubun 45ecc30a63 Move mjit/instruction.rb rule to common.mk
as suggested by nobu. We don't really need to generate this for Windows,
but using common.mk whenever possible would probably make maintenance
easier.
2022-09-18 21:16:15 +09:00
Takashi Kokubun a988fe0b3e
Introduce --basedir to insns2vm.rb
and leverage that to preserve the directory structure under tool/ruby_vm/views
2022-09-18 14:39:53 +09:00
Takashi Kokubun 12023c833f
Revert "Preserve the directory structure under tool/ruby_vm/views"
This reverts commit 62ec621f8c.

will revisit this once fixing non-MJIT targets
2022-09-18 14:21:40 +09:00
Takashi Kokubun 62ec621f8c
Preserve the directory structure under tool/ruby_vm/views
for nested target directories
2022-09-18 14:19:22 +09:00
Takashi Kokubun 0e816e6d30
Demote mjit_instruction.rb from builtin to stdlib 2022-09-18 14:04:20 +09:00
Lars Kanis 518301883e Fix parallel build on MINGW
When the build is running with a base ruby then generating `x64-ucrt-ruby320.rc`
could fail due to a missing dependency to `x64-mingw-ucrt-fake.rb`.
This commit adds this dependency.

A failing build looks like so:
```
generating x64-mingw-ucrt-fake.rb
generating x64-ucrt-ruby320.rc
../snapshot-master/win32/resource.rb:in `require': cannot load such file -- ./x64-mingw-ucrt-fake (LoadError)
make: *** [GNUmakefile:57: x64-ucrt-ruby320.rc] Error 1
make: *** Waiting for unfinished jobs....
linking miniruby.exe
x64-mingw-ucrt-fake.rb updated
```
2022-09-10 09:32:27 +09:00
Nobuyoshi Nakada 9faa9ced96 Support sub-library in builtin-loader
Previously, it was supported in prelude.c, but has not followed up the
builtin-loader system.
2022-09-09 15:47:24 +09:00
Nobuyoshi Nakada be56033248
Move RDoc `--`/`++` directives to comments 2022-09-09 14:23:39 +09:00
Nobuyoshi Nakada a977c66312
Generate token ID indexes in id.def
Separate the logic accross the tables from the template view for
id.h.
2022-09-08 18:18:56 +09:00
Nobuyoshi Nakada 2d57447ae8
Fix missing replacement in 1f91dcdab3 2022-09-07 19:07:24 +09:00
Nobuyoshi Nakada 1f91dcdab3
Define BOOTSTRAPRUBY from HAVE_BASERUBY 2022-09-07 14:33:25 +09:00
Takashi Kokubun 3767c6a90d
Ruby MJIT (#6028) 2022-09-04 21:53:46 -07:00
Nobuyoshi Nakada 4d469472e2
Debugging snapshot [ci skip] 2022-09-05 13:08:23 +09:00
Nobuyoshi Nakada 1420333455
Fix fake.rb expansion from preprocessed version.h 2022-09-05 11:25:42 +09:00
Nobuyoshi Nakada 68a092a469
Set fake.rb variables by command line arguments
Then fallbacks to preprocessed version.h.
2022-09-05 11:16:20 +09:00
Nobuyoshi Nakada 7c67d0fd79
Make sources by BASERUBY if available instead of miniruby 2022-09-03 19:25:29 +09:00
Nobuyoshi Nakada 6f5305e0d2
Exclude LIBPATHENV wrapper from PREP 2022-09-03 19:20:03 +09:00
Nobuyoshi Nakada bc5b9be1ee
Move duplicate dependencies 2022-09-03 15:01:05 +09:00
Nobuyoshi Nakada 2b967cd4b7
Let fake.rb allow newlines in expanded strings 2022-08-31 17:56:31 +09:00
Nobuyoshi Nakada a58a429f8b
Silent configure does not output cached configurations 2022-08-14 14:42:10 +09:00
Nobuyoshi Nakada 32d1ce96e0
Fix race conditions when cleaning extensions
Clean built directories by `make distclean`, and then clean leftover
makefiles for skipped extensions.
2022-08-11 17:45:57 +09:00
Nobuyoshi Nakada 0c9803b0fd
The "gems" build directory was rename as ".bundle" 2022-08-11 17:45:39 +09:00
Nobuyoshi Nakada 26054c7461
Fix paths of exts.mk to clean
exts.mk files are one level under the top of extension directories.
2022-08-11 17:43:46 +09:00
Nobuyoshi Nakada 74d95744bd
Add `--enable-devel` configure option
Since `RUBY_DEVEL` in cppflags has no effect in the configure script
and makefiles.
2022-08-11 11:34:52 +09:00
Takashi Kokubun 5b21e94beb Expand tabs [ci skip]
[Misc #18891]
2022-07-21 09:42:04 -07:00
Jakub Kulík 31bd79dda3
Add yjit.o to DTRACE_DEPENDENT_OBJS
In principle, we have a DTrace probe in yjit.c, so yjit.o should be
in DTRACE_DEPENDENT_OBJS for DTRACE_REBUILD=yes builds. This commit
adds to the list.

In practice DTRACE_REBUILD=yes implies the system has a Solaris-like
DTrace and YJIT doesn't support those systems. YJIT_OBJ expands to
nothing, and yjit.c isn't compiled.

I tested on OmniOS v11 r151034m with:

    $ ../src/configure --with-out-ext=psych MAKE=gmake AR=ar debugflags=-g
    $ gmake -j

It builds before and after this change.

[Bug #18480]
2022-05-30 18:30:57 -04:00
Nobuyoshi Nakada 11793f897c
Reduce duplicate replacements
Reduce duplicate replacements so that reflect macros in command lines
consitently.  So that reflect macros in command lines.  Others than
`nmake` have no problems with nested expansions.
2022-05-30 12:03:57 +09:00
Nobuyoshi Nakada cdfb027213
Run find in PATH [ci skip] 2022-05-25 18:26:24 +09:00
Nobuyoshi Nakada 0114c72df0
Clean intermediate files for update-deps [ci skip] 2022-05-25 15:06:47 +09:00
Nobuyoshi Nakada 97c12c5f69 Clean intermediate object files 2022-05-18 14:33:00 +09:00
Nobuyoshi Nakada 9a0f5a8edc Verbose mode on libyjit merge 2022-05-18 14:33:00 +09:00
Nobuyoshi Nakada 9b3ed5a23f Extract YJIT_LIBS directly without copying 2022-05-18 14:33:00 +09:00
Nobuyoshi Nakada 3db8db8a32 `AR` does not need the absolute path
Still use `find` to get rid of potential ARGV limit overflow, since
rustc-genrated object file names are mangled and very long.
2022-05-18 14:33:00 +09:00
Nobuyoshi Nakada 2411f0ad8c
Set `target_os` for a7577dbfd3 2022-05-17 12:14:32 +09:00
Alan Wu 99281f513c YJIT: Handle spaces in build dir path using find(1) `-exec`
Previously, we relied on shell word splitting, which leads
to passing the wrong arguments when there are white spaces
in the path.

Avoiding command substitution also makes this script more
likely to work under Solaris 10, where `/bin/sh` is not
POSIX compliant [1]. (Thanks you, `@znz` for fixing the syntax
error in 4210ae2158 though!)

The hack from c466f270b8
doesn't actually work so this commit reverts it. The shell
still needs to parse through all of the code, maybe because
make doesn't in fact send newlines to the shell.

By the way, we also use the `-exec` option in the `ext/distclean` task.

[1]: https://docs.oracle.com/cd/E26505_01/html/816-5165/sh-1.html
2022-04-28 19:02:26 -04:00
Kazuhiro NISHIYAMA 4210ae2158
Try to fix error on Solaris
https://rubyci.s3.amazonaws.com/solaris10-sunc/ruby-master/log/20220428T000004Z.fail.html.gz
```
linking static-library libruby-static.a
/bin/sh: syntax error at line 8: `(' unexpected
gmake: *** [Makefile:318: libruby-static.a] Error 2
exit 2
failed(make)
```
2022-04-28 09:44:38 +09:00
Alan Wu c466f270b8 Work around shell syntax error on Solaris
The shell in Solaris 10 has trouble understanding the syntax I used in
YJIT's library merging script.

This commit reduces the code the shell needs to parse before exiting on
non-YJIT builds to hopefully fix the error on Solaris.
2022-04-27 18:59:10 -04:00
Alan Wu f90549cd38 Rust YJIT
In December 2021, we opened an [issue] to solicit feedback regarding the
porting of the YJIT codebase from C99 to Rust. There were some
reservations, but this project was given the go ahead by Ruby core
developers and Matz. Since then, we have successfully completed the port
of YJIT to Rust.

The new Rust version of YJIT has reached parity with the C version, in
that it passes all the CRuby tests, is able to run all of the YJIT
benchmarks, and performs similarly to the C version (because it works
the same way and largely generates the same machine code). We've even
incorporated some design improvements, such as a more fine-grained
constant invalidation mechanism which we expect will make a big
difference in Ruby on Rails applications.

Because we want to be careful, YJIT is guarded behind a configure
option:

```shell
./configure --enable-yjit # Build YJIT in release mode
./configure --enable-yjit=dev # Build YJIT in dev/debug mode
```

By default, YJIT does not get compiled and cargo/rustc is not required.
If YJIT is built in dev mode, then `cargo` is used to fetch development
dependencies, but when building in release, `cargo` is not required,
only `rustc`. At the moment YJIT requires Rust 1.60.0 or newer.

The YJIT command-line options remain mostly unchanged, and more details
about the build process are documented in `doc/yjit/yjit.md`.

The CI tests have been updated and do not take any more resources than
before.

The development history of the Rust port is available at the following
commit for interested parties:
1fd9573d8b

Our hope is that Rust YJIT will be compiled and included as a part of
system packages and compiled binaries of the Ruby 3.2 release. We do not
anticipate any major problems as Rust is well supported on every
platform which YJIT supports, but to make sure that this process works
smoothly, we would like to reach out to those who take care of building
systems packages before the 3.2 release is shipped and resolve any
issues that may come up.

[issue]: https://bugs.ruby-lang.org/issues/18481

Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Co-authored-by: Noah Gibbs <the.codefolio.guy@gmail.com>
Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2022-04-27 11:00:22 -04:00
Alan Wu 5f1f8c244d
Fix fake.rb RUBY_DESCRIPTION faking for JITs
Previously, `make test-spec` was not printing the description with +YJIT
even when YJIT was indeed enabled. It was confusing on CI. `fake.rb` was
changing the `RUBY_DESCRIPTION` constant incorrectly.

I suppose `make test-spec` mostly needs the `mkmf` faking and not the
faking of `RUBY_.*` constants, so maybe there is an opportunity to simplify
in the future.
2022-04-11 13:28:07 -04:00
Nobuyoshi Nakada 21f006f5f7
Retrieve previously configured macros also other than `extensions` 2022-04-07 15:03:24 +09:00
Nobuyoshi Nakada 17ce0b9b84 Retrieve configured gems info 2022-04-07 09:47:10 +09:00
Nobuyoshi Nakada db3d111c1d Bundled gems are expanded under `.bundle/gems` now 2022-04-07 09:47:10 +09:00
Nobuyoshi Nakada 97ce030954 Load fake.rb at `BTESTRUBY`
So that `mkmf` checks work from `make run`, and also remove
duplicate `$(MINIRUBYOPT)` which is used in `$(MINIRUBY)`.
2022-04-05 22:35:40 +09:00
Nobuyoshi Nakada 26aff37466
Need to reconfigure and rebuild everything when abi.h changed 2022-03-23 00:58:46 +09:00
Yuta Saito 77f3f8a1d4 exts.mk.tmpl: propagate MINIRUBY to enc.mk even though invoking from exts.mk
This is another attempt to fix out-of-src build with
--with-static-linked-ext. The first attempt was
4f1888bda70981d9f5b1bf55ab692e0ce18e79f4 but reverted because it broke
out-of-src build from pre-generated sources via `make dist`.
This patch fixes the second trans C source gen, mentioned in the
previous commit message, by passing MINIRUBY as well as when invoking
from common.mk
2022-03-09 22:43:02 +09:00
Peter Zhu ffda21b7ba [Feature #18491] Drop support for HP-UX
IA64 support was dropped in ticket #15894, so we can drop support for
HP-UX.
2022-01-18 09:52:15 -05:00
Nobuyoshi Nakada 93591d31b0
Use rb_cObject instead of rb_cData 2021-12-31 10:53:54 +09:00
Takashi Kokubun 1a63468831
Prepare for removing RubyVM::JIT (#5262) 2021-12-13 23:07:46 -08:00
Takashi Kokubun 11b8aaa26a
Rename --jit to --mjit (#5248)
* Rename --jit to --mjit

[Feature #18349]

* Fix a few more --jit references

* Fix MJIT Actions

* More s/jit/mjit/ and re-introduce --disable-jit

* Update NEWS.md

* Fix test_bug_reporter_add
2021-12-13 16:08:01 -08:00
Nobuyoshi Nakada 4a6ca12904
Remove unversioned phony target for pkgconfig file [Bug #18374]
It results in a circular dependency when `--with-ruby-pc=ruby.pc`
is given.  [ci skip]
2021-12-04 16:20:30 +09:00
Naohisa Goto a982a1f1e7 Update URL about DTrace static library glommed obj [ci skip]
The old URL
http://mail.opensolaris.org/pipermail/dtrace-discuss/2005-August/000207.html
pointed to the official archive of dtrace-discuss mailing list
in opensolaris.org, disappeared in 2013.
The new URL points to the MARC Mailing list ARChives.
2021-11-17 20:59:48 +09:00
Peter Zhu aeae6e2842 [Feature #18290] Remove all usages of rb_gc_force_recycle
This commit removes usages of rb_gc_force_recycle since it is a burden
to maintain and makes changes to the GC difficult.
2021-11-08 14:05:54 -05:00
Aaron Patterson 41f405c486 Remove the scraper
Now that we're using the jit function entry point, we don't need the
scraper.  Thank you for your service, scraper. ❤️
2021-10-20 18:19:38 -04:00
Aaron Patterson 30f20d7c38 Remove some MicroJIT vestiges
Just happened to run across this, so lets fix them
2021-10-20 18:19:36 -04:00
Jose Narvaez 4e2eb7695e Yet Another Ruby JIT!
Renaming uJIT to YJIT. AKA s/ujit/yjit/g.
2021-10-20 18:19:31 -04:00
Maxime Chevalier-Boisvert e4c65ec49c Refactor uJIT code into more files for readability 2021-10-20 18:19:26 -04:00
Alan Wu 3d87eadf16 Refactor ujit_examples.h generator. Remove dwarfdump dependency 2021-10-20 18:19:24 -04:00
Nobuyoshi Nakada d53493715c
Add the dependency of GNUmakefile itself [ci skip] 2021-10-06 15:42:37 +09:00
卜部昌平 5112a54846 include/ruby/encoding.h: convert macros into inline functions
Less macros == huge win.
2021-10-05 14:18:23 +09:00
Nobuyoshi Nakada bac6e8ca5d
Stop building extension gems for now
Extension gems will be installed by the installed standard
libraries.
2021-10-04 20:03:14 +09:00