The current version is too dynamic for rdoc
and so C methods like `Ruby::Prism.lex` are not doccumented.
Also tweak `Ruby::Prism` introduction. Ruby makes breaking changes
in minor versions all the time, no need to call it out.
prism will be built into the interpreter as a plain library under the
Ruby::Prism namespace, not as a default gem (the prism gem becomes a
bundled gem). Teach the sync tool about the new layout:
- lib/prism{,.rb} is mapped to lib/ruby/prism{,.rb}, and the gemspec is
no longer imported.
- prism_do_fixup rewrites the namespace of the synced files, so that the
upstream repository does not need to know about the renaming:
* Ruby: `Prism` -> `Ruby::Prism`, and `require`/`autoload` of
"prism/..." -> "ruby/prism/..." (require_relative is untouched)
* C: rb_define_module("Prism") -> rb_define_module_under(Ruby, "Prism")
The C rule applies to plain C files, and the Ruby rule to the others,
including the ERB templates and the template engine
(prism/templates/template.rb, i.e. Ruby::Prism::Template).
The rewrite is idempotent and is applied in both the full-copy sync
and the commit-by-commit sync (fixup_commit) used by GitHub Actions.
- check_prerelease_version skips prism, which has no gemspec in-tree.
Unit tests for the rewrite rules are added to
tool/test/test_sync_default_gems.rb.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Ranking tag names picked up ruby/ruby's own tags fetched into a clone, such as v4.0.2 in syntax_suggest, and skipped prereleases like RubyGems 4.1.0.beta1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test-bundled-gems runs the tests with the test-unit gem, which loads EnvUtil through gems/lib but never goes through tool/lib/test/unit.rb, so the scale was ignored there. `--timeout-scale` still takes precedence.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EnvUtil passes RUBY_ON_BUG down to child processes, so one set for the whole test run acts on these two tests, which crash a child on purpose. The foreign store test runs only with RUBY_DEBUG. The other such tests already clear it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Like the other tests that crash a child on purpose, these leave a core on every run wherever the core size limit allows it, which buries real crashes among the collected dumps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A relative name was expanded against the current directory first, so a
build directory nested inside the source tree made generated files such
as ext/ripper/ripper.y look like source-tree files, and the extension's
own depend file was no longer found.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
On Windows, Process.kill raises Errno::ESRCH for a child that has exited but has not been reaped, so terminate returned a stale $? and left the child to ZombieHunter. TestIO#test_write_32bit_boundary hit this on Windows 11-arm, where the child finished writing after its timeout expired and before it was killed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`update_default_gems` had no coverage, so nothing pinned the one thing it must not do to a gem checkout: swap it over to the ruby/ruby tree. The fixture drives it against local repositories, so the fetch it still needs stays offline.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Upstream bumps the version right after a release, so a synced tree usually holds a version nobody can install, and `bundle install` against ruby-dev locks to it. `check_prerelease_version` already knows the latest released version, so append `.dev` there when the tree is ahead of it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The last -W switch wins, so prepending it left an inherited -w or -W2 in
control and the suppression quietly did nothing. `make test-all
RUBYOPT=-w` reproduces it: under `RUBY_BOX=1` test_open3.rb and
test_pty.rb stay at 12 and 4 failures, and reach 0 once the switch moves
behind the inherited options and in front of the bare "-".
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
test-all already turns experimental warnings off for its own process,
but tests that spawn ruby directly with Open3, IO.popen or PTY assert
the captured output verbatim. With `RUBY_BOX=1` in the environment
every child prints the Ruby::Box experimental warning to stderr, and 51
tests and specs fail on it. Pass `-W:no-experimental` down through
RUBYOPT. It has to precede the bare "-" that common.mk puts there,
because that ends the option scan.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Replacing PATH with only the build directory breaks the spawned
ruby.exe on MSYS2 UCRT64, where the Windows DLL loader needs PATH to
resolve libgmp-10.dll linked into the ruby DLL. Prepend the directory
instead so the build ruby is still found first.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
tool/mkdepend.rb resolved dependency names against the current working
directory before falling back to the source root. When configure
re-runs in an already-built build directory nested inside the source
tree (e.g. .ruby under the checkout), leftover generated files such
as builtin_binary.rbbin got emitted as build-dir-relative paths:
builtin.$(OBJEXT): .ruby/builtin_binary.rbbin
Make satisfies such a prerequisite through VPATH as a plain existing
file, so it never matches the builtin_binary.rbbin rule and the file is
never regenerated. Linking a stale builtin_binary.rbbin with
up-to-date *.rbinc function tables then makes the built ruby fail to
boot during make install:
<internal:gc>: builtin function index (8) mismatch (expect _bi454 but _bi464) (ArgumentError)
The same defect also emitted .ruby/probes.h and
.ruby/vm_call_iseq_optimized.inc, and dropped the enc/trans/*.trans
dependencies of the generated transcoder sources.
Convert dependency names against the source root only, never the
current working directory, so that generated files keep the bare names
their Make rules use and the generated dependencies no longer vary with
leftover build artifacts.
Accept `VAR=value` on the command line while keeping
`--thread-model` as a discoverable shortcut.
Pass `LOCAL_HDRS` from `mkmf` so dependencies already covered by
manual rules are not duplicated in the autogenerated section.
`thread_model` controls one dependency generation run rather than the
identity of a dependency updater. Accept it in `run` and invalidate
cached declarations when it changes.
Allow extension projects to update marked dependency sections after
`create_makefile` has resolved their source and object lists.
Share the dependency scanner with `tool/mkdepend.rb` so bundled and
upstream extensions can generate the same dependency files.
Skip dependency generation when exporting stable branches that
predate the Ruby dependency scanner. Avoid loading GNU make
definitions into the temporary Makefile so snapshot generation also
works with BSD make.
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`.
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`.
Use depends declarations for emitted dependency names instead of
overloading generated declarations or rewriting thread headers in
code. This keeps scanning, generation, and dependency expansion
separate and makes platform-selected thread dependencies explicit.
Move fixed preprocessor macro handling into dependency declarations so
the scan inputs and emitted dependencies are visible in depend files.
Add source-specific define and undef declarations for `parse.y` and
`ripper.y`.
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.
The test runner split -Idirectory on a hardcoded ":", so on Windows an
absolute path such as -IV:/foo/lib was broken into "V" and "/foo/lib".
The tail only resolved by accident when the current drive matched.
File::PATH_SEPARATOR is the right delimiter, matching ruby -I itself.
This is the same class of bug as the test-syntax-suggest -I fix in
commit 3c7a4c174f, which replaced ":" with $(PATH_SEPARATOR) in
common.mk. Makefiles only pass relative paths, so this stayed latent.
to survey the following failure:
```
1) Failure:
TestFile#test_stat [/tmp/ruby/src/trunk-repeat20/test/ruby/test_file.rb:412]:
Expected |1770056232.744032 - 1770056230.6465776| (2.097454309463501) to be <= 1.
```
BTW I found that `test/ruby/test_file.rb:412` `assert_in_delta atime, stat.atime.to_f, delta`
only fails (mtime, ctime doesn't fail on 100 days).