diff --git a/.github/actions/setup/baseruby/action.yml b/.github/actions/setup/baseruby/action.yml index 76fe068897a163..9c93be0f9a9a82 100644 --- a/.github/actions/setup/baseruby/action.yml +++ b/.github/actions/setup/baseruby/action.yml @@ -45,7 +45,7 @@ runs: ln -sr "$srcdir" "$builddir/.src" pushd "$builddir" .src/configure "--prefix=${installdir}" --disable-install-doc - CONFIGURE_ARGS=--with-out-ext=-test- make install + CONFIGURE_ARGS=--with-out-ext=-test- make install dump_ast install dump_ast "${installdir}/bin" { echo "${installdir}/bin/dump_ast" diff --git a/.github/actions/setup/directories/action.yml b/.github/actions/setup/directories/action.yml index 78b57c17619a51..bb1c92bd735168 100644 --- a/.github/actions/setup/directories/action.yml +++ b/.github/actions/setup/directories/action.yml @@ -157,11 +157,13 @@ runs: shell: bash working-directory: ${{ inputs.srcdir }} run: | + ruby tool/missing-baseruby.bat --verbose touch config.status .rbconfig.time for mk in Makefile GNUmakefile; do sed -f tool/prereq.status template/$mk.in > $mk done make up + echo RUBY_DUMP_AST=true >> "$GITHUB_ENV" # Cleanup, runs even on failure - if: always() && inputs.makeup diff --git a/.github/workflows/annocheck.yml b/.github/workflows/annocheck.yml index f58363f76a23e6..1fda0b98877b3b 100644 --- a/.github/workflows/annocheck.yml +++ b/.github/workflows/annocheck.yml @@ -67,17 +67,17 @@ jobs: sparse-checkout: /.github persist-credentials: false + - uses: ruby/setup-ruby@003a5c4d8d6321bd302e38f6f0ec593f77f06600 # v1.319.0 + with: + ruby-version: '3.1' + bundler: none + - uses: ./.github/actions/setup/directories with: srcdir: src builddir: build makeup: true - - uses: ruby/setup-ruby@003a5c4d8d6321bd302e38f6f0ec593f77f06600 # v1.319.0 - with: - ruby-version: '3.1' - bundler: none - # Minimal flags to pass the check. # -g0 disables backtraces when SEGV. Do not set that. - name: Run configure diff --git a/configure.ac b/configure.ac index f636d19e3f1026..6fbbb11178d219 100644 --- a/configure.ac +++ b/configure.ac @@ -119,12 +119,16 @@ 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)'], - [AS_IF([test "$cross_compiling" = yes], [ + [AS_IF([test ${RUBY_DUMP_AST+set}], [ + DUMP_AST="${RUBY_DUMP_AST}" + DUMP_AST_TARGET='$(empty)' + ], [test "$cross_compiling" = yes], [ DUMP_AST='build-tool/dump_ast$(BUILD_EXEEXT)' + DUMP_AST_TARGET='$(DUMP_AST)' ], [ DUMP_AST='./dump_ast$(BUILD_EXEEXT)' - ]) - DUMP_AST_TARGET='$(DUMP_AST)']) + 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/win32/Makefile.sub b/win32/Makefile.sub index 203179006f8951..4f95c10bcb5690 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -567,6 +567,12 @@ ABI_VERSION_HDR = $(hdrdir)/ruby/internal/abi.h !if defined(DUMP_AST) DUMP_AST_TARGET = $(empty) +!else if defined(RUBY_DUMP_AST) +DUMP_AST = $(RUBY_DUMP_AST) +DUMP_AST_TARGET = $(empty) +!else if "$(CROSS_COMPILING)" == "yes" +DUMP_AST = ruby-dump_ast$(BUILD_EXEEXT) +DUMP_AST_TARGET = $(DUMP_AST) !else DUMP_AST = dump_ast$(BUILD_EXEEXT) DUMP_AST_TARGET = $(DUMP_AST)