Skip to content

Update wasi-stub dependencies #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Caellian
Copy link
Contributor

Very minimal changes, just updated dependencies.

Some used structures changed a little, but the code is mostly the same.

Copy link
Contributor Author

@Caellian Caellian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

branch_hints: Box::new([]),
instr_spans: None,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only semantic difference. I'm assuming default values are ok. Didn't break downstream crate using it.

Comment on lines 140 to 147
HeapType::Func => HeapType::Func,
HeapType::Extern => HeapType::Extern,
HeapType::Any => HeapType::Any,
HeapType::Eq => HeapType::Eq,
HeapType::Struct => HeapType::Struct,
HeapType::Array => HeapType::Array,
HeapType::I31 => HeapType::I31,
HeapType::NoFunc => HeapType::NoFunc,
HeapType::NoExtern => HeapType::NoExtern,
HeapType::None => HeapType::None,
HeapType::Index(index) => {
HeapType::Index(match index {
HeapType::Concrete(index) => {
HeapType::Concrete(match index {
Index::Num(n, s) => Index::Num(n, s),
Index::Id(id) => {
Index::Id(static_id(Some(id)).unwrap())
}
})
}
HeapType::Abstract { shared, ty } => HeapType::Abstract { shared, ty },
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now simpler because most of the matches used to erase lifetime are now under HeapType::Abstract and are Copy.

@@ -115,7 +115,7 @@ pub fn stub_wasi_functions(
println!("Stubbing function {}::{}", i.module, i.field);
let typ = &types[type_index];
let ty = TypeUse::new_with_index(Index::Num(type_index as u32, typ.span));
let wast::core::TypeDef::Func(func_typ) = &typ.def else {
let wast::core::TypeDef{kind: InnerTypeKind::Func(func_typ), ..} = &typ.def else {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this is now more detailed.

@astrale-sharp
Copy link
Owner

Hi there, my programming computer is dead unfortunately so before merging i'd need a github action for automatic testing implemented, i might do it myself at some point.

@arnaudgolfouse
Copy link
Collaborator

This looks really good, thanks! Please rebase this on master, and I'll merge it.

Signed-off-by: Tin Švagelj <[email protected]>
@Caellian Caellian force-pushed the dev/update-wasi-stub-dep branch from 81f8de5 to 46c1ac5 Compare April 22, 2025 00:13
Signed-off-by: Tin Švagelj <[email protected]>
@Caellian
Copy link
Contributor Author

Please rebase this on master, and I'll merge it.

Done. Sorry for the wait. Had I known it was a 1-line change, would've done it ages ago.

Just squash the fmt commit.

@astrale-sharp
Copy link
Owner

@arnaudgolfouse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants