-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Update homestar-functions to use cargo component (#576)
# Description This PR makes the following changes: - [x] Update `homestar-functions` to use `cargo-component` - [x] Update Wasms, their CID references, and workflows that use them - [x] Update nix flake `wasmTest` and `wasmAdd` scripts - [x] Add log message when `homestar-wasm` upgrades a Wasm to a Wasm component ## Link to issue Closes #533 ## Type of change - [x] Refactor (non-breaking change that updates existing functionality) ## Test plan (required) Tests added for the new `cargo-component` generated Wasm components.
- Loading branch information
Showing
38 changed files
with
7,258 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
edition = "2021" | ||
imports_granularity = "Crate" | ||
format_generated_files = false | ||
ignore = ["homestar-functions/**/src/bindings.rs"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Generated by `wit-bindgen` 0.16.0. DO NOT EDIT! | ||
const _: () = { | ||
|
||
#[doc(hidden)] | ||
#[export_name = "add-one"] | ||
#[allow(non_snake_case)] | ||
unsafe extern "C" fn __export_add_one(arg0: i32,) -> i32 { | ||
#[allow(unused_imports)] | ||
use wit_bindgen::rt::{alloc, vec::Vec, string::String}; | ||
|
||
// Before executing any other code, use this function to run all static | ||
// constructors, if they have not yet been run. This is a hack required | ||
// to work around wasi-libc ctors calling import functions to initialize | ||
// the environment. | ||
// | ||
// This functionality will be removed once rust 1.69.0 is stable, at which | ||
// point wasi-libc will no longer have this behavior. | ||
// | ||
// See | ||
// https://github.com/bytecodealliance/preview2-prototyping/issues/99 | ||
// for more details. | ||
#[cfg(target_arch="wasm32")] | ||
wit_bindgen::rt::run_ctors_once(); | ||
|
||
let result0 = <_GuestImpl as Guest>::add_one(arg0); | ||
wit_bindgen::rt::as_i32(result0) | ||
} | ||
}; | ||
const _: () = { | ||
|
||
#[doc(hidden)] | ||
#[export_name = "add-two"] | ||
#[allow(non_snake_case)] | ||
unsafe extern "C" fn __export_add_two(arg0: i32,) -> i32 { | ||
#[allow(unused_imports)] | ||
use wit_bindgen::rt::{alloc, vec::Vec, string::String}; | ||
|
||
// Before executing any other code, use this function to run all static | ||
// constructors, if they have not yet been run. This is a hack required | ||
// to work around wasi-libc ctors calling import functions to initialize | ||
// the environment. | ||
// | ||
// This functionality will be removed once rust 1.69.0 is stable, at which | ||
// point wasi-libc will no longer have this behavior. | ||
// | ||
// See | ||
// https://github.com/bytecodealliance/preview2-prototyping/issues/99 | ||
// for more details. | ||
#[cfg(target_arch="wasm32")] | ||
wit_bindgen::rt::run_ctors_once(); | ||
|
||
let result0 = <_GuestImpl as Guest>::add_two(arg0); | ||
wit_bindgen::rt::as_i32(result0) | ||
} | ||
}; | ||
use super::Component as _GuestImpl; | ||
pub trait Guest { | ||
fn add_one(input: i32,) -> i32; | ||
fn add_two(input: i32,) -> i32; | ||
} | ||
|
||
#[cfg(target_arch = "wasm32")] | ||
#[link_section = "component-type:add"] | ||
#[doc(hidden)] | ||
pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 190] = [3, 0, 3, 97, 100, 100, 0, 97, 115, 109, 13, 0, 1, 0, 7, 73, 1, 65, 2, 1, 65, 3, 1, 64, 1, 5, 105, 110, 112, 117, 116, 122, 0, 122, 4, 0, 7, 97, 100, 100, 45, 111, 110, 101, 1, 0, 4, 0, 7, 97, 100, 100, 45, 116, 119, 111, 1, 0, 4, 1, 26, 104, 111, 109, 101, 115, 116, 97, 114, 45, 102, 117, 110, 99, 116, 105, 111, 110, 115, 58, 97, 100, 100, 47, 97, 100, 100, 4, 0, 11, 9, 1, 0, 3, 97, 100, 100, 3, 0, 0, 0, 16, 12, 112, 97, 99, 107, 97, 103, 101, 45, 100, 111, 99, 115, 0, 123, 125, 0, 70, 9, 112, 114, 111, 100, 117, 99, 101, 114, 115, 1, 12, 112, 114, 111, 99, 101, 115, 115, 101, 100, 45, 98, 121, 2, 13, 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, 101, 110, 116, 6, 48, 46, 49, 56, 46, 50, 16, 119, 105, 116, 45, 98, 105, 110, 100, 103, 101, 110, 45, 114, 117, 115, 116, 6, 48, 46, 49, 54, 46, 48]; | ||
|
||
#[inline(never)] | ||
#[doc(hidden)] | ||
#[cfg(target_arch = "wasm32")] | ||
pub fn __link_section() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.