From ab353593a96a014243411fdd7e7e56dade3b9b25 Mon Sep 17 00:00:00 2001 From: graial Date: Fri, 4 Sep 2026 17:43:14 +0800 Subject: [PATCH 1/2] update pr for later after filing predicate bugfix separately --- Rakefile | 3 ++- lib/ruby_wasm/build/product/product.rb | 2 ++ lib/ruby_wasm/build/toolchain.rb | 13 +++++++++++++ sig/ruby_wasm/build.rbs | 4 ++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 71b4f288e..b723298ec 100644 --- a/Rakefile +++ b/Rakefile @@ -16,7 +16,8 @@ BUILDS = BUILD_SOURCES .product(BUILD_PROFILES) .map { |src, profile| [src, "wasm32-unknown-wasip1", profile] } + - BUILD_SOURCES.map { |src| [src, "wasm32-unknown-emscripten", "full"] } + BUILD_SOURCES.map { |src| [src, "wasm32-unknown-emscripten", "full"] } + + BUILD_SOURCES.map { |src| [src, "wasm32-unknown-icp", "minimal"] } NPM_PACKAGES = [ { diff --git a/lib/ruby_wasm/build/product/product.rb b/lib/ruby_wasm/build/product/product.rb index 726517c3a..2a24fda1d 100644 --- a/lib/ruby_wasm/build/product/product.rb +++ b/lib/ruby_wasm/build/product/product.rb @@ -17,6 +17,8 @@ def system_triplet_args args.concat(%W[--host wasm32-wasi]) when "wasm32-unknown-emscripten" args.concat(%W[--host wasm32-emscripten]) + when "wasm32-unknown-icp" + args.concat(%W[--host wasm32-wasi]) else raise "unknown target: #{@target.triple}" end diff --git a/lib/ruby_wasm/build/toolchain.rb b/lib/ruby_wasm/build/toolchain.rb index 35e67f682..6206d3579 100644 --- a/lib/ruby_wasm/build/toolchain.rb +++ b/lib/ruby_wasm/build/toolchain.rb @@ -33,6 +33,13 @@ def self.get(target, options, build_dir = nil) ) when "wasm32-unknown-emscripten" return RubyWasm::Emscripten.new + when "wasm32-unknown-icp" + return( + RubyWasm::Icp.new( + build_dir: build_dir, + version: options[:wasi_sdk_version] + ) + ) else raise "unknown target: #{target}" end @@ -295,4 +302,10 @@ def find_tool(name) @tools[name] end end + + class Icp < WASISDK + def name + "icp" + end + end end diff --git a/sig/ruby_wasm/build.rbs b/sig/ruby_wasm/build.rbs index 663e2a55f..f6f66b698 100644 --- a/sig/ruby_wasm/build.rbs +++ b/sig/ruby_wasm/build.rbs @@ -272,6 +272,10 @@ module RubyWasm def wasi_sysroot?: -> bool end + class Icp < WASISDK + def name: -> String + end + class Binaryen @need_fetch_binaryen: bool @binaryen_path: String From c71947f7937fbcd45ee31f328e1bc017e558048f Mon Sep 17 00:00:00 2001 From: graial Date: Mon, 14 Sep 2026 07:52:27 +0800 Subject: [PATCH 2/2] update readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 143fbcfef..2b5c0ef32 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +**This fork is the ongoing development of an IC deployable ruby build and discussion around what, if any, belongs in the upstream branch. Active development is on the `release` branch** + # ruby.wasm [![Build ruby.wasm](https://github.com/ruby/ruby.wasm/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/ruby/ruby.wasm/actions/workflows/build.yml)