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.
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.
* 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.
* 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.
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.
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.
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`.
7305356097
```
WARNING: open-ended dependency on irb (>= 1.5.0) is not recommended
if irb is semantically versioned, use:
add_runtime_dependency 'irb', '~> 1.5', '>= 1.5.0'
WARNING: open-ended dependency on reline (>= 0.3.1) is not recommended
if reline is semantically versioned, use:
add_runtime_dependency 'reline', '~> 0.3', '>= 0.3.1'
WARNING: See http://guides.rubygems.org/specification-reference/ for help
/usr/lib/ruby/2.7.0/rubygems/specification_policy.rb:418:in `error': specification has warnings (Gem::InvalidSpecificationException)
```