tarballs on ruby-lang.org. $ curl "https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.2.tar.gz" | \ tar xz --strip-components=1 $ ./configure $ make $ make install On Windows $ ./win32/configure.bat $ nmake 7
ruby is available on the build machine. (baseruby) • ./autogen.sh is required to generate configure $ git clone https://github.com/ruby/ruby.git $ cd ruby $ ./autogen.sh $ ./configure $ make $ make install 8
choose the shell other than /bin/sh. # Record trace info in .trace-make/*.trace during build $ make SHELL="gem exec tracemake shell" # Emit aggregated trace info for chrome://tracing $ gem exec tracemake aggregate -o make-trace.json 11
@akr • A collection of build scripts and patches • Allows building multiple Ruby versions with consistent settings • Applied a few modifications to collect build time data 13
version is 4.4 • Need to support 3.81 because it's still the default on macOS1 • bmake (BSD make) • nmake (Windows) 1 My first commit to CRuby was about fixing old gmake build d1f0d1ca2ea4d7418b096ce71f68ce2bb3afd2c4 19
your system ./miniruby A subset of ruby compiled for the target. Extension libraries are unavailable. $(MINIRUBY) ./miniruby if not cross-compiling. $(BASERUBY) if cross-compiling. $(BOOTSTRAPRUBY) $(BASERUBY) if available, otherwise $ (MINIRUBY) $(XRUBY) Executable(?) ruby without including ./lib 26
ext/configure-ext.mk root Makefile Compile interpreter Configure extensions Compile extensions Compile each extension Link interpreter with extensions Developer make make -f ext/configure-ext.mk make -f ext/exts.mk make -f ext/*/Makefile make ruby EXTOBJS=<.o files> 29
make-time dynamism. • yes-${TARGET} / no-${TARGET} pattern • if directive on Makefile • etc The dynamism comes from the limited expressivity of configure.ac 35
it's used even for tarball builds • This creates subtle variations in the build graph depending on baseruby availability • These variations have caused post-release issues • Example: https://bugs.ruby-lang.org/issues/20687 • Tarball builds should never depend on baseruby • Need to be able to "validate" the build plan 36
--target=autotools -o ./configure $ ./configure $ make 2. Build system as a library graph = Rk2.load_manifest("./manifest.rb") has_baseruby = graph.plan("all").live_nodes.any? do |node| node.is_a?(Rk2::GetEnv) && node.env_key == "BASERUBY" end 46