* YJIT: check that we correctly auto-enable YJIT on Linux
YJIT should be automatically built on Linux x86-64 when
rustc is present, and we should see +YJIT in the version string.
* Use miniruby rather than system ruby
It's moved from k0kubun to ruby org.
Also, we don't need JavaScript eval to generate branch if we use
github.ref_name, so v3.0.0 is a version that doesn't use eval.
Co-Authored-By: Nobuyoshi Nakada <nobu@ruby-lang.org>
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
* YJIT: Show --yjit-stats of railsbench on CI
* YJIT: Use --enable-yjit=dev to see ratio_in_yjit
* YJIT: Show master GitHub URL for quick comparison
* YJIT: Avoid making CI red by a yjit-bench failure
We want to make it convenient for people to build YJIT and Rust version 1.58.1
or above is available on Ubuntu Jammy, Debian testing, and Fedora 36 through
the usual package manager on those systems. This saves the need to install
`rustup` for some people.
Our code is already 1.58.1 compatible so this commit simply tweaks CI to make
sure that we keep supporting that version. We still test against the latest Rust
version in `--enable-yjit=dev` builds through the Rust version available in
GitHub's CI image.
Rust versions older than 1.58.1 might build YJIT today, but we might make
incompatible changes in the future.
Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
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>
Cache downloaded external libraries/gems, which are expected not
changed so frequently.
Also sometimes downloading from zlib returns the current time as
the date header in unexpected format, and checksums mismatch at
that time.
* Add --yjit-no-type-prop so we can test YJIT without type propagation
* Fix typo in command line option
* Leave just two test workflows enable for YJIT
tool/test-bundled-gems.rb use sub processes for testing bundled gems and
doesn't support RUN_OPTS. We weren't enabling YJIT for these tests.
Use an include config with RUBY_YJIT_ENABLE to turn on YJIT for these
tests.
Note that we only test with the default call threshold in this setup,
which is the same as before YJIT was off by defauft. The
--yjit-call-threshold command line was never passed to the tests.