From ee2c1528b8c4251a880bead5761b6b8611e0a78e Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 19 Mar 2026 11:27:11 +0900 Subject: [PATCH 01/15] Fix `dump_ast` build for cross-compiling --- common.mk | 7 ++++++- template/Makefile.in | 3 ++- tool/dump_ast.mkmf.rb | 31 +++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 tool/dump_ast.mkmf.rb diff --git a/common.mk b/common.mk index be27c434ab63bf..ae2f22528a427a 100644 --- a/common.mk +++ b/common.mk @@ -1322,10 +1322,15 @@ $(BUILTIN_BINARY:no=builtin)_binary.rbbin: $(BUILTIN_RB_INCS): $(tooldir)/mk_builtin_loader.rb $(DUMP_AST_TARGET) -dump_ast$(EXEEXT): $(tooldir)/dump_ast.c $(LIBPRISM_OBJS) +$(CROSS_COMPILING:no=)dump_ast$(EXEEXT): $(tooldir)/dump_ast.c $(LIBPRISM_OBJS) $(ECHO) compiling $@ $(Q) $(CC) $(CFLAGS) $(OUTFLAG)$@ $(INCFLAGS) $(tooldir)/dump_ast.c $(LIBPRISM_OBJS) +build-tool/Makefile: $(tooldir)/dump_ast.mkmf.rb + +$(BASERUBY) -s $(tooldir)/dump_ast.mkmf.rb -make="$(MAKE)" build-tool $(tooldir)/dump_ast.c $(LIBPRISM_OBJS) +$(CROSS_COMPILING:yes=)dump_ast: build-tool/Makefile + cd build-tool && $(MAKE) + $(srcdir)/revision.h$(no_baseruby:no=~disabled~): $(REVISION_H) $(REVISION_H)$(no_baseruby:no=~disabled~): diff --git a/template/Makefile.in b/template/Makefile.in index 3413b56bb9c092..8d6eb50612d3f9 100644 --- a/template/Makefile.in +++ b/template/Makefile.in @@ -38,7 +38,8 @@ MKFILES = @MAKEFILES@ BASERUBY = @BASERUBY@ HAVE_BASERUBY = @HAVE_BASERUBY@ DUMP_AST = @X_DUMP_AST@ -DUMP_AST_TARGET = @X_DUMP_AST_TARGET@ +DUMP_AST_DEP = @X_DUMP_AST_DEP@ +DUMP_AST_TARGET = $(DUMP_AST_DEP:yes=$(DUMP_AST)) TEST_RUNNABLE = @TEST_RUNNABLE@ CROSS_COMPILING = @CROSS_COMPILING@ DOXYGEN = @DOXYGEN@ diff --git a/tool/dump_ast.mkmf.rb b/tool/dump_ast.mkmf.rb new file mode 100644 index 00000000000000..5fd1983eb70ebd --- /dev/null +++ b/tool/dump_ast.mkmf.rb @@ -0,0 +1,31 @@ +require 'mkmf' +require 'pathname' +require 'fileutils' + +workdir, src, *objs = ARGV +src = Pathname(src) +tooldir = src.parent.relative_path_from(workdir) +srcdir = tooldir.parent +target = Pathname('.').relative_path_from(workdir) + src.basename.sub_ext('') +dirs = objs.map {|obj| File.dirname(obj)}.uniq - %w[.] +link = MakeMakefile::TRY_LINK.sub(MakeMakefile::CONFTEST+$EXEEXT, '$(@)') +prismdir= "$(srcdir)/#{dirs.first}" +$VPATH = ["$(srcdir)", "$(srcdir)/#{tooldir.basename}", prismdir, tooldir] +$INCFLAGS << " -I#{prismdir}" +$CPPFLAGS = $CFLAGS = $INCFLAGS + +include FileUtils::Verbose +mkpath(workdir) +Dir.chdir(workdir) { + mkpath(dirs) + File.write('Makefile', [MakeMakefile.configuration(srcdir.to_s), <<~MAKEFILE].join("")) + target = #{target}#{$EXEEXT} + objs = #{File.basename(target, '.*')}.#{$OBJEXT} #{objs.join(' ')} + + $(target): $(objs) + \t#{link} $(objs) + + .c.#{$OBJEXT}: + \t#{MakeMakefile::COMPILE_C} + MAKEFILE +} From 70f5f86118cf490756b245c78321292b82799151 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 19 Mar 2026 17:50:25 +0900 Subject: [PATCH 02/15] Distinguish the executable suffixes Build and target executable suffixes are unrelated in cross-compilation. --- common.mk | 4 ++-- configure.ac | 7 ++++++- template/Makefile.in | 4 ++-- win32/Makefile.sub | 3 ++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/common.mk b/common.mk index ae2f22528a427a..d554e4a63e0d69 100644 --- a/common.mk +++ b/common.mk @@ -1322,13 +1322,13 @@ $(BUILTIN_BINARY:no=builtin)_binary.rbbin: $(BUILTIN_RB_INCS): $(tooldir)/mk_builtin_loader.rb $(DUMP_AST_TARGET) -$(CROSS_COMPILING:no=)dump_ast$(EXEEXT): $(tooldir)/dump_ast.c $(LIBPRISM_OBJS) +$(CROSS_COMPILING:no=)dump_ast$(BUILD_EXEEXT): $(tooldir)/dump_ast.c $(LIBPRISM_OBJS) $(ECHO) compiling $@ $(Q) $(CC) $(CFLAGS) $(OUTFLAG)$@ $(INCFLAGS) $(tooldir)/dump_ast.c $(LIBPRISM_OBJS) build-tool/Makefile: $(tooldir)/dump_ast.mkmf.rb +$(BASERUBY) -s $(tooldir)/dump_ast.mkmf.rb -make="$(MAKE)" build-tool $(tooldir)/dump_ast.c $(LIBPRISM_OBJS) -$(CROSS_COMPILING:yes=)dump_ast: build-tool/Makefile +$(CROSS_COMPILING:yes=)dump_ast$(BUILD_EXEEXT): build-tool/Makefile cd build-tool && $(MAKE) $(srcdir)/revision.h$(no_baseruby:no=~disabled~): $(REVISION_H) diff --git a/configure.ac b/configure.ac index 1d348435faf392..ab486f7c274923 100644 --- a/configure.ac +++ b/configure.ac @@ -110,11 +110,16 @@ AS_IF([test "$HAVE_BASERUBY" = no], [ ]) AC_SUBST(BASERUBY) AC_SUBST(HAVE_BASERUBY) +AS_IF([test "$cross_compiling" = yes], + [X_BUILD_EXEEXT=`$BASERUBY -rrbconfig -e ['puts RbConfig::CONFIG["EXEEXT"]']`], + [X_BUILD_EXEEXT='$(EXEEXT)'] +) +AC_SUBST(X_BUILD_EXEEXT) AC_ARG_WITH(dump-ast, AS_HELP_STRING([--with-dump-ast=DUMP_AST], [use DUMP_AST as dump_ast; for cross-compiling with a host-built dump_ast]), [DUMP_AST=$withval DUMP_AST_TARGET='$(empty)'], - [DUMP_AST='./dump_ast$(EXEEXT)' DUMP_AST_TARGET='$(DUMP_AST)']) + [DUMP_AST='./dump_ast$(BUILD_EXEEXT)' DUMP_AST_TARGET='$(DUMP_AST)']) dnl Without baseruby, .rbinc files cannot be regenerated, so clear the dnl dependency on dump_ast to avoid rebuilding pre-generated .rbinc files. AS_IF([test "$HAVE_BASERUBY" = no], [DUMP_AST_TARGET='$(empty)']) diff --git a/template/Makefile.in b/template/Makefile.in index 8d6eb50612d3f9..7ce612e8e9c704 100644 --- a/template/Makefile.in +++ b/template/Makefile.in @@ -38,8 +38,7 @@ MKFILES = @MAKEFILES@ BASERUBY = @BASERUBY@ HAVE_BASERUBY = @HAVE_BASERUBY@ DUMP_AST = @X_DUMP_AST@ -DUMP_AST_DEP = @X_DUMP_AST_DEP@ -DUMP_AST_TARGET = $(DUMP_AST_DEP:yes=$(DUMP_AST)) +DUMP_AST_TARGET = @X_DUMP_AST_TARGET@ TEST_RUNNABLE = @TEST_RUNNABLE@ CROSS_COMPILING = @CROSS_COMPILING@ DOXYGEN = @DOXYGEN@ @@ -154,6 +153,7 @@ RUBY_API_VERSION=@RUBY_API_VERSION@ RUBY_INSTALL_NAME=@RUBY_INSTALL_NAME@ RUBY_SO_NAME=@RUBY_SO_NAME@ EXEEXT = @EXEEXT@ +BUILD_EXEEXT = @X_BUILD_EXEEXT@ LIBEXT = @LIBEXT@ PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT) RUBY = $(RUBY_INSTALL_NAME) diff --git a/win32/Makefile.sub b/win32/Makefile.sub index e2d170ee47eb6f..e4572710b37113 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -362,6 +362,7 @@ LIBRUBY_LDSHARED = $(LDSHARED) LIBRUBY_DLDFLAGS = $(EXTLDFLAGS) -implib:dummy.lib -def:$(RUBYDEF) EXEEXT = .exe +BUILD_EXEEXT = $(EXEEXT) EXECUTABLE_EXTS = ".exe",".com",".cmd",".bat" !if !defined(PROGRAM) PROGRAM=$(RUBY_INSTALL_NAME)$(EXEEXT) @@ -561,7 +562,7 @@ ABI_VERSION_HDR = $(hdrdir)/ruby/internal/abi.h !if defined(DUMP_AST) DUMP_AST_TARGET = $(empty) !else -DUMP_AST = dump_ast$(EXEEXT) +DUMP_AST = dump_ast$(BUILD_EXEEXT) DUMP_AST_TARGET = $(DUMP_AST) !endif From 353dca47eda806eb58dcaaeff55313dcb0a3cf8c Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 19 Mar 2026 18:35:45 +0900 Subject: [PATCH 03/15] Clean the build tool --- common.mk | 6 ++++++ tool/dump_ast.mkmf.rb | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/common.mk b/common.mk index d554e4a63e0d69..d6b20256ee7a58 100644 --- a/common.mk +++ b/common.mk @@ -685,6 +685,7 @@ clean-local:: clean-runnable $(Q)$(RM) probes.h probes.$(OBJEXT) probes.stamp ruby-glommed.$(OBJEXT) ruby.imp ChangeLog $(STATIC_RUBY)$(EXEEXT) $(Q)$(RM) GNUmakefile.old Makefile.old $(arch)-fake.rb bisect.sh $(ENC_TRANS_D) builtin_binary.rbbin $(Q)$(RM) $(PRISM_BUILD_DIR)/.time $(PRISM_BUILD_DIR)/*/.time yjit_exit_locations.dump + -$(Q)$(RMALL) dump_ast$(BUILD_EXEEXT)* -$(Q)$(RMALL) target -$(Q) $(RMDIR) enc/jis enc/trans enc $(COROUTINE_H:/Context.h=) coroutine target \ $(PRISM_BUILD_DIR)/*/ $(PRISM_BUILD_DIR) tmp \ @@ -1331,6 +1332,11 @@ build-tool/Makefile: $(tooldir)/dump_ast.mkmf.rb $(CROSS_COMPILING:yes=)dump_ast$(BUILD_EXEEXT): build-tool/Makefile cd build-tool && $(MAKE) +clean-local:: clean-build-tool +clean-build-tool: + - cd build-tool && $(MAKE) clean 2> $(NULL) || $(NULLCMD) + - $(RMDIR) build-tool + $(srcdir)/revision.h$(no_baseruby:no=~disabled~): $(REVISION_H) $(REVISION_H)$(no_baseruby:no=~disabled~): diff --git a/tool/dump_ast.mkmf.rb b/tool/dump_ast.mkmf.rb index 5fd1983eb70ebd..c4e8ebca2f1d40 100644 --- a/tool/dump_ast.mkmf.rb +++ b/tool/dump_ast.mkmf.rb @@ -27,5 +27,9 @@ .c.#{$OBJEXT}: \t#{MakeMakefile::COMPILE_C} + + clean: + \t$(RM) $(target) $(objs) Makefile + \t$(RMDIRS) #{dirs.join(' ')} MAKEFILE } From 09a314d73647b433eb88e560ff90ea4c9a7e0eac Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 19 Mar 2026 19:45:35 +0900 Subject: [PATCH 04/15] Update prereq.status --- tool/prereq.status | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tool/prereq.status b/tool/prereq.status index 78b5c2228bf5a9..44c0718a2d870c 100644 --- a/tool/prereq.status +++ b/tool/prereq.status @@ -9,12 +9,12 @@ s,@CC@,false,g s,@CFLAGS@,,g s,@CHDIR@,cd,g s,@CONFIGURE@,configure,g +s,@COUTFLAG@,-o ,g s,@CP@,cp,g s,@CPPFLAGS@,,g s,@CXXFLAGS@,,g s,@DLDFLAGS@,,g s,@DTRACE_EXT@,dmyh,g -s,@DUMP_AST@,./dump_ast,g s,@EXEEXT@,,g s,@HAVE_BASERUBY@,yes,g s,@IFCHANGE@,tool/ifchange,g @@ -25,6 +25,7 @@ s,@LIBRUBY_A@,libruby.a,g s,@MINIRUBY@,$(BASERUBY),g s,@MKDIR_P@,mkdir -p,g s,@OBJEXT@,o,g +s,@OUTFLAG@,-o ,g s,@PATH_SEPARATOR@,:,g s,@PWD@,.,g s,@RM@,rm -f,g @@ -33,6 +34,9 @@ s,@RMDIR@,rmdir,g s,@RMDIRS@,$(RMDIR) -p,g s,@RUBY@,$(BASERUBY),g s,@RUNRUBY@,$(MINIRUBY),g +s,@X_BUILD_EXEEXT@,,g +s,@X_DUMP_AST@,build-tool/dump_ast$(BUILD_EXEEXT),g +s,@X_DUMP_AST_TARGET@,$(DUMP_AST),g s,@arch@,noarch,g s,@bindir@,,g s,@configure_args@,,g @@ -41,6 +45,9 @@ s,@rubyarchdir@,,g s,@rubylibprefix@,,g s,@srcdir@,.,g +# for comipling dump_ast on build-os +/^CC *=/d + s/@[A-Za-z][A-Za-z0-9_]*@//g s/{\$([^(){}]*)}//g s/^!/#!/ From 58f324d308250c09646ae2bde4b49b8069f9185e Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 19 Mar 2026 20:34:52 +0900 Subject: [PATCH 05/15] Update prism sources before dump_ast --- common.mk | 4 ++-- prism/srcs.mk | 41 ++++++++++++++++++++++------------------- prism/srcs.mk.in | 5 ++++- tool/dump_ast.mkmf.rb | 2 +- 4 files changed, 29 insertions(+), 23 deletions(-) diff --git a/common.mk b/common.mk index d6b20256ee7a58..6aaafb63f5867e 100644 --- a/common.mk +++ b/common.mk @@ -1327,8 +1327,8 @@ $(CROSS_COMPILING:no=)dump_ast$(BUILD_EXEEXT): $(tooldir)/dump_ast.c $(LIBPRISM_ $(ECHO) compiling $@ $(Q) $(CC) $(CFLAGS) $(OUTFLAG)$@ $(INCFLAGS) $(tooldir)/dump_ast.c $(LIBPRISM_OBJS) -build-tool/Makefile: $(tooldir)/dump_ast.mkmf.rb - +$(BASERUBY) -s $(tooldir)/dump_ast.mkmf.rb -make="$(MAKE)" build-tool $(tooldir)/dump_ast.c $(LIBPRISM_OBJS) +build-tool/Makefile: $(tooldir)/dump_ast.mkmf.rb prism-srcs prism-incs + +$(BASERUBY) -s $(tooldir)/dump_ast.mkmf.rb -make="$(MAKE)" build-tool $(tooldir)/dump_ast.c dump_ast.$(OBJEXT) $(LIBPRISM_OBJS) $(CROSS_COMPILING:yes=)dump_ast$(BUILD_EXEEXT): build-tool/Makefile cd build-tool && $(MAKE) diff --git a/prism/srcs.mk b/prism/srcs.mk index 9d158ea8ec1ff4..93ad8f579ff180 100644 --- a/prism/srcs.mk +++ b/prism/srcs.mk @@ -23,133 +23,136 @@ realclean-prism-srcs:: distclean-prism-srcs realclean-srcs-local:: realclean-prism-srcs -main srcs: $(srcdir)/prism/api_node.c +main srcs: prism-srcs +main incs: prism-incs + +prism-srcs: $(srcdir)/prism/api_node.c $(srcdir)/prism/api_node.c: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/ext/prism/api_node.c.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) ext/prism/api_node.c $@ realclean-prism-srcs:: $(RM) $(srcdir)/prism/api_node.c -main incs: $(srcdir)/prism/ast.h +prism-incs: $(srcdir)/prism/ast.h $(srcdir)/prism/ast.h: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/include/prism/ast.h.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) include/prism/ast.h $@ realclean-prism-srcs:: $(RM) $(srcdir)/prism/ast.h -main incs: $(srcdir)/prism/internal/diagnostic.h +prism-incs: $(srcdir)/prism/internal/diagnostic.h $(srcdir)/prism/internal/diagnostic.h: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/include/prism/internal/diagnostic.h.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) include/prism/internal/diagnostic.h $@ realclean-prism-srcs:: $(RM) $(srcdir)/prism/internal/diagnostic.h -main srcs: $(srcdir)/lib/prism/compiler.rb +prism-srcs: $(srcdir)/lib/prism/compiler.rb $(srcdir)/lib/prism/compiler.rb: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/lib/prism/compiler.rb.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) lib/prism/compiler.rb $@ realclean-prism-srcs:: $(RM) $(srcdir)/lib/prism/compiler.rb -main srcs: $(srcdir)/lib/prism/dispatcher.rb +prism-srcs: $(srcdir)/lib/prism/dispatcher.rb $(srcdir)/lib/prism/dispatcher.rb: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/lib/prism/dispatcher.rb.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) lib/prism/dispatcher.rb $@ realclean-prism-srcs:: $(RM) $(srcdir)/lib/prism/dispatcher.rb -main srcs: $(srcdir)/lib/prism/dot_visitor.rb +prism-srcs: $(srcdir)/lib/prism/dot_visitor.rb $(srcdir)/lib/prism/dot_visitor.rb: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/lib/prism/dot_visitor.rb.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) lib/prism/dot_visitor.rb $@ realclean-prism-srcs:: $(RM) $(srcdir)/lib/prism/dot_visitor.rb -main srcs: $(srcdir)/lib/prism/dsl.rb +prism-srcs: $(srcdir)/lib/prism/dsl.rb $(srcdir)/lib/prism/dsl.rb: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/lib/prism/dsl.rb.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) lib/prism/dsl.rb $@ realclean-prism-srcs:: $(RM) $(srcdir)/lib/prism/dsl.rb -main srcs: $(srcdir)/lib/prism/inspect_visitor.rb +prism-srcs: $(srcdir)/lib/prism/inspect_visitor.rb $(srcdir)/lib/prism/inspect_visitor.rb: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/lib/prism/inspect_visitor.rb.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) lib/prism/inspect_visitor.rb $@ realclean-prism-srcs:: $(RM) $(srcdir)/lib/prism/inspect_visitor.rb -main srcs: $(srcdir)/lib/prism/mutation_compiler.rb +prism-srcs: $(srcdir)/lib/prism/mutation_compiler.rb $(srcdir)/lib/prism/mutation_compiler.rb: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/lib/prism/mutation_compiler.rb.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) lib/prism/mutation_compiler.rb $@ realclean-prism-srcs:: $(RM) $(srcdir)/lib/prism/mutation_compiler.rb -main srcs: $(srcdir)/lib/prism/node.rb +prism-srcs: $(srcdir)/lib/prism/node.rb $(srcdir)/lib/prism/node.rb: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/lib/prism/node.rb.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) lib/prism/node.rb $@ realclean-prism-srcs:: $(RM) $(srcdir)/lib/prism/node.rb -main srcs: $(srcdir)/lib/prism/reflection.rb +prism-srcs: $(srcdir)/lib/prism/reflection.rb $(srcdir)/lib/prism/reflection.rb: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/lib/prism/reflection.rb.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) lib/prism/reflection.rb $@ realclean-prism-srcs:: $(RM) $(srcdir)/lib/prism/reflection.rb -main srcs: $(srcdir)/lib/prism/serialize.rb +prism-srcs: $(srcdir)/lib/prism/serialize.rb $(srcdir)/lib/prism/serialize.rb: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/lib/prism/serialize.rb.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) lib/prism/serialize.rb $@ realclean-prism-srcs:: $(RM) $(srcdir)/lib/prism/serialize.rb -main srcs: $(srcdir)/lib/prism/visitor.rb +prism-srcs: $(srcdir)/lib/prism/visitor.rb $(srcdir)/lib/prism/visitor.rb: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/lib/prism/visitor.rb.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) lib/prism/visitor.rb $@ realclean-prism-srcs:: $(RM) $(srcdir)/lib/prism/visitor.rb -main srcs: $(srcdir)/prism/diagnostic.c +prism-srcs: $(srcdir)/prism/diagnostic.c $(srcdir)/prism/diagnostic.c: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/src/diagnostic.c.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) src/diagnostic.c $@ realclean-prism-srcs:: $(RM) $(srcdir)/prism/diagnostic.c -main srcs: $(srcdir)/prism/json.c +prism-srcs: $(srcdir)/prism/json.c $(srcdir)/prism/json.c: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/src/json.c.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) src/json.c $@ realclean-prism-srcs:: $(RM) $(srcdir)/prism/json.c -main srcs: $(srcdir)/prism/node.c +prism-srcs: $(srcdir)/prism/node.c $(srcdir)/prism/node.c: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/src/node.c.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) src/node.c $@ realclean-prism-srcs:: $(RM) $(srcdir)/prism/node.c -main srcs: $(srcdir)/prism/prettyprint.c +prism-srcs: $(srcdir)/prism/prettyprint.c $(srcdir)/prism/prettyprint.c: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/src/prettyprint.c.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) src/prettyprint.c $@ realclean-prism-srcs:: $(RM) $(srcdir)/prism/prettyprint.c -main srcs: $(srcdir)/prism/serialize.c +prism-srcs: $(srcdir)/prism/serialize.c $(srcdir)/prism/serialize.c: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/src/serialize.c.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) src/serialize.c $@ realclean-prism-srcs:: $(RM) $(srcdir)/prism/serialize.c -main srcs: $(srcdir)/prism/tokens.c +prism-srcs: $(srcdir)/prism/tokens.c $(srcdir)/prism/tokens.c: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/src/tokens.c.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) src/tokens.c $@ diff --git a/prism/srcs.mk.in b/prism/srcs.mk.in index d9dcd9b802b7e7..6149e4ae9d1be0 100644 --- a/prism/srcs.mk.in +++ b/prism/srcs.mk.in @@ -31,6 +31,9 @@ realclean-prism-srcs:: distclean-prism-srcs $(RM) $(PRISM_SRCDIR)/<%=%><%=srcs%> realclean-srcs-local:: realclean-prism-srcs + +main srcs: prism-srcs +main incs: prism-incs <% Prism::Template::TEMPLATES.map do |t| /\.(?:[ch]|rb)\z/ =~ t or next s = '$(srcdir)/' + t.sub(%r[\A(?:(src)|ext|include)/]) {$1 && 'prism/'} @@ -38,7 +41,7 @@ realclean-srcs-local:: realclean-prism-srcs target = s.end_with?('.h') ? 'incs' : 'srcs' # %> -main <%=%><%=target%>: <%=%><%=s%> +prism-<%=%><%=target%>: <%=%><%=s%> <%=%><%=s%>: $(PRISM_CONFIG) $(PRISM_TEMPLATE) $(PRISM_TEMPLATES_DIR)/<%=%><%=t%>.erb $(Q) $(BASERUBY) $(PRISM_TEMPLATE) <%=%><%=t%> $@ diff --git a/tool/dump_ast.mkmf.rb b/tool/dump_ast.mkmf.rb index c4e8ebca2f1d40..fbddc38fd4fc3d 100644 --- a/tool/dump_ast.mkmf.rb +++ b/tool/dump_ast.mkmf.rb @@ -20,7 +20,7 @@ mkpath(dirs) File.write('Makefile', [MakeMakefile.configuration(srcdir.to_s), <<~MAKEFILE].join("")) target = #{target}#{$EXEEXT} - objs = #{File.basename(target, '.*')}.#{$OBJEXT} #{objs.join(' ')} + objs = #{objs.join(' ')} $(target): $(objs) \t#{link} $(objs) From 2cefc23a308b4c048dd9e1eb291ae0a2cb7f780f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 19 Mar 2026 20:50:35 +0900 Subject: [PATCH 06/15] Update rbinc files for snapshots --- common.mk | 9 +++++---- configure.ac | 7 ++++++- tool/dump_ast.mkmf.rb | 4 +++- tool/make-snapshot | 2 ++ 4 files changed, 16 insertions(+), 6 deletions(-) mode change 100644 => 100755 tool/dump_ast.mkmf.rb diff --git a/common.mk b/common.mk index 6aaafb63f5867e..e2d283e44015ff 100644 --- a/common.mk +++ b/common.mk @@ -1323,14 +1323,15 @@ $(BUILTIN_BINARY:no=builtin)_binary.rbbin: $(BUILTIN_RB_INCS): $(tooldir)/mk_builtin_loader.rb $(DUMP_AST_TARGET) -$(CROSS_COMPILING:no=)dump_ast$(BUILD_EXEEXT): $(tooldir)/dump_ast.c $(LIBPRISM_OBJS) +dump_ast$(BUILD_EXEEXT): $(tooldir)/dump_ast.c $(LIBPRISM_OBJS) $(ECHO) compiling $@ $(Q) $(CC) $(CFLAGS) $(OUTFLAG)$@ $(INCFLAGS) $(tooldir)/dump_ast.c $(LIBPRISM_OBJS) build-tool/Makefile: $(tooldir)/dump_ast.mkmf.rb prism-srcs prism-incs - +$(BASERUBY) -s $(tooldir)/dump_ast.mkmf.rb -make="$(MAKE)" build-tool $(tooldir)/dump_ast.c dump_ast.$(OBJEXT) $(LIBPRISM_OBJS) -$(CROSS_COMPILING:yes=)dump_ast$(BUILD_EXEEXT): build-tool/Makefile - cd build-tool && $(MAKE) + +$(BASERUBY) -s $(tooldir)/dump_ast.mkmf.rb "-INCFLAGS=$(INCFLAGS)" "-make=$(MAKE)" build-tool $(tooldir)/dump_ast.c dump_ast.$(OBJEXT) $(LIBPRISM_OBJS) + +build-tool/dump_ast$(BUILD_EXEEXT): build-tool/Makefile + cd build-tool && MAKEFLAGS= MFLAGS= && unset MAKEFLAGS MFLAGS && $(MAKE) clean-local:: clean-build-tool clean-build-tool: diff --git a/configure.ac b/configure.ac index ab486f7c274923..83d76c1784346c 100644 --- a/configure.ac +++ b/configure.ac @@ -119,7 +119,12 @@ AC_SUBST(X_BUILD_EXEEXT) AC_ARG_WITH(dump-ast, AS_HELP_STRING([--with-dump-ast=DUMP_AST], [use DUMP_AST as dump_ast; for cross-compiling with a host-built dump_ast]), [DUMP_AST=$withval DUMP_AST_TARGET='$(empty)'], - [DUMP_AST='./dump_ast$(BUILD_EXEEXT)' DUMP_AST_TARGET='$(DUMP_AST)']) + [AS_IF([test "$cross_compiling" = yes], [ + DUMP_AST='build-tool/dump_ast$(BUILD_EXEEXT)' + ], [ + DUMP_AST='./dump_ast$(BUILD_EXEEXT)' + ]) + DUMP_AST_TARGET='$(DUMP_AST)']) dnl Without baseruby, .rbinc files cannot be regenerated, so clear the dnl dependency on dump_ast to avoid rebuilding pre-generated .rbinc files. AS_IF([test "$HAVE_BASERUBY" = no], [DUMP_AST_TARGET='$(empty)']) diff --git a/tool/dump_ast.mkmf.rb b/tool/dump_ast.mkmf.rb old mode 100644 new mode 100755 index fbddc38fd4fc3d..eec6b72f79b520 --- a/tool/dump_ast.mkmf.rb +++ b/tool/dump_ast.mkmf.rb @@ -1,3 +1,4 @@ +#!ruby -s require 'mkmf' require 'pathname' require 'fileutils' @@ -6,7 +7,7 @@ src = Pathname(src) tooldir = src.parent.relative_path_from(workdir) srcdir = tooldir.parent -target = Pathname('.').relative_path_from(workdir) + src.basename.sub_ext('') +target = src.basename.sub_ext('') dirs = objs.map {|obj| File.dirname(obj)}.uniq - %w[.] link = MakeMakefile::TRY_LINK.sub(MakeMakefile::CONFTEST+$EXEEXT, '$(@)') prismdir= "$(srcdir)/#{dirs.first}" @@ -25,6 +26,7 @@ $(target): $(objs) \t#{link} $(objs) + objs: $(objs) .c.#{$OBJEXT}: \t#{MakeMakefile::COMPILE_C} diff --git a/tool/make-snapshot b/tool/make-snapshot index 1b080d41683ac3..3b3efad7e57383 100755 --- a/tool/make-snapshot +++ b/tool/make-snapshot @@ -467,6 +467,7 @@ def package(vcs, rev, destdir, tmp = nil) "VPATH"=>(ENV["VPATH"] || "include/ruby"), "PROGRAM"=>(ENV["PROGRAM"] || "ruby"), "BUILTIN_TRANSOBJS"=>(ENV["BUILTIN_TRANSOBJS"] || "newline.o"), + "DUMP_AST"=>"build-tool/dump_ast#{RbConfig::CONFIG['EXEEXT']} ", } status.scan(/^s([%,])@([A-Za-z_][A-Za-z_0-9]*)@\1(.*?)\1g$/) do vars[$2] ||= $3 @@ -540,6 +541,7 @@ touch-unicode-files: File.utime(modified, modified, *Dir.glob(["tool/config.{guess,sub}", "gems/*.gem", "tool"])) return unless make.run("prepare-package") return unless make.run("clean-cache") + return unless make.run("clean") if modified new_time = modified + 2 touch_all(new_time, "**/*", File::FNM_DOTMATCH) do |name, stat| From 4e3625fba815455e0b6f1526beea1cab9f06b1cd Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 27 Mar 2026 18:30:16 +0900 Subject: [PATCH 07/15] Add rule for dummy config.h --- common.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common.mk b/common.mk index e2d283e44015ff..59ba74eebbb77c 100644 --- a/common.mk +++ b/common.mk @@ -677,6 +677,8 @@ install-prereq: $(CLEAR_INSTALLED_LIST) yes-fake sudo-precheck PHONY clear-installed-list: PHONY @> $(INSTALLED_LIST) set MAKE="$(MAKE)" +noarch_config_h = tmp/include/noarch/ruby/config.h + clean: clean-ext clean-enc clean-golf clean-docs clean-extout clean-modular-gc clean-local clean-platform clean-spec clean-local:: clean-runnable $(Q)$(RM) $(ALLOBJS) $(LIBRUBY_A) $(LIBRUBY_SO) $(LIBRUBY) $(LIBRUBY_ALIASES) @@ -685,6 +687,7 @@ clean-local:: clean-runnable $(Q)$(RM) probes.h probes.$(OBJEXT) probes.stamp ruby-glommed.$(OBJEXT) ruby.imp ChangeLog $(STATIC_RUBY)$(EXEEXT) $(Q)$(RM) GNUmakefile.old Makefile.old $(arch)-fake.rb bisect.sh $(ENC_TRANS_D) builtin_binary.rbbin $(Q)$(RM) $(PRISM_BUILD_DIR)/.time $(PRISM_BUILD_DIR)/*/.time yjit_exit_locations.dump + $(Q)$(RM) $(noarch_config_h) -$(Q)$(RMALL) dump_ast$(BUILD_EXEEXT)* -$(Q)$(RMALL) target -$(Q) $(RMDIR) enc/jis enc/trans enc $(COROUTINE_H:/Context.h=) coroutine target \ @@ -858,6 +861,12 @@ $(arch:noarch=ignore)-fake.rb: $(srcdir)/template/fake.rb.in $(tooldir)/generic_ i=- srcdir="$(srcdir)" BASERUBY="$(BASERUBY)" \ LIBPATHENV="$(LIBPATHENV)" PRELOADENV="$(PRELOADENV)" LIBRUBY_SO="$(LIBRUBY_SO)" +# dummy file for generating sources; $(arch_hdrdir)/ruby/config.h with prereq.status. +$(noarch_config_h): + $(ECHO) generating dummy config.h + $(Q) $(MAKEDIRS) $(@D) + $(Q) $(TOUCH) $@ + noarch-fake.rb: # prerequisite of yes-fake $(Q) exit > $@ From 01e4a82706a1f07eff874f9043138b75a8575b7c Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 27 Mar 2026 22:50:02 +0900 Subject: [PATCH 08/15] Fall back writing prism sources to the current directory --- prism/templates/template.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/prism/templates/template.rb b/prism/templates/template.rb index 34c1afb0c66d3f..2e7d3b107f1a39 100755 --- a/prism/templates/template.rb +++ b/prism/templates/template.rb @@ -643,8 +643,14 @@ def render(name, write_to: nil) end end - FileUtils.mkdir_p(File.dirname(write_to)) - File.write(write_to, contents) + begin + FileUtils.mkdir_p(File.dirname(write_to)) + File.write(write_to, contents) + rescue SystemCallError # EACCES, EPERM, EROFS, etc. + # Fall back to the current directory + FileUtils.mkdir_p(File.dirname(name)) + File.write(name, contents) + end end private From 2329ca1d424cbc85749e69b829d66902a25e3474 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 28 Mar 2026 23:27:52 +0900 Subject: [PATCH 09/15] Revert generating sources in make-snapshot --- tool/make-snapshot | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/tool/make-snapshot b/tool/make-snapshot index 3b3efad7e57383..912cb9ce9242b3 100755 --- a/tool/make-snapshot +++ b/tool/make-snapshot @@ -501,36 +501,6 @@ touch-unicode-files: ENV["CACHE_SAVE"] = "no" make = MAKE.new(args) return unless make.run("update-download") - # Build dump_ast for mk_builtin_loader.rb. CC=false in prereq.status - # prevents make from compiling it, so we build it directly here. - # Generate prism sources/headers from templates first, then compile. - dump_ast = vars["DUMP_AST"] - if dump_ast && !dump_ast.empty? && !File.exist?(dump_ast) && File.exist?("tool/dump_ast.c") - prism_template = "prism/templates/template.rb" - if File.exist?(prism_template) - baseruby_cmd = baseruby.shellsplit - Dir.glob("prism/templates/src/*.c.erb") do |erb| - name = File.basename(erb, ".erb") - out = "prism/#{name}" - system(*baseruby_cmd, prism_template, "src/#{name}", out) unless File.exist?(out) - end - %w[include/prism/ast.h include/prism/internal/diagnostic.h].each do |hdr| - out = "prism/#{hdr.delete_prefix("include/prism/")}" - FileUtils.mkpath(File.dirname(out)) - system(*baseruby_cmd, prism_template, hdr, out) unless File.exist?(out) - end - end - prism_srcs = Dir.glob("prism/*.c").reject {|f| %w[api_node extension].include?(File.basename(f, ".c"))} - unless prism_srcs.empty? - print "building dump_ast..." - if system("cc", "-o", dump_ast, "-Iprism", "-I.", "tool/dump_ast.c", *prism_srcs) - clean.add(dump_ast) - puts $colorize.pass(" done") - else - puts $colorize.fail(" failed") - end - end - end clean.push("rbconfig.rb", ".rbconfig.time", "enc.mk", "ext/ripper/y.output", ".revision.time") Dir.glob("**/*") do |dest| next unless File.symlink?(dest) From 371255ffdb4f074fc2c6f37a6362c59a19e2692c Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 26 Mar 2026 09:40:33 +0900 Subject: [PATCH 10/15] Add cross-compile workflow for out-of-source ARM build testing Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/crosscompile.yml | 116 +++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 .github/workflows/crosscompile.yml diff --git a/.github/workflows/crosscompile.yml b/.github/workflows/crosscompile.yml new file mode 100644 index 00000000000000..81e0e514f853f0 --- /dev/null +++ b/.github/workflows/crosscompile.yml @@ -0,0 +1,116 @@ +name: Cross compile +on: + push: + paths-ignore: + - 'doc/**' + - '**/man/*' + - '**.md' + - '**.rdoc' + - '**/.document' + - '.*.yml' + pull_request: + # Do not use paths-ignore for required status checks + # https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks + merge_group: + +concurrency: + group: ${{ github.workflow }} / ${{ startsWith(github.event_name, 'pull') && github.ref_name || github.sha }} + cancel-in-progress: ${{ startsWith(github.event_name, 'pull') }} + +permissions: + contents: read + +jobs: + make: + strategy: + matrix: + include: + - host: aarch64-linux-gnu + arch: arm64 + fail-fast: false + + env: + GITPULLOPTIONS: --no-tags origin ${{ github.ref }} + + runs-on: ubuntu-24.04 + + if: >- + ${{!(false + || contains(github.event.head_commit.message, '[DOC]') + || contains(github.event.pull_request.title, '[DOC]') + || contains(github.event.pull_request.labels.*.name, 'Documentation') + || (github.event.pull_request.user.login == 'dependabot[bot]') + )}} + + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + sparse-checkout-cone-mode: false + sparse-checkout: /.github + persist-credentials: false + + - uses: ./.github/actions/setup/directories + with: + srcdir: src + builddir: build + makeup: true + + - name: Install cross-compilation toolchain + run: | + sudo dpkg --add-architecture ${{ matrix.arch }} + # Restrict existing sources to amd64to avoid 404 on arm64 + sudo sed -i '/^Architectures:/d' /etc/apt/sources.list.d/ubuntu.sources + sudo sed -i '/^Types:/a Architectures: amd64 i386' /etc/apt/sources.list.d/ubuntu.sources + # Add arm64 sources from ports.ubuntu.com + printf '%s\n' \ + "Types: deb" \ + "URIs: http://ports.ubuntu.com/" \ + "Suites: noble noble-updates noble-security" \ + "Components: main universe" \ + "Architectures: ${{ matrix.arch }}" \ + | sudo tee /etc/apt/sources.list.d/ports-${{ matrix.arch }}.sources + sudo apt-get update -qq + sudo apt-get install --no-install-recommends -qq -y \ + crossbuild-essential-${{ matrix.arch }} \ + libssl-dev:${{ matrix.arch }} \ + libyaml-dev:${{ matrix.arch }} \ + zlib1g-dev:${{ matrix.arch }} \ + libffi-dev:${{ matrix.arch }} \ + libreadline-dev:${{ matrix.arch }} \ + libncurses-dev:${{ matrix.arch }} \ + autoconf ruby + + - name: Build baseruby + run: | + mkdir ../baseruby + cd ../baseruby + ../src/configure --prefix=$PWD/install --disable-install-doc + make + make install + + - name: Run configure + run: >- + ../src/configure -C --disable-install-doc + --prefix=/usr + --build=x86_64-linux-gnu + --host=${{ matrix.host }} + --with-baseruby=$PWD/../baseruby/install/bin/ruby + + - run: make + + - run: make install DESTDIR=$PWD/install + + - name: Verify cross-compiled binary + run: | + file install/usr/bin/ruby + file install/usr/bin/ruby | grep -q '${{ matrix.host }}\|aarch64' + + - uses: ./.github/actions/slack + with: + label: cross ${{ matrix.host }} + SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot + if: ${{ failure() }} + +defaults: + run: + working-directory: build From a0c6e64a684021b8ba47ed5a98674f68c26c0a3c Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Thu, 26 Mar 2026 09:41:01 +0900 Subject: [PATCH 11/15] Add arm-to-x86 cross-compile matrix and generalize apt setup Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/workflows/crosscompile.yml | 31 ++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/crosscompile.yml b/.github/workflows/crosscompile.yml index 81e0e514f853f0..2b75a75df4078e 100644 --- a/.github/workflows/crosscompile.yml +++ b/.github/workflows/crosscompile.yml @@ -22,17 +22,26 @@ permissions: jobs: make: + name: make (${{ matrix.host }} host on ${{ matrix.build }}) strategy: matrix: include: - host: aarch64-linux-gnu arch: arm64 + build: x86_64-linux-gnu + runs-on: ubuntu-24.04 + file_arch: ARM aarch64 + - host: x86_64-linux-gnu + arch: amd64 + build: aarch64-linux-gnu + runs-on: ubuntu-24.04-arm + file_arch: x86-64 fail-fast: false env: GITPULLOPTIONS: --no-tags origin ${{ github.ref }} - runs-on: ubuntu-24.04 + runs-on: ${{ matrix.runs-on }} if: >- ${{!(false @@ -58,17 +67,23 @@ jobs: - name: Install cross-compilation toolchain run: | sudo dpkg --add-architecture ${{ matrix.arch }} - # Restrict existing sources to amd64to avoid 404 on arm64 + native_arch=$(dpkg --print-architecture) + # Restrict existing sources to native arch sudo sed -i '/^Architectures:/d' /etc/apt/sources.list.d/ubuntu.sources - sudo sed -i '/^Types:/a Architectures: amd64 i386' /etc/apt/sources.list.d/ubuntu.sources - # Add arm64 sources from ports.ubuntu.com + sudo sed -i "/^Types:/a Architectures: ${native_arch}" /etc/apt/sources.list.d/ubuntu.sources + # Add cross-arch sources + if [ "${{ matrix.arch }}" = "arm64" ]; then + cross_uri="http://ports.ubuntu.com/" + else + cross_uri="http://archive.ubuntu.com/ubuntu/" + fi printf '%s\n' \ "Types: deb" \ - "URIs: http://ports.ubuntu.com/" \ + "URIs: ${cross_uri}" \ "Suites: noble noble-updates noble-security" \ "Components: main universe" \ "Architectures: ${{ matrix.arch }}" \ - | sudo tee /etc/apt/sources.list.d/ports-${{ matrix.arch }}.sources + | sudo tee /etc/apt/sources.list.d/cross-${{ matrix.arch }}.sources sudo apt-get update -qq sudo apt-get install --no-install-recommends -qq -y \ crossbuild-essential-${{ matrix.arch }} \ @@ -92,7 +107,7 @@ jobs: run: >- ../src/configure -C --disable-install-doc --prefix=/usr - --build=x86_64-linux-gnu + --build=${{ matrix.build }} --host=${{ matrix.host }} --with-baseruby=$PWD/../baseruby/install/bin/ruby @@ -103,7 +118,7 @@ jobs: - name: Verify cross-compiled binary run: | file install/usr/bin/ruby - file install/usr/bin/ruby | grep -q '${{ matrix.host }}\|aarch64' + file install/usr/bin/ruby | grep -q '${{ matrix.file_arch }}' - uses: ./.github/actions/slack with: From 5f08b4c6352089042b82a39401870e6be108ba9b Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 30 Mar 2026 10:31:04 +0900 Subject: [PATCH 12/15] Remove stephanmisc/docuum dependency to avoid DockerHub rate limits Replace the docuum service container with a simple `docker rmi` step after each compilation. This avoids pulling an external image from DockerHub, which was causing rate limit issues. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/actions/compilers/action.yml | 7 +++++++ .github/workflows/compilers.yml | 24 ++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/actions/compilers/action.yml b/.github/actions/compilers/action.yml index d20d2a16090b6a..bffb3bebc73266 100644 --- a/.github/actions/compilers/action.yml +++ b/.github/actions/compilers/action.yml @@ -152,3 +152,10 @@ runs: GITHUB_PR_HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }} GITHUB_PULL_REQUEST_URL: ${{ github.event.pull_request.html_url }} GITHUB_REF: ${{ github.ref }} + + - name: clean up docker image + shell: bash + run: docker rmi "ghcr.io/ruby/ruby-ci-image:${INPUT_TAG}" || true + if: always() + env: + INPUT_TAG: ${{ inputs.tag }} diff --git a/.github/workflows/compilers.yml b/.github/workflows/compilers.yml index 0c3fce5bccb173..596e214eea3c11 100644 --- a/.github/workflows/compilers.yml +++ b/.github/workflows/compilers.yml @@ -49,7 +49,7 @@ jobs: needs: compile-if if: ${{ needs.compile-if.result == 'success' }} timeout-minutes: 60 - services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github, persist-credentials: false } @@ -72,7 +72,7 @@ jobs: needs: compile-if if: ${{ needs.compile-if.result == 'success' }} timeout-minutes: 60 - services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github, persist-credentials: false } @@ -102,7 +102,7 @@ jobs: needs: compile-if if: ${{ needs.compile-if.result == 'success' }} timeout-minutes: 60 - services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github, persist-credentials: false } @@ -124,7 +124,7 @@ jobs: needs: compile-if if: ${{ needs.compile-if.result == 'success' }} timeout-minutes: 60 - services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github, persist-credentials: false } @@ -145,7 +145,7 @@ jobs: needs: compile-if if: ${{ needs.compile-if.result == 'success' }} timeout-minutes: 60 - services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github, persist-credentials: false } @@ -171,7 +171,7 @@ jobs: needs: compile-if if: ${{ needs.compile-if.result == 'success' }} timeout-minutes: 60 - services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github, persist-credentials: false } @@ -191,7 +191,7 @@ jobs: needs: compile-if if: ${{ needs.compile-if.result == 'success' }} timeout-minutes: 60 - services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github, persist-credentials: false } @@ -213,7 +213,7 @@ jobs: needs: compile-if if: ${{ needs.compile-if.result == 'success' }} timeout-minutes: 60 - services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github, persist-credentials: false } @@ -232,7 +232,7 @@ jobs: needs: compile-if if: ${{ needs.compile-if.result == 'success' }} timeout-minutes: 60 - services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github, persist-credentials: false } @@ -252,7 +252,7 @@ jobs: needs: compile-if if: ${{ needs.compile-if.result == 'success' }} timeout-minutes: 60 - services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github, persist-credentials: false } @@ -270,7 +270,7 @@ jobs: needs: compile-if if: ${{ needs.compile-if.result == 'success' }} timeout-minutes: 60 - services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github, persist-credentials: false } @@ -289,7 +289,7 @@ jobs: needs: compile-if if: ${{ needs.compile-if.result == 'success' }} timeout-minutes: 60 - services: { docuum: { image: 'stephanmisc/docuum', options: '--init', volumes: [ '/root', '/var/run/docker.sock:/var/run/docker.sock' ] } } + steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: { sparse-checkout-cone-mode: false, sparse-checkout: /.github, persist-credentials: false } From c99e07fe4eaa640c6a3e57fe66352ba9d66d1863 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Mon, 30 Mar 2026 10:59:17 +0900 Subject: [PATCH 13/15] Skip cleaning up the default docker image to avoid redundant pulls The default image (clang-20) is reused across multiple steps within the same job. Only remove non-default images after use. Co-Authored-By: Claude Opus 4.6 (1M context) --- .github/actions/compilers/action.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/actions/compilers/action.yml b/.github/actions/compilers/action.yml index bffb3bebc73266..c700bbfe9ef4ed 100644 --- a/.github/actions/compilers/action.yml +++ b/.github/actions/compilers/action.yml @@ -153,9 +153,12 @@ runs: GITHUB_PULL_REQUEST_URL: ${{ github.event.pull_request.html_url }} GITHUB_REF: ${{ github.ref }} + # Clean up non-default docker images to save disk space. + # The default image (clang-20) is reused across multiple steps + # within the same job, so we keep it to avoid redundant pulls. - name: clean up docker image shell: bash run: docker rmi "ghcr.io/ruby/ruby-ci-image:${INPUT_TAG}" || true - if: always() + if: ${{ always() && inputs.tag != 'clang-20' }} env: INPUT_TAG: ${{ inputs.tag }} From 503cf433e68ad3b66917282f72b360fd2f4bd6a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Mar 2026 02:17:48 +0000 Subject: [PATCH 14/15] Bump the github-actions group across 1 directory with 5 updates Bumps the github-actions group with 5 updates in the / directory: | Package | From | To | | --- | --- | --- | | [ruby/setup-ruby](https://github.com/ruby/setup-ruby) | `1.295.0` | `1.299.0` | | [github/codeql-action](https://github.com/github/codeql-action) | `4.34.1` | `4.35.1` | | [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) | `2.5.0` | `3.0.0` | | [lewagon/wait-on-check-action](https://github.com/lewagon/wait-on-check-action) | `1.5.0` | `1.6.0` | | [taiki-e/install-action](https://github.com/taiki-e/install-action) | `2.69.10` | `2.70.2` | Updates `ruby/setup-ruby` from 1.295.0 to 1.299.0 - [Release notes](https://github.com/ruby/setup-ruby/releases) - [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb) - [Commits](https://github.com/ruby/setup-ruby/compare/319994f95fa847cf3fb3cd3dbe89f6dcde9f178f...3ff19f5e2baf30647122352b96108b1fbe250c64) Updates `github/codeql-action` from 4.34.1 to 4.35.1 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/38697555549f1db7851b81482ff19f1fa5c4fedc...c10b8064de6f491fea524254123dbe5e09572f13) Updates `dependabot/fetch-metadata` from 2.5.0 to 3.0.0 - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/21025c705c08248db411dc16f3619e6b5f9ea21a...ffa630c65fa7e0ecfa0625b5ceda64399aea1b36) Updates `lewagon/wait-on-check-action` from 1.5.0 to 1.6.0 - [Release notes](https://github.com/lewagon/wait-on-check-action/releases) - [Changelog](https://github.com/lewagon/wait-on-check-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/lewagon/wait-on-check-action/compare/74049309dfeff245fe8009a0137eacf28136cb3c...a08fbe2b86f9336198f33be6ad9c16b96f92799c) Updates `taiki-e/install-action` from 2.69.10 to 2.70.2 - [Release notes](https://github.com/taiki-e/install-action/releases) - [Changelog](https://github.com/taiki-e/install-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/install-action/compare/7627fb428e65e78e2ec9a24ae5c5bd5f8553f182...e9e8e031bcd90cdbe8ac6bb1d376f8596e587fbf) --- updated-dependencies: - dependency-name: ruby/setup-ruby dependency-version: 1.299.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: github/codeql-action dependency-version: 4.35.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: dependabot/fetch-metadata dependency-version: 3.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: lewagon/wait-on-check-action dependency-version: 1.6.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: taiki-e/install-action dependency-version: 2.70.2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/annocheck.yml | 2 +- .github/workflows/auto_review_pr.yml | 2 +- .github/workflows/baseruby.yml | 2 +- .github/workflows/bundled_gems.yml | 2 +- .github/workflows/check_dependencies.yml | 2 +- .github/workflows/check_misc.yml | 2 +- .github/workflows/check_sast.yml | 6 +++--- .github/workflows/dependabot_automerge.yml | 4 ++-- .github/workflows/modgc.yml | 2 +- .github/workflows/parse_y.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/scorecards.yml | 2 +- .github/workflows/spec_guards.yml | 2 +- .github/workflows/sync_default_gems.yml | 2 +- .github/workflows/ubuntu.yml | 2 +- .github/workflows/wasm.yml | 2 +- .github/workflows/windows.yml | 2 +- .github/workflows/yjit-ubuntu.yml | 2 +- .github/workflows/zjit-macos.yml | 2 +- .github/workflows/zjit-ubuntu.yml | 4 ++-- 20 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/annocheck.yml b/.github/workflows/annocheck.yml index b276b273b41919..11fbc9eecc7fe5 100644 --- a/.github/workflows/annocheck.yml +++ b/.github/workflows/annocheck.yml @@ -73,7 +73,7 @@ jobs: builddir: build makeup: true - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 with: ruby-version: '3.1' bundler: none diff --git a/.github/workflows/auto_review_pr.yml b/.github/workflows/auto_review_pr.yml index e92ad563dd62a8..92917b74b4ce8b 100644 --- a/.github/workflows/auto_review_pr.yml +++ b/.github/workflows/auto_review_pr.yml @@ -29,7 +29,7 @@ jobs: with: persist-credentials: false - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 with: ruby-version: '3.4' bundler: none diff --git a/.github/workflows/baseruby.yml b/.github/workflows/baseruby.yml index 42c2fd0936b55c..c083a9444b4b30 100644 --- a/.github/workflows/baseruby.yml +++ b/.github/workflows/baseruby.yml @@ -48,7 +48,7 @@ jobs: - ruby-3.3 steps: - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 with: ruby-version: ${{ matrix.ruby }} bundler: none diff --git a/.github/workflows/bundled_gems.yml b/.github/workflows/bundled_gems.yml index c7231c9d0e1e33..a4cb520ed53002 100644 --- a/.github/workflows/bundled_gems.yml +++ b/.github/workflows/bundled_gems.yml @@ -38,7 +38,7 @@ jobs: with: token: ${{ (github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull')) && secrets.MATZBOT_AUTO_UPDATE_TOKEN || secrets.GITHUB_TOKEN }} - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 with: ruby-version: 4.0 diff --git a/.github/workflows/check_dependencies.yml b/.github/workflows/check_dependencies.yml index 0f1f6d9f97f50a..4c067160cfed7f 100644 --- a/.github/workflows/check_dependencies.yml +++ b/.github/workflows/check_dependencies.yml @@ -42,7 +42,7 @@ jobs: - uses: ./.github/actions/setup/directories - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 with: ruby-version: '3.1' bundler: none diff --git a/.github/workflows/check_misc.yml b/.github/workflows/check_misc.yml index 863655cd0682e0..26af74644b383c 100644 --- a/.github/workflows/check_misc.yml +++ b/.github/workflows/check_misc.yml @@ -23,7 +23,7 @@ jobs: token: ${{ (github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull')) && secrets.MATZBOT_AUTO_UPDATE_TOKEN || secrets.GITHUB_TOKEN }} persist-credentials: false - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 with: ruby-version: head diff --git a/.github/workflows/check_sast.yml b/.github/workflows/check_sast.yml index 9259afe66f7903..3c961c93d2293e 100644 --- a/.github/workflows/check_sast.yml +++ b/.github/workflows/check_sast.yml @@ -78,13 +78,13 @@ jobs: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1 + uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1 with: languages: ${{ matrix.language }} build-mode: none - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1 + uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1 with: category: '/language:${{ matrix.language }}' upload: False @@ -125,7 +125,7 @@ jobs: continue-on-error: true - name: Upload SARIF - uses: github/codeql-action/upload-sarif@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1 + uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1 with: sarif_file: sarif-results/${{ matrix.language }}.sarif continue-on-error: true diff --git a/.github/workflows/dependabot_automerge.yml b/.github/workflows/dependabot_automerge.yml index 7f52dc08b62cc6..0451f689992447 100644 --- a/.github/workflows/dependabot_automerge.yml +++ b/.github/workflows/dependabot_automerge.yml @@ -13,11 +13,11 @@ jobs: if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'ruby/ruby' steps: - name: Dependabot metadata - uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a # v2.5.0 + uses: dependabot/fetch-metadata@ffa630c65fa7e0ecfa0625b5ceda64399aea1b36 # v3.0.0 id: metadata - name: Wait for status checks - uses: lewagon/wait-on-check-action@74049309dfeff245fe8009a0137eacf28136cb3c # v1.5.0 + uses: lewagon/wait-on-check-action@a08fbe2b86f9336198f33be6ad9c16b96f92799c # v1.6.0 with: repo-token: ${{ secrets.GITHUB_TOKEN }} ref: ${{ github.event.pull_request.head.sha || github.sha }} diff --git a/.github/workflows/modgc.yml b/.github/workflows/modgc.yml index 1b9ef7c49bcc5f..cbea9adc5b5095 100644 --- a/.github/workflows/modgc.yml +++ b/.github/workflows/modgc.yml @@ -62,7 +62,7 @@ jobs: uses: ./.github/actions/setup/ubuntu if: ${{ contains(matrix.os, 'ubuntu') }} - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 with: ruby-version: '3.1' bundler: none diff --git a/.github/workflows/parse_y.yml b/.github/workflows/parse_y.yml index fcd9fb70de5833..b84d32d9b8376c 100644 --- a/.github/workflows/parse_y.yml +++ b/.github/workflows/parse_y.yml @@ -59,7 +59,7 @@ jobs: - uses: ./.github/actions/setup/ubuntu - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 with: ruby-version: '3.1' bundler: none diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 83ae60f248ca56..d7039fd2d153a0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,7 +19,7 @@ jobs: with: persist-credentials: false - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 with: ruby-version: 3.3.4 diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index f68d9756f9598b..02f444ea52381e 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -73,6 +73,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard (optional). # Commenting out will disable upload of results to your repo's Code Scanning dashboard - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1 + uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1 with: sarif_file: results.sarif diff --git a/.github/workflows/spec_guards.yml b/.github/workflows/spec_guards.yml index d889442a4dbd00..77e7b2be30343f 100644 --- a/.github/workflows/spec_guards.yml +++ b/.github/workflows/spec_guards.yml @@ -49,7 +49,7 @@ jobs: with: persist-credentials: false - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 with: ruby-version: ${{ matrix.ruby }} bundler: none diff --git a/.github/workflows/sync_default_gems.yml b/.github/workflows/sync_default_gems.yml index 72203e10f57c32..bebcba8c2fe407 100644 --- a/.github/workflows/sync_default_gems.yml +++ b/.github/workflows/sync_default_gems.yml @@ -36,7 +36,7 @@ jobs: with: token: ${{ github.repository == 'ruby/ruby' && secrets.MATZBOT_AUTO_UPDATE_TOKEN || secrets.GITHUB_TOKEN }} - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 with: ruby-version: '3.4' bundler: none diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 7b7a1af318357c..3c6578f5787974 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -70,7 +70,7 @@ jobs: with: arch: ${{ matrix.arch }} - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 with: ruby-version: '3.1' bundler: none diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index 4f6e10a6f9318e..ac78d98a1e5562 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -99,7 +99,7 @@ jobs: run: | echo "WASI_SDK_PATH=/opt/wasi-sdk" >> $GITHUB_ENV - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 with: ruby-version: '3.1' bundler: none diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 7cf3e3af007e4b..d4646046bf0831 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -59,7 +59,7 @@ jobs: - run: md build working-directory: - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 with: # windows-11-arm has only 3.4.1, 3.4.2, 3.4.3, head ruby-version: ${{ !endsWith(matrix.os, 'arm') && '3.1' || '3.4' }} diff --git a/.github/workflows/yjit-ubuntu.yml b/.github/workflows/yjit-ubuntu.yml index 6dc52c1567a7ea..b4816c580444f9 100644 --- a/.github/workflows/yjit-ubuntu.yml +++ b/.github/workflows/yjit-ubuntu.yml @@ -133,7 +133,7 @@ jobs: - uses: ./.github/actions/setup/ubuntu - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 with: ruby-version: '3.1' bundler: none diff --git a/.github/workflows/zjit-macos.yml b/.github/workflows/zjit-macos.yml index c99689b00ae77f..334ed898d8463b 100644 --- a/.github/workflows/zjit-macos.yml +++ b/.github/workflows/zjit-macos.yml @@ -93,7 +93,7 @@ jobs: rustup install ${{ matrix.rust_version }} --profile minimal rustup default ${{ matrix.rust_version }} - - uses: taiki-e/install-action@7627fb428e65e78e2ec9a24ae5c5bd5f8553f182 # v2.69.10 + - uses: taiki-e/install-action@e9e8e031bcd90cdbe8ac6bb1d376f8596e587fbf # v2.70.2 with: tool: nextest@0.9 if: ${{ matrix.test_task == 'zjit-check' }} diff --git a/.github/workflows/zjit-ubuntu.yml b/.github/workflows/zjit-ubuntu.yml index 01c4f293e861a9..6c2f4f414c67d7 100644 --- a/.github/workflows/zjit-ubuntu.yml +++ b/.github/workflows/zjit-ubuntu.yml @@ -114,12 +114,12 @@ jobs: - uses: ./.github/actions/setup/ubuntu - - uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + - uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 # v1.299.0 with: ruby-version: '3.1' bundler: none - - uses: taiki-e/install-action@7627fb428e65e78e2ec9a24ae5c5bd5f8553f182 # v2.69.10 + - uses: taiki-e/install-action@e9e8e031bcd90cdbe8ac6bb1d376f8596e587fbf # v2.70.2 with: tool: nextest@0.9 if: ${{ matrix.test_task == 'zjit-check' }} From 3379c7efbdc34b7936f322a6bc2de4834c8c65fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=A9=EC=84=B1=EB=B2=94=20=28Bang=20Seongbeom=29?= Date: Fri, 20 Mar 2026 17:14:08 +0000 Subject: [PATCH 15/15] [ruby/rubygems] Restore rb_sys dependency for Rust https://github.com/ruby/rubygems/commit/7cd3b9a08a --- lib/bundler/templates/newgem/newgem.gemspec.tt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/bundler/templates/newgem/newgem.gemspec.tt b/lib/bundler/templates/newgem/newgem.gemspec.tt index 7799dbfd32f021..c705f9eac0c712 100644 --- a/lib/bundler/templates/newgem/newgem.gemspec.tt +++ b/lib/bundler/templates/newgem/newgem.gemspec.tt @@ -40,6 +40,9 @@ Gem::Specification.new do |spec| # Uncomment to register a new dependency of your gem # spec.add_dependency "example-gem", "~> 1.0" +<%- if config[:ext] == 'rust' -%> + spec.add_dependency "rb_sys", "~> 0.9.91" +<%- end -%> <%- if config[:ext] == 'go' -%> spec.add_dependency "go_gem", "~> 0.2" <%- end -%>