Skip to content

Commit e4a524c

Browse files
committed
build(crossruby): pass host dump_ast to configure
Pass the host-built dump_ast alongside --with-baseruby so cross builds do not try to execute the target-side wasm dump_ast while generating .rbinc files on current Ruby head. Also declare dump_ast_path in RBS and document why the configure argument is needed.
1 parent 1345e17 commit e4a524c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/ruby_wasm/build/product/crossruby.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ def baseruby_path
322322
File.join(@baseruby.install_dir, "bin/ruby")
323323
end
324324

325+
def dump_ast_path
326+
File.join(@baseruby.product_build_dir, "dump_ast")
327+
end
328+
325329
def configure_args(build_triple, toolchain)
326330
target = @params.target.triple
327331
default_exts = @params.default_exts
@@ -336,6 +340,9 @@ def configure_args(build_triple, toolchain)
336340
args << %Q(--with-zlib-dir=#{@zlib.install_root})
337341
args << %Q(--with-openssl-dir=#{@openssl.install_root}) if @openssl
338342
args << %Q(--with-baseruby=#{baseruby_path})
343+
# Use the host-built dump_ast so cross builds don't try to execute the
344+
# target-side wasm dump_ast while generating .rbinc files.
345+
args << %Q(--with-dump-ast=#{dump_ast_path})
339346

340347
case target
341348
when /^wasm32-unknown-wasi/

sig/ruby_wasm/build.rbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ module RubyWasm
218218
def extinit_obj: -> String
219219
def extinit_c_erb: -> String
220220
def baseruby_path: -> String
221+
def dump_ast_path: -> String
221222
def configure_args: (String build_triple, Toolchain toolchain) -> Array[String]
222223
def rbconfig_rb: -> String?
223224
end

0 commit comments

Comments
 (0)