Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
{
Expand Down
2 changes: 2 additions & 0 deletions lib/ruby_wasm/build/product/product.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions lib/ruby_wasm/build/toolchain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -295,4 +302,10 @@ def find_tool(name)
@tools[name]
end
end

class Icp < WASISDK
def name
"icp"
end
end
end
4 changes: 4 additions & 0 deletions sig/ruby_wasm/build.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading