589 Commits
Author SHA1 Message Date
Nobuyoshi Nakada 4361d8e48f Reduce the requirements of lastrev
Remove baseruby from the prerequisites so that `lastrev` will work as
long as Git is installed.
2026-10-15 17:08:51 +09:00
Hiroshi SHIBATAandClaude Opus 5.5 966eaa54c2 [Bug #19831] Do not repeat $(MAINLIBS) when linking ruby statically
`$(LIBRUBYARG_STATIC)` already ends with `$(MAINLIBS)`, so appending them again makes the Xcode 15+ linker warn about duplicate libraries. The shared ruby still needs `$(MAINLIBS)` [Bug #20072], so drop them only when `$(LIBRUBYARG)` is the static one. `PROGRAM_LIBS` is internal to the build and is not exported to rbconfig.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 12:43:50 +09:00
Samuel Williams e96cea4e03 coroutine: add native behavior tests. (#18817) 2026-09-14 19:27:52 +12:00
Hiroshi SHIBATAandClaude Fable 5.1 a25240e51d Link ruby with static extensions only through exts
With --with-static-linked-ext, the archives, libraries and Init
functions of the extensions are known only to exts.mk, and the
top-level $(PROGRAM) rule linked ruby with a bare EXTOBJS whenever
its prerequisites changed.  The sub-make from exts.mk relinked it
correctly afterwards only because it happened to come later, and
because configuring ext/-test- deletes ext/extinit.c.  With `make -j`
under GNU make 3.81, or 4.4 with `DOT_WAIT=`, `programs` and
`test-precheck` ran that link and the exts sub-make at once, leaving
a ruby without any extension or encoding, or no ruby at all when the
two links collided in codesign.  A bare `make ruby` gave the same
broken ruby even serially.

Now the top-level $(PROGRAM) depends on `exts` instead of linking
when PROGRAM_EXTS is set, and only the sub-make, which passes
PROGRAM_EXTS empty along with the real EXTOBJS, links.  EXTOBJS at
the top level is always dmyext.o so that ext/extinit.c is generated
only with the full EXTINITS.  `.WAIT` stays in the test targets; it
still keeps the outputs of the dynamic build from interleaving, but
the correctness of the static build no longer depends on it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-09 06:55:14 +09:00
Nobuyoshi Nakada 8268969efb [Misc #22206] Regenerate build dependencies through make
Keep the core dependency generation rule in `depend` so configure and
Windows setup share the same entry point.  Preserve NMake output when
the generated dependency file is rebuilt.
2026-08-16 18:09:21 +09:00
Nobuyoshi Nakada dca417bde7 [Misc #22206] Parse mkdepend options with OptionParser
Replace `-s` globals with explicit command options and standard long
option names. Group source selection under `--scope` and represent
output behavior as a single mode so command-line precedence is clear.

Keep command-line parsing and option dispatch inside `Mkdepend`, and
return command success directly from `Mkdepend.main`.
2026-07-23 00:54:13 +09:00
Nobuyoshi Nakada d0dc160347 [Misc #22206] Generate extension dependencies after configuring Ruby
Generate only core and encoding dependencies during configure.
Generate extension dependency files from `configure-ext.mk` after
`miniruby` is available, so `THREAD_MODEL` can be resolved before
rules enter an extension Makefile.

Select the extension scope when `-extensions` is passed.  Keep quoted
project-internal headers ahead of similarly named public headers while
scanning extension sources.  Limit snapshot expansion to files needed
before `miniruby`.
2026-07-23 00:54:12 +09:00
Nobuyoshi Nakada 7d4461e162 [Misc #22206] Generate dependencies without compiler builds
Replace `tool/update-deps` with a Ruby source scanner so dependency
updates no longer require GNU make, a configured build, or compiler
preprocessor output.

Keep compact source mappings and scanner declarations in dependency
files, and expand complete rules into the build directory.  Avoid the
temporary fixture headers required by the compiler-driven prototype.

Use the generated rules from GNU make, BSD make, and NMake builds.
Support out-of-tree and read-only source trees, and retain expanded
dependencies shipped in release archives when baseruby is unavailable.
2026-07-23 00:04:47 +09:00
Nobuyoshi Nakada 2642c30cc6 Remove macros only for the core from rbconfig.rb 2026-07-19 02:58:14 +09:00
Nobuyoshi Nakada 2d894aeb07 Suppress C99 mode warnings 2026-07-13 20:03:55 +09:00
Benoit Daloze d677c4f1df Add {Method,UnboundMethod,Proc}#source_range
* Add exhaustive specs.
* Avoid hardcoded lines in existing method and proc specs.

[Feature #21998]
2026-07-10 12:14:22 +02:00
Peter Zhu 01c5b2e890 Update DTRACE_DEPENDENT_OBJS
Commit 89e7b08 added thread.c and vm_sync.c to have DTrace probes, we need
to update DTRACE_DEPENDENT_OBJS to fix FreeBSD.
2026-07-07 23:48:16 -04:00
Nobuyoshi Nakada 172bdf5881 Fix static-linked-exts dependency 2026-07-02 12:02:18 +09:00
Nobuyoshi Nakada 988fbe038f Move EXTSTATIC check to PRE_LIBRUBY_UPDATE 2026-07-02 12:02:18 +09:00
Hiroshi SHIBATAandClaude Opus 4.8 ef4626e5b9 Move test-syntax-suggest recipe from template/Makefile.in to common.mk
template/Makefile.in is used only by the GNU make build, so on mswin the
common.mk stub was an empty rule and nmake check silently skipped the
SyntaxSuggest spec. Move the recipe to common.mk so both builds share it,
matching how test-bundled-gems-spec is already shared.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 17:43:15 +09:00
Nobuyoshi Nakada 43f17f1672 Add --with-ext and --without-ext options to configure-ext.mk 2026-05-21 14:27:09 +09:00
Nobuyoshi Nakada c4b3630f5e [Bug #22003] Refactor template/configure-ext.mk.tmpl
- Select extension library directories by globbing extconf.rb.
- Exclude extensions for test before uniquifing bundled gems.
- Use `Dir.glob` base option to remove prefixed srcdir.
2026-04-16 01:14:22 +09:00
Jean Boussier 9a2ffd8e54 Fix sending backtraces across ractors
[Bug #21818]

Currently exceptions can be sent across ractors,
but because of a limitation in the TypedData API,
the exception backtrace is duped as an empty backtrace.

The problem is that backtraces are embedded objects,
hence the classic `rb_class_alloc(klass)` API is insufficient
because we need to know the size of the Backtrace object we're
duping to instantiate the copy.

This is worked around by changing Ractors to call `#clone` on objects
rather than use `rb_obj_clone`, and to implement `Thread::Backtrace#clone`
to properly clone the variable size object.
2026-04-01 11:43:55 +01:00
Nobuyoshi Nakada 70f5f86118 Distinguish the executable suffixes
Build and target executable suffixes are unrelated in
cross-compilation.
2026-03-30 00:33:28 +09:00
Nobuyoshi Nakada ee2c1528b8 Fix dump_ast build for cross-compiling 2026-03-29 23:14:02 +09:00
Nobuyoshi Nakada cdb1a42949 Get rid of using GNU sed extension T 2026-03-26 13:25:17 +09:00
Nobuyoshi Nakada af85de873a Do not update the dump_ast specified in the configure options 2026-03-18 02:20:49 +09:00
Kevin Newton a70dbe1065 Use Prism for mk_builtin_loader.rb 2026-03-13 09:15:28 -04:00
Jean Boussier 82e796b1eb Revert "[Bug #19831] Remove duplicate library warning"
This reverts commit d256629bf9.
2026-02-21 05:12:29 +01:00
Étienne Barrié d256629bf9 [Bug #19831] Remove duplicate library warning
When building on macOS, we get a warning about duplicate libraries

    ld: warning: ignoring duplicate libraries: '-ldl', '-lobjc', '-lpthread'

To fix it, we now append $(MAINLIBS) to LIBRUBYARG_SHARED (when shared
is enabled), matching what's already done for LIBRUBYARG_STATIC. And we
remove the now-redundant $(MAINLIBS) from the $(PROGRAM) link line,
since $(LIBRUBYARG) carries it in both cases.
2026-02-18 22:04:51 +09:00
Nobuyoshi Nakada c46fe31138 [Bug #21862] Extract -D/-U options only for dtrace
A workaround for GH-12563#issuecomment-3691590489.
2026-02-12 19:20:50 +09:00
Jarek ProkopandAlan Wu 25c72b0e8e Support customizable rustc_flags for rustc builds.
Add `rustc_flags` option for configure that appends to RUSTC_FLAGS
flags used when compiling with rustc for customizable build flags.
It appends to existing defaults in RUSTC_FLAGS.

Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
2026-01-06 23:55:06 -05:00
Nobuyoshi Nakada c26057ebaf [Bug #21779] Do not export InitVM functions
Fix ruby/io-console#105.
2025-12-14 11:11:52 +09:00
Alan Wu 029a48176c JITs: Drop cargo and use just rustc for release combo build
So we don't expose builders to network flakiness which cannot be worked
around using cargo's --offline flag.
2025-12-10 16:35:00 -05:00
Nobuyoshi Nakada 52426a22de Remove an excess colon [ci skip] 2025-11-27 08:10:56 +09:00
Nobuyoshi Nakada b9a213f791 Fix timezone of yesterday
Set the `TZ environment variable.  `git log` does not recognize UTC
offset in `--before` option, unless full datetime is given.
2025-11-21 17:34:03 +09:00
Étienne Barrié 03f714de62 Remove warning when generating $(arch)-fake.rb
This happens if BASERUBY is Ruby 3.4.

    $ rm -f *-fake.rb && make test-precheck RUBYOPT=-w >/dev/null
    build/arm64-darwin24-fake.rb:28: warning: ::Ruby is reserved for Ruby 3.5
2025-10-07 12:33:50 +09:00
Nobuyoshi Nakada a2849239db Expect git -C <path> to work
This option is available since git 1.8.5 that was released in 2013.
2025-09-16 20:28:37 +09:00
Takashi Kokubun 0cec87399d Rename VM instruction classes to singular names (#14507) 2025-09-10 14:04:33 -07:00
Takashi Kokubun 4f030951f2 ZJIT: Invalidate local variables on EP escape (#14448) 2025-09-05 11:26:01 -07:00
Mari Imaizumi ed0ffcdc80 Remove unnecessary Enumerable#each_slice
This method has been a built-in feature since Ruby 1.8.7, so this
fallback implementation is no longer needed.

Ref: https://docs.ruby-lang.org/en/3.4/NEWS/NEWS-1_8_7.html
2025-09-01 08:17:21 +09:00
Nobuyoshi Nakada d0d7f55005 Gererate prism source files dependencies from template.rb
Update included file list automatically.
2025-08-19 11:55:23 +09:00
Nobuyoshi Nakada 90cb2bb871 Gererate prism source files dependencies from template.rb 2025-08-18 01:01:31 +09:00
Nobuyoshi Nakada 7c28fb2fb2 [Bug #21546] Make the generated pc file relocatable 2025-08-17 17:13:15 +09:00
Nobuyoshi Nakada 401932c18f NMake needs caret to escape a hash sign 2025-08-12 18:19:09 +09:00
Nobuyoshi Nakada b3598cf2a3 Win: Strip CRs from cpp and nm output
The combination of mingw tools and cygin/msys2 ruby leaves CRs.
2025-08-01 00:15:27 +09:00
Jean Boussier d488935910 Get rid of ID_JUNK
It has been aliased as ID_INTERNAL for a long time and that alias
is much more descriptive.
2025-07-28 12:22:42 +02:00
Nobuyoshi Nakada fb6f255028 Rename builtin_binary.inc as .rbbin
Distinguish between platform-dependent ".rbbin" and platform-
independent ".inc" files.
2025-07-26 20:19:55 +09:00
Hiroshi SHIBATA be7b1164e6 Split autogenerated dependency to depend file from common.mk 2025-07-25 19:50:06 +09:00
Alan Wu 5ee3937a9c ZJIT: Have make zjit-test use the same Cargo features as miniruby
This is so that e.g. building with `--enable-zjit=dev` will test with the
disassembly feature. It makes more sense, saves on build time and
reveals that
`backend::arm64::tests::sp_movements_are_single_instruction` was in
fact failing with the `disasm` feature.
2025-07-16 14:10:22 -04: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 b48b841378 digest.so needs ruby/digest.h which is installed by build-ext 2025-05-12 02:50:25 +09:00
Alan Wu 33909a1c69 YJIT: ZJIT: Share identical glue functions
Working towards having YJIT and ZJIT in the same build, we need to
deduplicate some glue code that would otherwise cause name collision.
Add jit.c for this and build it for YJIT and ZJIT builds. Update bindgen
to look at jit.c; some shuffling of functions in the output, but the set
of functions shouldn't have changed.
2025-05-02 23:47:57 +09:00
Nobuyoshi Nakada b42afa1dbc Suppress gcc 15 unterminated-string-initialization warnings 2025-04-30 20:04:10 +09:00
Nobuyoshi Nakada 37db51b441 Suppress error message when gc is cleaned already [ci skip] 2025-04-28 19:55:26 +09:00