diff --git a/README.md b/README.md index bb77d041..b340a247 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,9 @@ represents the `Homestar` runtime. We recommend diving into each package's own You can find the spec for translating between IPLD and WIT runtime values based on WIT types [here](./homestar-wasm/README.md#interpreting-between-ipld-and-wit). + *Note*: This library also includes a [WIT `world`][wa.dev-homestar-host] for + bindings implemented on the host runtime. + - [homestar-workflow](./homestar-workflow) The *workflow* library implements workflow-centric [Ipvm features][ipvm-spec] @@ -157,6 +160,8 @@ represents the `Homestar` runtime. We recommend diving into each package's own writing and compiling [Wasm component][wasm-component] modules using [wit-bindgen][wit-bindgen]. + You can find our component packages on [wa.dev][wa.dev-homestar]. + - [homestar-schemas](./homestar-schemas) `homestar-schemas` is a crate for generating OpenRPC docs and JSON Schemas that document the [homestar-runtime](./homestar-runtime) JSON-RPC API, workflows, and receipts. @@ -272,6 +277,8 @@ conditions. [research]: https://github.com/ipvm-wg/research [seamless-services]: https://youtu.be/Kr3B3sXh_VA [ucan-invocation]: https://github.com/ucan-wg/invocation +[wa.dev-homestar]: https://wa.dev/homestar +[wa.dev-homestar-host]: https://wa.dev/homestar:host [wasm-component]: https://github.com/WebAssembly/component-model [wasmtime]: https://github.com/bytecodealliance/wasmtime [wit]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md diff --git a/examples/websocket-relay/example_test.wasm b/examples/websocket-relay/example_test.wasm index a8261e2a..c5bb926d 100755 Binary files a/examples/websocket-relay/example_test.wasm and b/examples/websocket-relay/example_test.wasm differ diff --git a/examples/websocket-relay/relay-app/src/lib/workflow.ts b/examples/websocket-relay/relay-app/src/lib/workflow.ts index b0631a0c..660d669b 100644 --- a/examples/websocket-relay/relay-app/src/lib/workflow.ts +++ b/examples/websocket-relay/relay-app/src/lib/workflow.ts @@ -256,7 +256,7 @@ export const workflowOnePromised = WorkflowBuilder.workflow({ WorkflowBuilder.crop({ name: "crop", resource: - "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q", + "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq", args: { data: "{{ cid:bafybeiejevluvtoevgk66plh5t6xiy3ikyuuxg3vgofuvpeckb6eadresm }}", x: 150, @@ -268,7 +268,7 @@ export const workflowOnePromised = WorkflowBuilder.workflow({ WorkflowBuilder.rotate90({ name: "rotate90", resource: - "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q", + "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq", args: { data: "{{needs.crop.output}}", }, @@ -276,7 +276,7 @@ export const workflowOnePromised = WorkflowBuilder.workflow({ WorkflowBuilder.blur({ name: "blur", resource: - "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q", + "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq", args: { data: "{{needs.rotate90.output}}", sigma: 20.2, @@ -293,7 +293,7 @@ export const workflowTwoPromised = WorkflowBuilder.workflow({ WorkflowBuilder.crop({ name: "crop", resource: - "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q", + "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq", args: { data: "{{ cid:bafybeiejevluvtoevgk66plh5t6xiy3ikyuuxg3vgofuvpeckb6eadresm }}", x: 150, @@ -305,7 +305,7 @@ export const workflowTwoPromised = WorkflowBuilder.workflow({ WorkflowBuilder.rotate90({ name: "rotate90", resource: - "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q", + "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq", args: { data: "{{needs.crop.output}}", }, @@ -313,7 +313,7 @@ export const workflowTwoPromised = WorkflowBuilder.workflow({ WorkflowBuilder.grayscale({ name: "grayscale", resource: - "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q", + "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq", args: { data: "{{needs.rotate90.output}}", }, diff --git a/flake.lock b/flake.lock index 8b0df931..e8503aaa 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "advisory-db": { "flake": false, "locked": { - "lastModified": 1708191677, - "narHash": "sha256-7M3B0E8ZjB0HOuNTO2XzJwFPE9A8y/t54UU1QIKKEC8=", + "lastModified": 1710515894, + "narHash": "sha256-tmQ9TMCb2jZY3jYdf53qIberkYV3dnUzdAYYK/NB+No=", "owner": "rustsec", "repo": "advisory-db", - "rev": "4484e7ae6bc8d214cd5e9c376028578aeeff7ce0", + "rev": "369d98c1b95b7b56d0859605916d7b81a7d1f1c4", "type": "github" }, "original": { @@ -21,11 +21,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1707685877, - "narHash": "sha256-XoXRS+5whotelr1rHiZle5t5hDg9kpguS5yk8c8qzOc=", + "lastModified": 1711299236, + "narHash": "sha256-6/JsyozOMKN8LUGqWMopKTSiK8N79T8Q+hcxu2KkTXg=", "owner": "ipetkov", "repo": "crane", - "rev": "2c653e4478476a52c6aa3ac0495e4dea7449ea0e", + "rev": "880573f80d09e18a11713f402b9e6172a085449f", "type": "github" }, "original": { @@ -79,11 +79,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1709446916, - "narHash": "sha256-MX3eR3ao971besQvKt9aKu4tN8tZht7Do3G/eNylNY8=", + "lastModified": 1711520562, + "narHash": "sha256-rVE+5nzGarXDYoXPcySg+/NpkPZu53H3YhtE1nElUhg=", "owner": "nix-community", "repo": "fenix", - "rev": "4b07da0f91ea99f263f47165a11a48678c9e0dc3", + "rev": "21cf09a640b2a0b8f805aa767f42916c9579776b", "type": "github" }, "original": { @@ -101,11 +101,11 @@ "rust-analyzer-src": "rust-analyzer-src_2" }, "locked": { - "lastModified": 1708150887, - "narHash": "sha256-lyEaeShLZqQtFO+ULLfxF9fYaYpTal0Ck1B+iKYBOMs=", + "lastModified": 1711261304, + "narHash": "sha256-YVVuVVw2cYxEGron+9DnEwHzgSv59TIeLgBDAstpCtg=", "owner": "nix-community", "repo": "fenix", - "rev": "761431323e30846bae160e15682cfa687c200606", + "rev": "2f420b2cc2dc0c91031a4a5625a2217f8e49657b", "type": "github" }, "original": { @@ -175,11 +175,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1709126324, - "narHash": "sha256-q6EQdSeUZOG26WelxqkmR7kArjgWCdw5sfJVHPH/7j8=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "d465f4819400de7c8d874d50b982301f28a84605", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -193,11 +193,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -236,11 +236,11 @@ }, "nix-filter": { "locked": { - "lastModified": 1705332318, - "narHash": "sha256-kcw1yFeJe9N4PjQji9ZeX47jg0p9A0DuU4djKvg1a7I=", + "lastModified": 1710156097, + "narHash": "sha256-1Wvk8UP7PXdf8bCCaEoMnOT1qe5/Duqgj+rL8sRQsSM=", "owner": "numtide", "repo": "nix-filter", - "rev": "3449dc925982ad46246cfc36469baf66e1b64f17", + "rev": "3342559a24e85fc164b295c3444e8a139924675b", "type": "github" }, "original": { @@ -358,11 +358,11 @@ "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1708246952, - "narHash": "sha256-amIS9blx/k8mHIhYsfqOEaswd13d3661Wex5fV9dv60=", + "lastModified": 1711389924, + "narHash": "sha256-AmtdpS4IP+h1g99bvZs+t2Gk5eIFRB4GJ3YL9wjNorI=", "owner": "rvolosatovs", "repo": "nixify", - "rev": "037635eaf516922675872794f923e25c99d144be", + "rev": "b0530dccd1865645bcef8b318f9e27c49b762a41", "type": "github" }, "original": { @@ -427,11 +427,11 @@ }, "nixlib_3": { "locked": { - "lastModified": 1709426687, - "narHash": "sha256-jLBZmwXf0WYHzLkmEMq33bqhX55YtT5edvluFr0RcSA=", + "lastModified": 1711241261, + "narHash": "sha256-knrTvpl81yGFHIpm1SsLDApe0thFkw1cl3ISAMPmP/0=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "7873d84a89ae6e4841528ff7f5697ddcb5bdfe6c", + "rev": "b2a1eeef8c185f6bd27432b053ff09d773244cbc", "type": "github" }, "original": { @@ -442,11 +442,11 @@ }, "nixos-unstable": { "locked": { - "lastModified": 1709558755, - "narHash": "sha256-hx4FIbk4X4ve1oiHLOj+VE6dzO4CtXBR5RSU6kaq34M=", + "lastModified": 1711483428, + "narHash": "sha256-QFbfFvHiGW/jDwM1pvcqKKwOnCXywUgPoGxdZDmlwKI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "207107bbc7d6d19a8b2c36a088d3756d03490243", + "rev": "fd84c1ff8937685294342c57a656a7066800d01c", "type": "github" }, "original": { @@ -457,11 +457,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1706925685, - "narHash": "sha256-hVInjWMmgH4yZgA4ZtbgJM1qEAel72SYhP5nOWX4UIM=", + "lastModified": 1710827359, + "narHash": "sha256-/KY8hffTh9SN/tTcDn/FrEiYwTXnU8NKnr4D7/stmmA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "79a13f1437e149dc7be2d1290c74d378dad60814", + "rev": "5710127d9693421e78cca4f74fac2db6d67162b1", "type": "github" }, "original": { @@ -473,11 +473,11 @@ }, "nixpkgs-darwin": { "locked": { - "lastModified": 1708105575, - "narHash": "sha256-sS4AItZeUnAei6v8FqxNlm+/27MPlfoGym/TZP0rmH0=", + "lastModified": 1711217620, + "narHash": "sha256-GGHuUQoSsGN/BJYEu7fY+Qzipwq3NqChjlUtT3eg33s=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1d1817869c47682a6bee85b5b0a6537b6c0fba26", + "rev": "ebbe1c1299faf63fffdf1e2a6ebfe43c56b2e691", "type": "github" }, "original": { @@ -505,11 +505,11 @@ }, "nixpkgs-nixos": { "locked": { - "lastModified": 1708105575, - "narHash": "sha256-sS4AItZeUnAei6v8FqxNlm+/27MPlfoGym/TZP0rmH0=", + "lastModified": 1711124224, + "narHash": "sha256-l0zlN/3CiodvWDtfBOVxeTwYSRz93muVbXWSpaMjXxM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "1d1817869c47682a6bee85b5b0a6537b6c0fba26", + "rev": "56528ee42526794d413d6f244648aaee4a7b56c0", "type": "github" }, "original": { @@ -537,11 +537,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1709309926, - "narHash": "sha256-VZFBtXGVD9LWTecGi6eXrE0hJ/mVB3zGUlHImUs2Qak=", + "lastModified": 1711460390, + "narHash": "sha256-akSgjDZL6pVHEfSE6sz1DNSXuYX6hq+P/1Z5IoYWs7E=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "79baff8812a0d68e24a836df0a364c678089e2c7", + "rev": "44733514b72e732bd49f5511bd0203dea9b9a434", "type": "github" }, "original": { @@ -565,11 +565,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1709373076, - "narHash": "sha256-vRBRyCVMhH+giewRQgOgNO+p7VlGeJNgCqrZBnvfWQc=", + "lastModified": 1711443624, + "narHash": "sha256-K5aLPjCF3A9ArczT5X/CKo1bfQEwGK5CsJ3eYHIjEnk=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "4ef6a49b44e8aa380da7522442234bfd7a52c55e", + "rev": "4b33850c39049047e2deb4269b60bd8330b68031", "type": "github" }, "original": { @@ -582,11 +582,11 @@ "rust-analyzer-src_2": { "flake": false, "locked": { - "lastModified": 1708018577, - "narHash": "sha256-B75VUqKvQeIqAUnYw4bGjY3xxrCqzRBJHLbmD0MAWEw=", + "lastModified": 1711181358, + "narHash": "sha256-bK1r+UTqTltHrQCv49TnBUsTqlRs13t7q//l+onVqqc=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "b9b0d29b8e69b02457cfabe20c4c69cdb45f3cc5", + "rev": "e265e3d5189513c42d037999d41a696369af9388", "type": "github" }, "original": { @@ -654,11 +654,11 @@ ] }, "locked": { - "lastModified": 1708135817, - "narHash": "sha256-EUMO/K3+Wgh0THOLoRXhxrh6G/pQ7BlJ8No+ciy1nKA=", + "lastModified": 1711246447, + "narHash": "sha256-g9TOluObcOEKewFo2fR4cn51Y/jSKhRRo4QZckHLop0=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "c77e68d33a84ce3f9e86905c0f2ef78d5defad28", + "rev": "dcc802a6ec4e9cc6a1c8c393327f0c42666f22e4", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a8865773..0bd3cf56 100644 --- a/flake.nix +++ b/flake.nix @@ -50,7 +50,7 @@ file-toolchain = fenix.packages.${system}.fromToolchainFile { file = ./rust-toolchain.toml; # sha256 = pkgs.lib.fakeSha256; - sha256 = "sha256-e4mlaJehWBymYxJGgnbuCObVlqMlQSilZ8FljG9zPHY="; + sha256 = "sha256-+syqAd2kX8KVa8/U2gz3blIQTTsYYt3U63xBWaGOSc8="; }; default-toolchain = fenix.packages.${system}.complete.withComponents [ @@ -72,8 +72,8 @@ nightly-rustfmt = (fenix.packages.${system}.toolchainOf { channel = "nightly"; - date = "2024-02-13"; - sha256 = "sha256-QeiJ8YNVpYhoxxOrrQKOwnfoYo4c8PTlcjEOn/NCmSI="; + date = "2024-03-26"; + sha256 = "sha256-kHuQWRjPWmulZWG7tka+rX+VjZOnP7pZ2xF2qxV8784="; # sha256 = pkgs.lib.fakeSha256; }) .rustfmt; @@ -101,6 +101,9 @@ twiggy unstable.cargo-component unstable.wasm-tools + # TODO: Return to this + # unstable.warg + # unstable.wit ]; ci = pkgs.writeScriptBin "ci" '' @@ -237,6 +240,7 @@ cp target/wasm32-wasi/release-wasm-fn/homestar_functions_test.wasm homestar-wasm/fixtures/example_test_wasi.wasm wasm-tools component new homestar-wasm/fixtures/example_test_wasi.wasm -o homestar-wasm/fixtures/example_test_wasi_component.wasm --adapt homestar-functions/wasi_snapshot_preview1.wasm cp homestar-wasm/fixtures/example_test.wasm examples/websocket-relay/example_test.wasm + wasm-tools component wit homestar-wasm/wit -o homestar-wasm/fixtures/host.wasm --wasm ''; wasmAdd = pkgs.writeScriptBin "wasm-ex-add" '' @@ -360,16 +364,16 @@ packages.irust = rustPlatform.buildRustPackage rec { pname = "IRust"; - version = "1.71.2"; + version = "1.71.20"; src = pkgs.fetchFromGitHub { owner = "sigmaSd"; repo = pname; rev = "v${version}"; - sha256 = "sha256-6qxkz7Pf8XGORo6O4eIwTcqBt+8WBp2INY81YUCxJts="; + sha256 = "sha256-PokyKNHiZqOo1DXLQ2NAkuax4BXayNko9nQMighuh4Q="; }; doCheck = false; - cargoSha256 = "sha256-VZXxz3E8I/8T2H7KHa2IADjqsG2XHBNhwq/OBsq3vHs="; + cargoSha256 = "sha256-0CMrA6k4OEXM9MJ9Iyk0yMuulvhT2pXty4OIU5Z6a9U="; }; packages.default = diff --git a/homestar-functions/add/src/bindings.rs b/homestar-functions/add/src/bindings.rs index 1f8780c5..8649fb1d 100644 --- a/homestar-functions/add/src/bindings.rs +++ b/homestar-functions/add/src/bindings.rs @@ -1,13 +1,11 @@ -// Generated by `wit-bindgen` 0.20.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.21.0. DO NOT EDIT! // Options used: - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_add_one_cabi(arg0: i32) -> i32 { let result0 = T::add_one(arg0); _rt::as_i32(result0) } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_add_two_cabi(arg0: i32) -> i32 { @@ -23,12 +21,10 @@ pub trait Guest { macro_rules! __export_world_add_cabi{ ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - #[export_name = "add-one"] unsafe extern "C" fn export_add_one(arg0: i32,) -> i32 { $($path_to_types)*::_export_add_one_cabi::<$ty>(arg0) } - #[export_name = "add-two"] unsafe extern "C" fn export_add_two(arg0: i32,) -> i32 { $($path_to_types)*::_export_add_two_cabi::<$ty>(arg0) @@ -139,13 +135,13 @@ macro_rules! __export_add_impl { pub(crate) use __export_add_impl as export; #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.20.0:add:encoded world"] +#[link_section = "component-type:wit-bindgen:0.21.0:add:encoded world"] #[doc(hidden)] -pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 194] = *b"\ -\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07I\x01A\x02\x01A\x03\x01\ -@\x01\x05inputz\0z\x04\0\x07add-one\x01\0\x04\0\x07add-two\x01\0\x04\x01\x1ahome\ -star-functions:add/add\x04\0\x0b\x09\x01\0\x03add\x03\0\0\0G\x09producers\x01\x0c\ -processed-by\x02\x0dwit-component\x070.201.0\x10wit-bindgen-rust\x060.20.0"; +pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 190] = *b"\ +\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07E\x01A\x02\x01A\x03\x01\ +@\x01\x05inputz\0z\x04\0\x07add-one\x01\0\x04\0\x07add-two\x01\0\x04\x01\x16home\ +star:add/add@0.1.1\x04\0\x0b\x09\x01\0\x03add\x03\0\0\0G\x09producers\x01\x0cpro\ +cessed-by\x02\x0dwit-component\x070.201.0\x10wit-bindgen-rust\x060.21.0"; #[inline(never)] #[doc(hidden)] diff --git a/homestar-functions/add/wit/world.wit b/homestar-functions/add/wit/world.wit index dd0ec5fa..f2fa8041 100644 --- a/homestar-functions/add/wit/world.wit +++ b/homestar-functions/add/wit/world.wit @@ -1,4 +1,4 @@ -package homestar-functions:add; +package homestar:add@0.1.1; world add { export add-one: func(input: s32) -> s32; diff --git a/homestar-functions/subtract/src/bindings.rs b/homestar-functions/subtract/src/bindings.rs index b75dd48a..8267c588 100644 --- a/homestar-functions/subtract/src/bindings.rs +++ b/homestar-functions/subtract/src/bindings.rs @@ -1,13 +1,11 @@ -// Generated by `wit-bindgen` 0.20.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.21.0. DO NOT EDIT! // Options used: - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_subtract_cabi(arg0: f64, arg1: f64) -> f64 { let result0 = T::subtract(arg0, arg1); _rt::as_f64(result0) } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_subtract_int_cabi(arg0: i32, arg1: i32) -> i32 { @@ -23,12 +21,10 @@ pub trait Guest { macro_rules! __export_world_subtract_cabi{ ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - #[export_name = "subtract"] unsafe extern "C" fn export_subtract(arg0: f64,arg1: f64,) -> f64 { $($path_to_types)*::_export_subtract_cabi::<$ty>(arg0, arg1) } - #[export_name = "subtract-int"] unsafe extern "C" fn export_subtract_int(arg0: i32,arg1: i32,) -> i32 { $($path_to_types)*::_export_subtract_int_cabi::<$ty>(arg0, arg1) @@ -160,14 +156,14 @@ macro_rules! __export_subtract_impl { pub(crate) use __export_subtract_impl as export; #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.20.0:subtract:encoded world"] +#[link_section = "component-type:wit-bindgen:0.21.0:subtract:encoded world"] #[doc(hidden)] -pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 225] = *b"\ -\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07c\x01A\x02\x01A\x04\x01\ +pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 221] = *b"\ +\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07_\x01A\x02\x01A\x04\x01\ @\x02\x01au\x01bu\0u\x04\0\x08subtract\x01\0\x01@\x02\x01a~\x01b~\0~\x04\0\x0csu\ -btract-int\x01\x01\x04\x01$homestar-functions:subtract/subtract\x04\0\x0b\x0e\x01\ +btract-int\x01\x01\x04\x01\x20homestar:subtract/subtract@0.1.1\x04\0\x0b\x0e\x01\ \0\x08subtract\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x07\ -0.201.0\x10wit-bindgen-rust\x060.20.0"; +0.201.0\x10wit-bindgen-rust\x060.21.0"; #[inline(never)] #[doc(hidden)] diff --git a/homestar-functions/subtract/wit/world.wit b/homestar-functions/subtract/wit/world.wit index 49b36fb9..e54ae140 100644 --- a/homestar-functions/subtract/wit/world.wit +++ b/homestar-functions/subtract/wit/world.wit @@ -1,4 +1,4 @@ -package homestar-functions:subtract; +package homestar:subtract@0.1.1; world subtract { export subtract: func(a: float64, b: float64) -> float64; diff --git a/homestar-functions/test/src/bindings.rs b/homestar-functions/test/src/bindings.rs index 1fb3308a..13714849 100644 --- a/homestar-functions/test/src/bindings.rs +++ b/homestar-functions/test/src/bindings.rs @@ -1,4 +1,4 @@ -// Generated by `wit-bindgen` 0.20.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.21.0. DO NOT EDIT! // Options used: #[derive(Clone)] pub struct NumKeys { @@ -13,14 +13,12 @@ impl ::core::fmt::Debug for NumKeys { .finish() } } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_add_one_cabi(arg0: i32) -> i32 { let result0 = T::add_one(arg0); _rt::as_i32(result0) } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_append_string_cabi(arg0: *mut u8, arg1: usize) -> *mut u8 { @@ -36,7 +34,6 @@ pub unsafe fn _export_append_string_cabi(arg0: *mut u8, arg1: usize) - *ptr2.add(0).cast::<*mut u8>() = ptr3.cast_mut(); ptr2 } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn __post_return_append_string(arg0: *mut u8) { @@ -44,7 +41,6 @@ pub unsafe fn __post_return_append_string(arg0: *mut u8) { let l1 = *arg0.add(4).cast::(); _rt::cabi_dealloc(l0, l1, 1); } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_join_strings_cabi( @@ -67,7 +63,6 @@ pub unsafe fn _export_join_strings_cabi( *ptr3.add(0).cast::<*mut u8>() = ptr4.cast_mut(); ptr3 } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn __post_return_join_strings(arg0: *mut u8) { @@ -75,7 +70,6 @@ pub unsafe fn __post_return_join_strings(arg0: *mut u8) { let l1 = *arg0.add(4).cast::(); _rt::cabi_dealloc(l0, l1, 1); } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_host_fmt_current_time_cabi() -> *mut u8 { @@ -89,7 +83,6 @@ pub unsafe fn _export_host_fmt_current_time_cabi() -> *mut u8 { *ptr1.add(0).cast::<*mut u8>() = ptr2.cast_mut(); ptr1 } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn __post_return_host_fmt_current_time(arg0: *mut u8) { @@ -97,7 +90,6 @@ pub unsafe fn __post_return_host_fmt_current_time(arg0: *mut u8) { let l1 = *arg0.add(4).cast::(); _rt::cabi_dealloc(l0, l1, 1); } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_transpose_cabi(arg0: *mut u8, arg1: usize) -> *mut u8 { @@ -147,7 +139,6 @@ pub unsafe fn _export_transpose_cabi(arg0: *mut u8, arg1: usize) -> *m *ptr5.add(0).cast::<*mut u8>() = result7; ptr5 } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn __post_return_transpose(arg0: *mut u8) { @@ -167,7 +158,6 @@ pub unsafe fn __post_return_transpose(arg0: *mut u8) { } _rt::cabi_dealloc(base5, len5 * 8, 4); } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_blur_cabi(arg0: *mut u8, arg1: usize, arg2: f32) -> *mut u8 { @@ -182,7 +172,6 @@ pub unsafe fn _export_blur_cabi(arg0: *mut u8, arg1: usize, arg2: f32) *ptr2.add(0).cast::<*mut u8>() = ptr3.cast_mut(); ptr2 } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn __post_return_blur(arg0: *mut u8) { @@ -192,7 +181,6 @@ pub unsafe fn __post_return_blur(arg0: *mut u8) { let len2 = l1; _rt::cabi_dealloc(base2, len2 * 1, 1); } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_blur_base64_cabi(arg0: *mut u8, arg1: usize, arg2: f32) -> *mut u8 { @@ -208,7 +196,6 @@ pub unsafe fn _export_blur_base64_cabi(arg0: *mut u8, arg1: usize, arg *ptr2.add(0).cast::<*mut u8>() = ptr3.cast_mut(); ptr2 } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn __post_return_blur_base64(arg0: *mut u8) { @@ -218,7 +205,6 @@ pub unsafe fn __post_return_blur_base64(arg0: *mut u8) { let len2 = l1; _rt::cabi_dealloc(base2, len2 * 1, 1); } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_crop_cabi( @@ -246,7 +232,6 @@ pub unsafe fn _export_crop_cabi( *ptr2.add(0).cast::<*mut u8>() = ptr3.cast_mut(); ptr2 } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn __post_return_crop(arg0: *mut u8) { @@ -256,7 +241,6 @@ pub unsafe fn __post_return_crop(arg0: *mut u8) { let len2 = l1; _rt::cabi_dealloc(base2, len2 * 1, 1); } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_crop_base64_cabi( @@ -285,7 +269,6 @@ pub unsafe fn _export_crop_base64_cabi( *ptr2.add(0).cast::<*mut u8>() = ptr3.cast_mut(); ptr2 } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn __post_return_crop_base64(arg0: *mut u8) { @@ -295,7 +278,6 @@ pub unsafe fn __post_return_crop_base64(arg0: *mut u8) { let len2 = l1; _rt::cabi_dealloc(base2, len2 * 1, 1); } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_grayscale_cabi(arg0: *mut u8, arg1: usize) -> *mut u8 { @@ -310,7 +292,6 @@ pub unsafe fn _export_grayscale_cabi(arg0: *mut u8, arg1: usize) -> *m *ptr2.add(0).cast::<*mut u8>() = ptr3.cast_mut(); ptr2 } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn __post_return_grayscale(arg0: *mut u8) { @@ -320,7 +301,6 @@ pub unsafe fn __post_return_grayscale(arg0: *mut u8) { let len2 = l1; _rt::cabi_dealloc(base2, len2 * 1, 1); } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_grayscale_base64_cabi(arg0: *mut u8, arg1: usize) -> *mut u8 { @@ -336,7 +316,6 @@ pub unsafe fn _export_grayscale_base64_cabi(arg0: *mut u8, arg1: usize *ptr2.add(0).cast::<*mut u8>() = ptr3.cast_mut(); ptr2 } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn __post_return_grayscale_base64(arg0: *mut u8) { @@ -346,7 +325,6 @@ pub unsafe fn __post_return_grayscale_base64(arg0: *mut u8) { let len2 = l1; _rt::cabi_dealloc(base2, len2 * 1, 1); } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_rotate90_cabi(arg0: *mut u8, arg1: usize) -> *mut u8 { @@ -361,7 +339,6 @@ pub unsafe fn _export_rotate90_cabi(arg0: *mut u8, arg1: usize) -> *mu *ptr2.add(0).cast::<*mut u8>() = ptr3.cast_mut(); ptr2 } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn __post_return_rotate90(arg0: *mut u8) { @@ -371,7 +348,6 @@ pub unsafe fn __post_return_rotate90(arg0: *mut u8) { let len2 = l1; _rt::cabi_dealloc(base2, len2 * 1, 1); } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_rotate90_base64_cabi(arg0: *mut u8, arg1: usize) -> *mut u8 { @@ -387,7 +363,6 @@ pub unsafe fn _export_rotate90_base64_cabi(arg0: *mut u8, arg1: usize) *ptr2.add(0).cast::<*mut u8>() = ptr3.cast_mut(); ptr2 } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn __post_return_rotate90_base64(arg0: *mut u8) { @@ -397,7 +372,6 @@ pub unsafe fn __post_return_rotate90_base64(arg0: *mut u8) { let len2 = l1; _rt::cabi_dealloc(base2, len2 * 1, 1); } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_hash_cabi(arg0: *mut u8, arg1: usize) -> *mut u8 { @@ -413,7 +387,6 @@ pub unsafe fn _export_hash_cabi(arg0: *mut u8, arg1: usize) -> *mut u8 *ptr2.add(0).cast::<*mut u8>() = ptr3.cast_mut(); ptr2 } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn __post_return_hash(arg0: *mut u8) { @@ -423,7 +396,6 @@ pub unsafe fn __post_return_hash(arg0: *mut u8) { let len2 = l1; _rt::cabi_dealloc(base2, len2 * 1, 1); } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_pop_cabi(arg0: *mut u8, arg1: usize) -> *mut u8 { @@ -441,7 +413,6 @@ pub unsafe fn _export_pop_cabi(arg0: *mut u8, arg1: usize) -> *mut u8 }; ptr2 } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_binary_search_cabi( @@ -463,7 +434,6 @@ pub unsafe fn _export_binary_search_cabi( }; ptr2 } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_num_to_kv_cabi(arg0: i32, arg1: *mut u8, arg2: usize) -> *mut u8 { @@ -505,7 +475,6 @@ pub unsafe fn _export_num_to_kv_cabi(arg0: i32, arg1: *mut u8, arg2: u }; ptr2 } - #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn __post_return_num_to_kv(arg0: *mut u8) { @@ -549,157 +518,126 @@ pub trait Guest { macro_rules! __export_world_test_cabi{ ($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { - #[export_name = "add-one"] unsafe extern "C" fn export_add_one(arg0: i32,) -> i32 { $($path_to_types)*::_export_add_one_cabi::<$ty>(arg0) } - #[export_name = "append-string"] unsafe extern "C" fn export_append_string(arg0: *mut u8,arg1: usize,) -> *mut u8 { $($path_to_types)*::_export_append_string_cabi::<$ty>(arg0, arg1) } - #[export_name = "cabi_post_append-string"] unsafe extern "C" fn _post_return_append_string(arg0: *mut u8,) { $($path_to_types)*::__post_return_append_string::<$ty>(arg0) } - #[export_name = "join-strings"] unsafe extern "C" fn export_join_strings(arg0: *mut u8,arg1: usize,arg2: *mut u8,arg3: usize,) -> *mut u8 { $($path_to_types)*::_export_join_strings_cabi::<$ty>(arg0, arg1, arg2, arg3) } - #[export_name = "cabi_post_join-strings"] unsafe extern "C" fn _post_return_join_strings(arg0: *mut u8,) { $($path_to_types)*::__post_return_join_strings::<$ty>(arg0) } - #[export_name = "host-fmt-current-time"] unsafe extern "C" fn export_host_fmt_current_time() -> *mut u8 { $($path_to_types)*::_export_host_fmt_current_time_cabi::<$ty>() } - #[export_name = "cabi_post_host-fmt-current-time"] unsafe extern "C" fn _post_return_host_fmt_current_time(arg0: *mut u8,) { $($path_to_types)*::__post_return_host_fmt_current_time::<$ty>(arg0) } - #[export_name = "transpose"] unsafe extern "C" fn export_transpose(arg0: *mut u8,arg1: usize,) -> *mut u8 { $($path_to_types)*::_export_transpose_cabi::<$ty>(arg0, arg1) } - #[export_name = "cabi_post_transpose"] unsafe extern "C" fn _post_return_transpose(arg0: *mut u8,) { $($path_to_types)*::__post_return_transpose::<$ty>(arg0) } - #[export_name = "blur"] unsafe extern "C" fn export_blur(arg0: *mut u8,arg1: usize,arg2: f32,) -> *mut u8 { $($path_to_types)*::_export_blur_cabi::<$ty>(arg0, arg1, arg2) } - #[export_name = "cabi_post_blur"] unsafe extern "C" fn _post_return_blur(arg0: *mut u8,) { $($path_to_types)*::__post_return_blur::<$ty>(arg0) } - #[export_name = "blur-base64"] unsafe extern "C" fn export_blur_base64(arg0: *mut u8,arg1: usize,arg2: f32,) -> *mut u8 { $($path_to_types)*::_export_blur_base64_cabi::<$ty>(arg0, arg1, arg2) } - #[export_name = "cabi_post_blur-base64"] unsafe extern "C" fn _post_return_blur_base64(arg0: *mut u8,) { $($path_to_types)*::__post_return_blur_base64::<$ty>(arg0) } - #[export_name = "crop"] unsafe extern "C" fn export_crop(arg0: *mut u8,arg1: usize,arg2: i32,arg3: i32,arg4: i32,arg5: i32,) -> *mut u8 { $($path_to_types)*::_export_crop_cabi::<$ty>(arg0, arg1, arg2, arg3, arg4, arg5) } - #[export_name = "cabi_post_crop"] unsafe extern "C" fn _post_return_crop(arg0: *mut u8,) { $($path_to_types)*::__post_return_crop::<$ty>(arg0) } - #[export_name = "crop-base64"] unsafe extern "C" fn export_crop_base64(arg0: *mut u8,arg1: usize,arg2: i32,arg3: i32,arg4: i32,arg5: i32,) -> *mut u8 { $($path_to_types)*::_export_crop_base64_cabi::<$ty>(arg0, arg1, arg2, arg3, arg4, arg5) } - #[export_name = "cabi_post_crop-base64"] unsafe extern "C" fn _post_return_crop_base64(arg0: *mut u8,) { $($path_to_types)*::__post_return_crop_base64::<$ty>(arg0) } - #[export_name = "grayscale"] unsafe extern "C" fn export_grayscale(arg0: *mut u8,arg1: usize,) -> *mut u8 { $($path_to_types)*::_export_grayscale_cabi::<$ty>(arg0, arg1) } - #[export_name = "cabi_post_grayscale"] unsafe extern "C" fn _post_return_grayscale(arg0: *mut u8,) { $($path_to_types)*::__post_return_grayscale::<$ty>(arg0) } - #[export_name = "grayscale-base64"] unsafe extern "C" fn export_grayscale_base64(arg0: *mut u8,arg1: usize,) -> *mut u8 { $($path_to_types)*::_export_grayscale_base64_cabi::<$ty>(arg0, arg1) } - #[export_name = "cabi_post_grayscale-base64"] unsafe extern "C" fn _post_return_grayscale_base64(arg0: *mut u8,) { $($path_to_types)*::__post_return_grayscale_base64::<$ty>(arg0) } - #[export_name = "rotate90"] unsafe extern "C" fn export_rotate90(arg0: *mut u8,arg1: usize,) -> *mut u8 { $($path_to_types)*::_export_rotate90_cabi::<$ty>(arg0, arg1) } - #[export_name = "cabi_post_rotate90"] unsafe extern "C" fn _post_return_rotate90(arg0: *mut u8,) { $($path_to_types)*::__post_return_rotate90::<$ty>(arg0) } - #[export_name = "rotate90-base64"] unsafe extern "C" fn export_rotate90_base64(arg0: *mut u8,arg1: usize,) -> *mut u8 { $($path_to_types)*::_export_rotate90_base64_cabi::<$ty>(arg0, arg1) } - #[export_name = "cabi_post_rotate90-base64"] unsafe extern "C" fn _post_return_rotate90_base64(arg0: *mut u8,) { $($path_to_types)*::__post_return_rotate90_base64::<$ty>(arg0) } - #[export_name = "hash"] unsafe extern "C" fn export_hash(arg0: *mut u8,arg1: usize,) -> *mut u8 { $($path_to_types)*::_export_hash_cabi::<$ty>(arg0, arg1) } - #[export_name = "cabi_post_hash"] unsafe extern "C" fn _post_return_hash(arg0: *mut u8,) { $($path_to_types)*::__post_return_hash::<$ty>(arg0) } - #[export_name = "pop"] unsafe extern "C" fn export_pop(arg0: *mut u8,arg1: usize,) -> *mut u8 { $($path_to_types)*::_export_pop_cabi::<$ty>(arg0, arg1) } - #[export_name = "binary-search"] unsafe extern "C" fn export_binary_search(arg0: *mut u8,arg1: usize,arg2: i32,) -> *mut u8 { $($path_to_types)*::_export_binary_search_cabi::<$ty>(arg0, arg1, arg2) } - #[export_name = "num-to-kv"] unsafe extern "C" fn export_num_to_kv(arg0: i32,arg1: *mut u8,arg2: usize,) -> *mut u8 { $($path_to_types)*::_export_num_to_kv_cabi::<$ty>(arg0, arg1, arg2) } - #[export_name = "cabi_post_num-to-kv"] unsafe extern "C" fn _post_return_num_to_kv(arg0: *mut u8,) { $($path_to_types)*::__post_return_num_to_kv::<$ty>(arg0) @@ -708,13 +646,11 @@ macro_rules! __export_world_test_cabi{ } #[doc(hidden)] pub(crate) use __export_world_test_cabi; - #[repr(align(4))] struct _RetArea([::core::mem::MaybeUninit; 16]); static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 16]); pub mod homestar { pub mod host { - #[allow(clippy::all)] pub mod helpers { #[used] @@ -747,7 +683,7 @@ pub mod homestar { let mut ret_area = RetArea([::core::mem::MaybeUninit::uninit(); 16]); let ptr0 = ret_area.0.as_mut_ptr().cast::(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "homestar:host/helpers@0.0.1")] + #[link(wasm_import_module = "homestar:host/helpers@0.1.1")] extern "C" { #[link_name = "get-current-time"] fn wit_import(_: *mut u8); @@ -777,7 +713,7 @@ pub mod homestar { let len0 = vec0.len(); #[cfg(target_arch = "wasm32")] - #[link(wasm_import_module = "homestar:host/helpers@0.0.1")] + #[link(wasm_import_module = "homestar:host/helpers@0.1.1")] extern "C" { #[link_name = "print"] fn wit_import(_: *mut u8, _: usize); @@ -795,7 +731,6 @@ pub mod homestar { } pub mod wasi { pub mod logging { - #[allow(clippy::all)] pub mod logging { #[used] @@ -1021,16 +956,16 @@ macro_rules! __export_test_impl { pub(crate) use __export_test_impl as export; #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.20.0:test:encoded world"] +#[link_section = "component-type:wit-bindgen:0.21.0:test:encoded world"] #[doc(hidden)] -pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 948] = *b"\ -\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xb9\x06\x01A\x02\x01\ +pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 944] = *b"\ +\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xb5\x06\x01A\x02\x01\ A-\x01B\x04\x01m\x06\x05trace\x05debug\x04info\x04warn\x05error\x08critical\x04\0\ \x05level\x03\0\0\x01@\x03\x05level\x01\x07contexts\x07messages\x01\0\x04\0\x03l\ og\x01\x02\x03\x01\x14wasi:logging/logging\x05\0\x01B\x06\x01r\x03\x07secondsw\x0c\ millisecondsy\x0bnanosecondsy\x04\0\x04time\x03\0\0\x01@\0\0\x01\x04\0\x10get-cu\ rrent-time\x01\x02\x01@\x01\x03msgs\x01\0\x04\0\x05print\x01\x03\x03\x01\x1bhome\ -star:host/helpers@0.0.1\x05\x01\x01ky\x01r\x02\x04names\x03val\x02\x03\0\x08num-\ +star:host/helpers@0.1.1\x05\x01\x01ky\x01r\x02\x04names\x03val\x02\x03\0\x08num-\ keys\x03\0\x03\x01@\x01\x01az\0z\x04\0\x07add-one\x01\x05\x01@\x01\x01as\0s\x04\0\ \x0dappend-string\x01\x06\x01@\x02\x01as\x01bs\0s\x04\0\x0cjoin-strings\x01\x07\x01\ @\0\0s\x04\0\x15host-fmt-current-time\x01\x08\x01p{\x01p\x09\x01@\x01\x06matrix\x0a\ @@ -1043,9 +978,9 @@ le\x01\x11\x01@\x01\x04datas\0\x0c\x04\0\x10grayscale-base64\x01\x12\x04\0\x08ro tate90\x01\x11\x04\0\x0frotate90-base64\x01\x12\x04\0\x04hash\x01\x12\x01pz\x01k\ z\x01@\x01\x01a\x13\0\x14\x04\0\x03pop\x01\x15\x01j\x01z\0\x01@\x02\x05slice\x13\ \x01xz\0\x16\x04\0\x0dbinary-search\x01\x17\x01j\x01y\x01s\x01@\x01\x03num\x18\0\ -\x04\x04\0\x09num-to-kv\x01\x19\x04\x01\x1chomestar-functions:test/test\x04\0\x0b\ -\x0a\x01\0\x04test\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-compon\ -ent\x070.201.0\x10wit-bindgen-rust\x060.20.0"; +\x04\x04\0\x09num-to-kv\x01\x19\x04\x01\x18homestar:test/test@0.1.1\x04\0\x0b\x0a\ +\x01\0\x04test\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x07\ +0.201.0\x10wit-bindgen-rust\x060.21.0"; #[inline(never)] #[doc(hidden)] diff --git a/homestar-functions/test/wit/deps.lock b/homestar-functions/test/wit/deps.lock index 7d8d5da2..c52c5521 100644 --- a/homestar-functions/test/wit/deps.lock +++ b/homestar-functions/test/wit/deps.lock @@ -1,7 +1,7 @@ [helpers] path = "../../../homestar-wasm/wit" -sha256 = "3ed9a4399c32bc2b92cdd5bdcc9cb1601a81dfd7aa9b31c03d8d335d9cbf93a4" -sha512 = "f7775ee4197cf1941f874a820a8a6be84d5f7c83a5532e69e22b12668e6ff03b27e70b17323ab97d3ca0d790afc97ce9eeef47d229b84de516dfd7350715399e" +sha256 = "4d9a8c79c8f0f0b7499af0ae73d2dd002c97011775bf39836955dbd460c09a55" +sha512 = "ac41234858d10646d9a4ff73461a2c2f4772510de2fd0c032cc0f45cd28cd9e49008bb77a5c79978fc4704a9c2d46fb613bdf7adfa759d8f938d35f50a275842" [logging] url = "https://github.com/WebAssembly/wasi-logging/archive/main.tar.gz" diff --git a/homestar-functions/test/wit/deps/helpers/helpers.wit b/homestar-functions/test/wit/deps/helpers/helpers.wit index 58a6fe1c..eccebf1f 100644 --- a/homestar-functions/test/wit/deps/helpers/helpers.wit +++ b/homestar-functions/test/wit/deps/helpers/helpers.wit @@ -1,4 +1,4 @@ -package homestar:host@0.0.1; +package homestar:host@0.1.1; /// Basic helpers interface. interface helpers { @@ -15,6 +15,7 @@ interface helpers { } world imports { + /// https://github.com/WebAssembly/wasi-logging import wasi:logging/logging; import helpers; } diff --git a/homestar-functions/test/wit/world.wit b/homestar-functions/test/wit/world.wit index 1a783711..445b238c 100644 --- a/homestar-functions/test/wit/world.wit +++ b/homestar-functions/test/wit/world.wit @@ -1,8 +1,8 @@ -package homestar-functions:test; +package homestar:test@0.1.1; world test { import wasi:logging/logging; - import homestar:host/helpers@0.0.1; + import homestar:host/helpers@0.1.1; record num-keys { name: string, diff --git a/homestar-invocation/src/task.rs b/homestar-invocation/src/task.rs index 61c63884..26c80dab 100644 --- a/homestar-invocation/src/task.rs +++ b/homestar-invocation/src/task.rs @@ -208,7 +208,7 @@ mod test { ( "rsc".into(), Ipld::String( - "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q".into(), + "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq".into(), ), ), ("op".into(), Ipld::String("ipld/fun".to_string())), diff --git a/homestar-invocation/src/task/instruction.rs b/homestar-invocation/src/task/instruction.rs index fe118b7f..8e7559a7 100644 --- a/homestar-invocation/src/task/instruction.rs +++ b/homestar-invocation/src/task/instruction.rs @@ -156,7 +156,7 @@ where /// use libipld::Ipld; /// use url::Url; /// -/// let wasm = "bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q".to_string(); +/// let wasm = "bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq".to_string(); /// let resource = Url::parse(format!("ipfs://{wasm}").as_str()).unwrap(); /// /// let instr = Instruction::unique( @@ -179,7 +179,7 @@ where /// use libipld::{cid::{multihash::{Code, MultihashDigest}, Cid}, Ipld, Link}; /// use url::Url; -/// let wasm = "bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q".to_string(); +/// let wasm = "bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq".to_string(); /// let resource = Url::parse(format!("ipfs://{wasm}").as_str()).expect("IPFS URL"); /// let h = Code::Blake3_256.digest(b"beep boop"); /// let cid = Cid::new_v1(0x55, h); @@ -490,7 +490,7 @@ mod test { ( RESOURCE_KEY.into(), Ipld::String( - "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q".into() + "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq".into() ) ), (OP_KEY.into(), Ipld::String("ipld/fun".to_string())), @@ -511,7 +511,7 @@ mod test { "func": "join-strings" }, "nnc": "", "op": "wasm/run", - "rsc": "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q"}); + "rsc": "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq"}); let instruction = Instruction::::try_from(ipld.clone()).unwrap(); let instr_cid = instruction.to_cid().unwrap(); diff --git a/homestar-invocation/src/test_utils/invocation.rs b/homestar-invocation/src/test_utils/invocation.rs index 0d5898ba..60a242f2 100644 --- a/homestar-invocation/src/test_utils/invocation.rs +++ b/homestar-invocation/src/test_utils/invocation.rs @@ -22,7 +22,7 @@ use std::collections::BTreeMap; use url::Url; const RAW: u64 = 0x55; -const WASM_CID: &str = "bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q"; +const WASM_CID: &str = "bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq"; type NonceBytes = Vec; diff --git a/homestar-runtime/Cargo.toml b/homestar-runtime/Cargo.toml index 1884eeeb..204e3f7a 100644 --- a/homestar-runtime/Cargo.toml +++ b/homestar-runtime/Cargo.toml @@ -52,8 +52,6 @@ console-subscriber = { version = "0.2", default-features = false, features = [ const_format = { workspace = true } crossbeam = "0.8" dagga = "0.2" -ed25519-compact = "2.1" -ed25519-dalek = { version = "2.1", features = ["pem"] } dashmap = "5.5" derive-getters = "0.3" derive_builder = "0.13" @@ -68,6 +66,8 @@ diesel-derive-enum = { version = "2.1", features = ["sqlite"] } diesel_migrations = "2.1" dotenvy = "0.15" dyn-clone = "1.0" +ed25519-compact = "2.1" +ed25519-dalek = { version = "2.1", features = ["pem"] } enum-assoc = { workspace = true } faststr = { workspace = true } flume = { version = "0.11", default-features = false, features = ["async"] } diff --git a/homestar-runtime/src/lib.rs b/homestar-runtime/src/lib.rs index 3e04a490..f23f0d6f 100644 --- a/homestar-runtime/src/lib.rs +++ b/homestar-runtime/src/lib.rs @@ -77,7 +77,7 @@ pub(crate) mod metrics; pub use event_handler::notification::{network::NetworkNotification, receipt::ReceiptNotification}; #[allow(unused_imports)] pub(crate) use event_handler::EventHandler; -pub use network::webserver::PrometheusData; +pub use network::webserver::{listener, PrometheusData}; pub use receipt::{Receipt, RECEIPT_TAG, VERSION_KEY}; pub use runner::{NodeInfo, Runner}; pub(crate) use scheduler::TaskScheduler; diff --git a/homestar-runtime/src/network/webserver.rs b/homestar-runtime/src/network/webserver.rs index 729c1bf0..d7919324 100644 --- a/homestar-runtime/src/network/webserver.rs +++ b/homestar-runtime/src/network/webserver.rs @@ -36,7 +36,7 @@ use tower_http::{ }; use tracing::{debug, error, info}; -pub(crate) mod listener; +pub mod listener; #[cfg(feature = "websocket-notify")] pub(crate) mod notifier; mod prom; diff --git a/homestar-runtime/src/network/webserver/listener.rs b/homestar-runtime/src/network/webserver/listener.rs index 200061c7..cbc7fcaf 100644 --- a/homestar-runtime/src/network/webserver/listener.rs +++ b/homestar-runtime/src/network/webserver/listener.rs @@ -14,12 +14,12 @@ use std::collections::BTreeMap; const NAME_KEY: &str = "name"; const WORKFLOW_KEY: &str = "workflow"; -/// A [Workflow] run command via a WebSocket channel. +/// A [Workflow] run command via a WebSocket channel for JSON inputs. /// /// Note: We leverage the [RawValue] type in order to use our DagJson /// implementation, which is not a direct [Deserialize] implementation. #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub(crate) struct JsonRun<'a> { +pub struct JsonRun<'a> { #[serde(default = "default_name")] pub(crate) name: FastStr, #[serde(deserialize_with = "from_raw_value")] @@ -42,8 +42,9 @@ where Workflow::from_json(raw_value.get().as_bytes()).map_err(de::Error::custom) } +/// A [Workflow] run command via a WebSocket channel for CBOR inputs. #[derive(Debug, Clone, PartialEq, Serialize)] -pub(crate) struct CborRun<'a> { +pub struct CborRun<'a> { pub(crate) name: FastStr, pub(crate) workflow: Workflow<'a, Arg>, } diff --git a/homestar-runtime/src/tasks/fetch.rs b/homestar-runtime/src/tasks/fetch.rs index c06915cb..a11b7f44 100644 --- a/homestar-runtime/src/tasks/fetch.rs +++ b/homestar-runtime/src/tasks/fetch.rs @@ -18,7 +18,7 @@ pub(crate) struct Fetch; #[cfg(any(test, feature = "test-utils"))] #[doc(hidden)] -const WASM_CID: &str = "bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q"; +const WASM_CID: &str = "bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq"; #[cfg(any(test, feature = "test-utils"))] #[doc(hidden)] const CAT_CID: &str = "bafybeiejevluvtoevgk66plh5t6xiy3ikyuuxg3vgofuvpeckb6eadresm"; diff --git a/homestar-runtime/tests/cli.rs b/homestar-runtime/tests/cli.rs index 98507319..7686c8c0 100644 --- a/homestar-runtime/tests/cli.rs +++ b/homestar-runtime/tests/cli.rs @@ -243,7 +243,7 @@ fn test_workflow_run_integration() -> Result<()> { .assert() .success() .stdout(predicate::str::contains( - "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q", + "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq", )) .stdout(predicate::str::contains("num_tasks")) .stdout(predicate::str::contains("progress_count")); @@ -257,7 +257,7 @@ fn test_workflow_run_integration() -> Result<()> { .assert() .success() .stdout(predicate::str::contains( - "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q", + "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq", )) .stdout(predicate::str::contains("num_tasks")) .stdout(predicate::str::contains("progress_count")); @@ -273,7 +273,7 @@ fn test_workflow_run_integration_nonced() -> Result<()> { let rpc_port = proc_info.rpc_port; let metrics_port = proc_info.metrics_port; let ws_port = proc_info.ws_port; - let workflow_cid = "bafyrmid4ev2l44lgbazmgg36rui3eirzp5tg5ebnaexyogdnzv4hmvvtay"; + let workflow_cid = "bafyrmibajjtwrcqrntnvp5fgkim6mbbsh6ykkdy3eijq2ycdjhlisxxx3i"; let toml = format!( r#" [node] diff --git a/homestar-runtime/tests/fixtures/test-workflow-add-one-nonced.json b/homestar-runtime/tests/fixtures/test-workflow-add-one-nonced.json index 773b08a2..bba867fb 100644 --- a/homestar-runtime/tests/fixtures/test-workflow-add-one-nonced.json +++ b/homestar-runtime/tests/fixtures/test-workflow-add-one-nonced.json @@ -15,7 +15,7 @@ }, "nnc": "1sod60ml6g26mfhsrsa0", "op": "wasm/run", - "rsc": "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q" + "rsc": "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq" } }, { @@ -31,7 +31,7 @@ "args": [ { "await/ok": { - "/": "bafyrmig5x46c6nzk74adlo6ffwo4bi7fr42jkv54zqa5kzazfirb47ninm" + "/": "bafyrmigh2n5i4iyl6mcfssv7lzx6yalwyslszngacuo3iw3mr3fgl3sopa" } } ], @@ -41,7 +41,7 @@ "/": { "bytes": "oVI8XiFiec+c2XHS" } }, "op": "wasm/run", - "rsc": "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q" + "rsc": "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq" } }, { @@ -57,7 +57,7 @@ "args": [ { "await/ok": { - "/": "bafyrmiaa2pbgwydezutitiqq6j6qd73o3gqpeycp4g6dxnx466xdxjfnvq" + "/": "bafyrmiasmpmbcnvm2mgmk772wy2mmioxmlhu7zndmphy5rw2xssuh2fwle" } } ], @@ -65,7 +65,7 @@ }, "nnc": "", "op": "wasm/run", - "rsc": "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q" + "rsc": "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq" } } ] diff --git a/homestar-runtime/tests/fixtures/test-workflow-add-one-part-one.json b/homestar-runtime/tests/fixtures/test-workflow-add-one-part-one.json index a07b0922..8785928e 100644 --- a/homestar-runtime/tests/fixtures/test-workflow-add-one-part-one.json +++ b/homestar-runtime/tests/fixtures/test-workflow-add-one-part-one.json @@ -15,7 +15,7 @@ }, "nnc": "", "op": "wasm/run", - "rsc": "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q" + "rsc": "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq" } } ] diff --git a/homestar-runtime/tests/fixtures/test-workflow-add-one-part-two.json b/homestar-runtime/tests/fixtures/test-workflow-add-one-part-two.json index 5df3b8fc..ff21e5e1 100644 --- a/homestar-runtime/tests/fixtures/test-workflow-add-one-part-two.json +++ b/homestar-runtime/tests/fixtures/test-workflow-add-one-part-two.json @@ -21,7 +21,7 @@ }, "nnc": "", "op": "wasm/run", - "rsc": "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q" + "rsc": "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq" } } ] diff --git a/homestar-runtime/tests/fixtures/test-workflow-add-one.json b/homestar-runtime/tests/fixtures/test-workflow-add-one.json index 4e68887f..4102c8c7 100644 --- a/homestar-runtime/tests/fixtures/test-workflow-add-one.json +++ b/homestar-runtime/tests/fixtures/test-workflow-add-one.json @@ -15,7 +15,7 @@ }, "nnc": "", "op": "wasm/run", - "rsc": "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q" + "rsc": "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq" } }, { @@ -31,7 +31,7 @@ "args": [ { "await/ok": { - "/": "bafyrmigpfy6vvnfmv2wpsnpjmrn6iurejcjhz2doqdl6cfext27etqvi54" + "/": "bafyrmihmxmsbt4n3g6dzmj7rho34mzfbaoqqbsfcq7etsogslqftbyj7du" } } ], @@ -39,7 +39,7 @@ }, "nnc": "", "op": "wasm/run", - "rsc": "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q" + "rsc": "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq" } } ] diff --git a/homestar-runtime/tests/fixtures/test-workflow-image-pipeline.cbor b/homestar-runtime/tests/fixtures/test-workflow-image-pipeline.cbor index 551628d2..c66e6929 100644 Binary files a/homestar-runtime/tests/fixtures/test-workflow-image-pipeline.cbor and b/homestar-runtime/tests/fixtures/test-workflow-image-pipeline.cbor differ diff --git a/homestar-runtime/tests/fixtures/test-workflow-image-pipeline.json b/homestar-runtime/tests/fixtures/test-workflow-image-pipeline.json index e32d9ef9..3c68f111 100644 --- a/homestar-runtime/tests/fixtures/test-workflow-image-pipeline.json +++ b/homestar-runtime/tests/fixtures/test-workflow-image-pipeline.json @@ -22,7 +22,7 @@ }, "nnc": "", "op": "wasm/run", - "rsc": "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q" + "rsc": "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq" } }, { @@ -37,7 +37,7 @@ "args": [ { "await/ok": { - "/": "bafyrmif6exakmqcoobygui5s6eo6i4nrp7eyy2nfibj4hty2i72gqd6zhq" + "/": "bafyrmib46dl7oaksq4fo4oyvcqewe7ojybgchufmrpjovqto3wovsq5jjq" } } ], @@ -45,7 +45,7 @@ }, "nnc": "", "op": "wasm/run", - "rsc": "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q" + "rsc": "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq" } }, { @@ -60,7 +60,7 @@ "args": [ { "await/ok": { - "/": "bafyrmihvwl55wcrqvz7p7s3tw3cnc3bbndzpl6fafckkoboadjafj5lkqe" + "/": "bafyrmiekrfvz5lglddmnkm2l2tia43tagziokpamjipleen7spxizchxbu" } } ], @@ -68,7 +68,7 @@ }, "nnc": "", "op": "wasm/run", - "rsc": "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q" + "rsc": "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq" } } ] diff --git a/homestar-runtime/tests/fixtures/test-workflow-no-awaits1.json b/homestar-runtime/tests/fixtures/test-workflow-no-awaits1.json index 6adf2448..06c2a9ec 100644 --- a/homestar-runtime/tests/fixtures/test-workflow-no-awaits1.json +++ b/homestar-runtime/tests/fixtures/test-workflow-no-awaits1.json @@ -22,7 +22,7 @@ }, "nnc": "", "op": "wasm/run", - "rsc": "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q" + "rsc": "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq" } } ] diff --git a/homestar-runtime/tests/fixtures/test-workflow-no-awaits2.json b/homestar-runtime/tests/fixtures/test-workflow-no-awaits2.json index 451ef097..e60e4618 100644 --- a/homestar-runtime/tests/fixtures/test-workflow-no-awaits2.json +++ b/homestar-runtime/tests/fixtures/test-workflow-no-awaits2.json @@ -22,7 +22,7 @@ }, "nnc": "", "op": "wasm/run", - "rsc": "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q" + "rsc": "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq" } }, { @@ -47,7 +47,7 @@ }, "nnc": "", "op": "wasm/run", - "rsc": "ipfs://bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q" + "rsc": "ipfs://bafybeibk42jwhq7w2zcpe6q3wgtleugp3ymfs3pa5gerjmnakqihhqx4zq" } } ] diff --git a/homestar-runtime/tests/network/dht.rs b/homestar-runtime/tests/network/dht.rs index 014ec4fa..5912fcf1 100644 --- a/homestar-runtime/tests/network/dht.rs +++ b/homestar-runtime/tests/network/dht.rs @@ -674,7 +674,7 @@ fn test_libp2p_dht_workflow_info_provider_integration() -> Result<()> { // DHT, so we give node one time to put add workflow info to the DHT. tokio::time::sleep(Duration::from_secs(1)).await; - let expected_workflow_cid = "bafyrmidbhanzivykbzxfichwvpvywhkthd6wycmwlaha46z3lk5v3ilo5q"; + let expected_workflow_cid = "bafyrmialnbzgwscjrq7sa3kdnw2roqdrdzp7xh2tvmo37qmgvarwrhcgre"; // Run the same workflow run on node two. // Node two should be request workflow info from diff --git a/homestar-runtime/tests/webserver.rs b/homestar-runtime/tests/webserver.rs index fc07a160..a3a81fbf 100644 --- a/homestar-runtime/tests/webserver.rs +++ b/homestar-runtime/tests/webserver.rs @@ -6,6 +6,8 @@ use crate::{ }, }; use anyhow::Result; +use homestar_invocation::ipld::{DagCbor, DagJson}; +use homestar_runtime::listener::CborRun; use jsonrpsee::{ core::client::{Subscription, SubscriptionClientT}, rpc_params, @@ -23,7 +25,7 @@ use std::{ static BIN: Lazy = Lazy::new(|| assert_cmd::cargo::cargo_bin(BIN_NAME)); const SUBSCRIBE_RUN_WORKFLOW_ENDPOINT: &str = "subscribe_run_workflow"; const UNSUBSCRIBE_RUN_WORKFLOW_ENDPOINT: &str = "unsubscribe_run_workflow"; -const AWAIT_CID: &str = "bafyrmic7gy3muoxiyepl44iwrkxxrnkl5oa77scqq3ptuigrm5faiqfgka"; +const AWAIT_CID: &str = "bafyrmiatb7idqtty56hy3hrfa6ur6qkspyrhaf6n6ynmqsntjvym47mbrq"; #[test] #[serial_test::parallel] @@ -272,7 +274,15 @@ fn test_workflow_run_integration_cbor() -> Result<()> { let ws_url = format!("ws://{}:{}", Ipv4Addr::LOCALHOST, ws_port); tokio_test::block_on(async { - let run_cbor = fs::read("tests/fixtures/test-workflow-image-pipeline.cbor").unwrap(); + let workflow_str = + fs::read_to_string("tests/fixtures/test-workflow-image-pipeline.json").unwrap(); + let json: serde_json::Value = serde_json::from_str(&workflow_str).unwrap(); + let json_string = serde_json::to_string(&json).unwrap(); + let run_str = format!(r#"{{"name": "test","workflow": {}}}"#, json_string); + let path = PathBuf::from("tests/fixtures/test-workflow-image-pipeline.cbor"); + let run: CborRun<'_> = DagJson::from_json_string(run_str).unwrap(); + run.to_cbor_file(path.display().to_string()).unwrap(); + let run_cbor = fs::read(path).unwrap(); let client = WsClientBuilder::default() .build(ws_url.clone()) .await diff --git a/homestar-wasm/README.md b/homestar-wasm/README.md index cc9e0fa5..1e5caf2e 100644 --- a/homestar-wasm/README.md +++ b/homestar-wasm/README.md @@ -505,11 +505,11 @@ interpreted as a `string` in WIT, and vice versa. ```json { - "args": ["bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q"] + "args": ["bafybeiabee2ngqpdo7nant5wtj7hejzr7bse2kb54u4zg4gktjvih5uyfu"] } ``` - `"bafybeia32q3oy6u47x624rmsmgrrlpn7ulruissmz5z2ap6alv7goe7h3q"` is converted + `"bafybeiabee2ngqpdo7nant5wtj7hejzr7bse2kb54u4zg4gktjvih5uyfu"` is converted into an `Ipld::Link`, which is then translated and passed into `fn` as a `string` argument. diff --git a/homestar-wasm/fixtures/example_add.wasm b/homestar-wasm/fixtures/example_add.wasm index 578eb58e..b0a20ef0 100755 Binary files a/homestar-wasm/fixtures/example_add.wasm and b/homestar-wasm/fixtures/example_add.wasm differ diff --git a/homestar-wasm/fixtures/example_add_cargo_component_wasi.wasm b/homestar-wasm/fixtures/example_add_cargo_component_wasi.wasm index b877f962..1cbf905e 100755 Binary files a/homestar-wasm/fixtures/example_add_cargo_component_wasi.wasm and b/homestar-wasm/fixtures/example_add_cargo_component_wasi.wasm differ diff --git a/homestar-wasm/fixtures/example_add_cargo_component_wasi.wat b/homestar-wasm/fixtures/example_add_cargo_component_wasi.wat index 76c5062a..e8737be1 100644 --- a/homestar-wasm/fixtures/example_add_cargo_component_wasi.wat +++ b/homestar-wasm/fixtures/example_add_cargo_component_wasi.wat @@ -6109,7 +6109,7 @@ (data (;0;) (i32.const 1048576) "\01\00\00\00") (@producers (processed-by "wit-component" "0.201.0") - (processed-by "wit-bindgen-rust" "0.20.0") + (processed-by "wit-bindgen-rust" "0.21.0") ) ) (core instance (;0;) (instantiate 0)) @@ -6124,6 +6124,6 @@ (export (;3;) "add-two" (func 2)) (@producers (processed-by "wit-component" "0.201.0") - (processed-by "cargo-component" "0.9.0 (wasi:ab5a448)") + (processed-by "cargo-component" "0.10.1 (wasi:ab5a448)") ) ) diff --git a/homestar-wasm/fixtures/example_add_component.wasm b/homestar-wasm/fixtures/example_add_component.wasm index c72d0231..8a15fa61 100644 Binary files a/homestar-wasm/fixtures/example_add_component.wasm and b/homestar-wasm/fixtures/example_add_component.wasm differ diff --git a/homestar-wasm/fixtures/example_add_component.wat b/homestar-wasm/fixtures/example_add_component.wat index 92376f13..738da43e 100644 --- a/homestar-wasm/fixtures/example_add_component.wat +++ b/homestar-wasm/fixtures/example_add_component.wat @@ -3785,7 +3785,7 @@ (data (;0;) (i32.const 1048576) "\01\00\00\00") (@producers (processed-by "wit-component" "0.201.0") - (processed-by "wit-bindgen-rust" "0.20.0") + (processed-by "wit-bindgen-rust" "0.21.0") ) ) (core instance (;0;) (instantiate 0)) diff --git a/homestar-wasm/fixtures/example_subtract.wasm b/homestar-wasm/fixtures/example_subtract.wasm index 7febdcf0..7e4a743c 100755 Binary files a/homestar-wasm/fixtures/example_subtract.wasm and b/homestar-wasm/fixtures/example_subtract.wasm differ diff --git a/homestar-wasm/fixtures/example_subtract_cargo_component_wasi.wasm b/homestar-wasm/fixtures/example_subtract_cargo_component_wasi.wasm index 1a766728..1e0c88ad 100755 Binary files a/homestar-wasm/fixtures/example_subtract_cargo_component_wasi.wasm and b/homestar-wasm/fixtures/example_subtract_cargo_component_wasi.wasm differ diff --git a/homestar-wasm/fixtures/example_subtract_cargo_component_wasi.wat b/homestar-wasm/fixtures/example_subtract_cargo_component_wasi.wat index b9f12ece..1ce05565 100644 --- a/homestar-wasm/fixtures/example_subtract_cargo_component_wasi.wat +++ b/homestar-wasm/fixtures/example_subtract_cargo_component_wasi.wat @@ -6113,7 +6113,7 @@ (data (;0;) (i32.const 1048576) "\01\00\00\00") (@producers (processed-by "wit-component" "0.201.0") - (processed-by "wit-bindgen-rust" "0.20.0") + (processed-by "wit-bindgen-rust" "0.21.0") ) ) (core instance (;0;) (instantiate 0)) @@ -6129,6 +6129,6 @@ (export (;3;) "subtract-int" (func 2)) (@producers (processed-by "wit-component" "0.201.0") - (processed-by "cargo-component" "0.9.0 (wasi:ab5a448)") + (processed-by "cargo-component" "0.10.1 (wasi:ab5a448)") ) ) diff --git a/homestar-wasm/fixtures/example_subtract_component.wasm b/homestar-wasm/fixtures/example_subtract_component.wasm index 442a28ec..b7789dc9 100644 Binary files a/homestar-wasm/fixtures/example_subtract_component.wasm and b/homestar-wasm/fixtures/example_subtract_component.wasm differ diff --git a/homestar-wasm/fixtures/example_subtract_component.wat b/homestar-wasm/fixtures/example_subtract_component.wat index 979dbf4a..470cdb5e 100644 --- a/homestar-wasm/fixtures/example_subtract_component.wat +++ b/homestar-wasm/fixtures/example_subtract_component.wat @@ -3787,7 +3787,7 @@ (data (;0;) (i32.const 1048576) "\01\00\00\00") (@producers (processed-by "wit-component" "0.201.0") - (processed-by "wit-bindgen-rust" "0.20.0") + (processed-by "wit-bindgen-rust" "0.21.0") ) ) (core instance (;0;) (instantiate 0)) diff --git a/homestar-wasm/fixtures/example_test.wasm b/homestar-wasm/fixtures/example_test.wasm index a8261e2a..c5bb926d 100755 Binary files a/homestar-wasm/fixtures/example_test.wasm and b/homestar-wasm/fixtures/example_test.wasm differ diff --git a/homestar-wasm/fixtures/example_test_cargo_component.wasm b/homestar-wasm/fixtures/example_test_cargo_component.wasm index ee331d15..fb1d89dd 100755 Binary files a/homestar-wasm/fixtures/example_test_cargo_component.wasm and b/homestar-wasm/fixtures/example_test_cargo_component.wasm differ diff --git a/homestar-wasm/fixtures/example_test_cargo_component_wasi.wasm b/homestar-wasm/fixtures/example_test_cargo_component_wasi.wasm index cf324651..5f671ad8 100755 Binary files a/homestar-wasm/fixtures/example_test_cargo_component_wasi.wasm and b/homestar-wasm/fixtures/example_test_cargo_component_wasi.wasm differ diff --git a/homestar-wasm/fixtures/example_test_component.wasm b/homestar-wasm/fixtures/example_test_component.wasm index 987cb4e6..bf76d870 100644 Binary files a/homestar-wasm/fixtures/example_test_component.wasm and b/homestar-wasm/fixtures/example_test_component.wasm differ diff --git a/homestar-wasm/fixtures/example_test_wasi.wasm b/homestar-wasm/fixtures/example_test_wasi.wasm index 68c5fb29..14b2bacb 100755 Binary files a/homestar-wasm/fixtures/example_test_wasi.wasm and b/homestar-wasm/fixtures/example_test_wasi.wasm differ diff --git a/homestar-wasm/fixtures/example_test_wasi_component.wasm b/homestar-wasm/fixtures/example_test_wasi_component.wasm index 65905e1c..ac855470 100644 Binary files a/homestar-wasm/fixtures/example_test_wasi_component.wasm and b/homestar-wasm/fixtures/example_test_wasi_component.wasm differ diff --git a/homestar-wasm/fixtures/host.wasm b/homestar-wasm/fixtures/host.wasm new file mode 100644 index 00000000..029ee4ab Binary files /dev/null and b/homestar-wasm/fixtures/host.wasm differ diff --git a/homestar-wasm/wit/helpers.wit b/homestar-wasm/wit/helpers.wit index 3598376d..eccebf1f 100644 --- a/homestar-wasm/wit/helpers.wit +++ b/homestar-wasm/wit/helpers.wit @@ -1,4 +1,4 @@ -package homestar:host@0.0.1; +package homestar:host@0.1.1; /// Basic helpers interface. interface helpers {