summaryrefslogtreecommitdiff
path: root/doc/contributing/building_ruby.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/contributing/building_ruby.md')
-rw-r--r--doc/contributing/building_ruby.md27
1 files changed, 19 insertions, 8 deletions
diff --git a/doc/contributing/building_ruby.md b/doc/contributing/building_ruby.md
index c0eafe182f..286bd1f116 100644
--- a/doc/contributing/building_ruby.md
+++ b/doc/contributing/building_ruby.md
@@ -17,7 +17,7 @@
* [autoconf] - 2.67 or later
* [gperf] - 3.1 or later
* Usually unneeded; only if you edit some source files using gperf
- * ruby - 3.0 or later
+ * ruby - 3.1 or later
* We can upgrade this version to system ruby version of the latest
Ubuntu LTS.
* git - 2.32 or later
@@ -184,7 +184,7 @@ cause build failures.
## Building on Windows
The documentation for building on Windows can be found in [the separated
-file](../windows.md).
+file](../distribution/windows.md).
## More details
@@ -260,11 +260,25 @@ This will add launch configurations for debugging Ruby itself by running `test.r
### Compiling for Debugging
-You should configure Ruby without optimization and other flags that may
-interfere with debugging:
+You can compile Ruby with the `RUBY_DEBUG` macro to enable debugging on some
+features. One example is debugging object shapes in Ruby with
+`RubyVM::Shape.of(object)`.
+
+Additionally Ruby can be compiled to support the `RUBY_DEBUG` environment
+variable to enable debugging on some features. An example is using
+`RUBY_DEBUG=gc_stress` to debug GC-related issues.
+
+There is also support for the `RUBY_DEBUG_LOG` environment variable to log a
+lot of information about what the VM is doing, via the `USE_RUBY_DEBUG_LOG`
+macro.
+
+You should also configure Ruby without optimization and other flags that may
+interfere with debugging by changing the optimization flags.
+
+Bringing it all together:
```sh
-./configure --enable-debug-env optflags="-O0 -fno-omit-frame-pointer"
+./configure cppflags="-DRUBY_DEBUG=1 -DUSE_RUBY_DEBUG_LOG=1" --enable-debug-env optflags="-O0 -fno-omit-frame-pointer"
```
### Building with Address Sanitizer
@@ -293,9 +307,6 @@ RUBY_TEST_TIMEOUT_SCALE=5 SYNTAX_SUGGEST_TIMEOUT=600 make check
Please note, however, the following caveats!
-* ASAN will not work properly on any currently released version of Ruby; the
- necessary support is currently only present on Ruby's master branch (and the
- whole test suite passes only as of commit [Revision 9d0a5148]).
* Due to [Bug #20243], Clang generates code for threadlocal variables which
doesn't work with M:N threading. Thus, it's necessary to disable M:N
threading support at build time for now (with the `-DUSE_MN_THREADS=0`