-
Notifications
You must be signed in to change notification settings - Fork 16
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
Refactor/sdk preview #83
Refactor/sdk preview #83
Conversation
Signed-off-by: csh <[email protected]>
Signed-off-by: csh <[email protected]>
Signed-off-by: csh <[email protected]>
Signed-off-by: csh <[email protected]>
Signed-off-by: csh <[email protected]>
Signed-off-by: csh <[email protected]>
Signed-off-by: csh <[email protected]>
Signed-off-by: csh <[email protected]>
…un_func_async_with_timeout` (WasmEdge#76) * [Feat] run func timeout use std::time::Duration Signed-off-by: csh <[email protected]> * [Doc]: update api docs Signed-off-by: csh <[email protected]> --------- Signed-off-by: csh <[email protected]> (cherry picked from commit 07e84b7) Signed-off-by: csh <[email protected]>
Signed-off-by: csh <[email protected]>
Signed-off-by: csh <[email protected]>
Signed-off-by: Jorge Prendes <[email protected]> Signed-off-by: csh <[email protected]>
Signed-off-by: csh <[email protected]>
Signed-off-by: csh <[email protected]>
Signed-off-by: csh <[email protected]>
Signed-off-by: csh <[email protected]>
Hello, I am a code review bot on flows.network. Here are my reviews of code commits in this PR. Overall Summary: In general, the patches seem to address various issues and introduce changes to improve the codebase. However, there are several potential problems and errors that need to be addressed before merging these changes:
In summary, while the patches address certain issues and introduce improvements, further investigation and improvements are required in terms of documentation, tests, and addressing potential problems before merging these changes. DetailsCommit ecaa6cb9da0f3a25d771ce653e61350522966252Key Changes:
Potential Problems:
Commit 2116d0b7125504d8b3323365ff41cf3e85761243The key changes in this patch include:
Potential problems:
Overall, this patch seems to be a significant refactoring effort. It would be helpful to have more context and information about the motivation behind these changes in order to provide a more comprehensive review. Commit 949c9876187cfc1a7105452b1792cb06acf8a7f9Key changes in this patch include:
Potential problems:
Commit 0524f2267559f5dc6517f5329078a1fd1a51f961Key changes:
Potential problems:
Overall, the patch seems to address a specific issue, but additional information, context, and tests are needed to fully evaluate its effectiveness. Commit d7f841eda90b63b9beab06d3178bd10282f42b3dKey changes:
Potential problems:
Overall, the patch seems to be lacking in terms of documentation, tests, and justification. These aspects should be addressed before merging the changes. Commit 7408e6278d4172c303bc214adc736b8b0c270d63Key changes in the patch:
Potential problems:
Commit 882a3b2cd00003615b06105965233fd44a4dd98bKey Changes:
Potential Problems:
Commit 47a360488a27dcc65f759517938b9556c81b59adKey Changes:
Potential Problems:
Overall, more information is needed to fully understand the purpose and impact of these changes. Commit f71e855d8372776f38c758819d9642cdcba18560The key changes in this patch are:
Potential problems:
Commit 317c7a990f8fc0e781df02334b18fd23b0f91ba8Key Changes:
Potential Problems:
Commit 89ea9a2713dd3da31b18cfa9fde172e1a7f6d58eSummary of key changes:
Potential problems:
Commit 7cfb54777a586951fa4fe879dfc8639ab94abb35Key changes:
Potential problems:
Overall, it seems like the changes are related to the timeout functionality in the executor module, particularly for Linux-based operating systems. The code changes appear to be fine, but the intent and reasoning behind disabling the timeout in the musl libc environment should be clarified and reviewed. Commit bf772c0d7b52818c0736e9ecd0a9da5d0701b0c3Key changes:
Potential problems:
Overall, more context is needed to fully understand the purpose and potential implications of these changes. It would be beneficial to have more descriptive commit messages and additional comments explaining the rationale behind the modifications. Commit 2ffdbb0f96c270faf76d43e94ff2c8b3050c4c81Key Changes:
Potential Problems:
Overall, the patch seems to be a straightforward documentation update with no new code changes or potential issues. Commit 9c95c51facbca52b324ce7d973f111cef0ae4a37Key changes:
Potential problems:
Overall, the patch introduces some potential problems with memory safety and UTF-8 handling. It would be advisable to carefully review these changes and consider alternative approaches to address these issues. Commit aa2639d36340822e31aeae59d67df80d5b7b131fKey changes in the patch:
Potential problems:
Overall, the key changes in the patch are the removal of code related to test cases and function definitions. The potential problems include ensuring that the removed code is no longer needed and investigating the reason behind the Commit 4cccc4aef1ccc7277f85a0f802e764de7dbc92c2Key changes:
Potential problems:
Overall, the changes seem to be a refactor of the Commit c80ddb47118b29e53146b96f769a318bdeb6ad81Key changes in this patch:
Potential problems to consider:
Commit e475ea792ce2a95eff7f854d5f706c242c9d540bKey Changes:
Potential Problems:
Overall, the changes seem to bring new features, but they may introduce compatibility problems and require updates to existing code. It is also important to verify the impact of the memory leak fix and ensure it does not introduce any regressions. Commit a27724d24f1acb27ded3188a8b946631168642e0Key changes in this patch:
Potential problems:
Commit 18073d36d9f48bb515f14c691c1f29c6c55a0700Key changes in the patch:
Potential problems:
Overall, the changes appear to be simple modifications to tests related to the Commit c99e30df4b00a863083794454b24f1df65c7062eKey changes:
Potential problems:
Commit 6132ffe6db3098e2bc11d6e0bbb6d57ec0e5399bKey changes:
Potential problems:
Overall, the change seems simple and straightforward, but more information is needed to fully understand the reasoning behind it and ensure it does not introduce any new problems. Commit b5daacef348582c380d3a96701cff4e3ec17a433Key changes:
Potential problems:
Commit 06e7d2d1db7873fc4454149b1bd2b42504a8daf4Key changes:
Potential problems:
Overall, the pull request lacks sufficient context and explanation of the changes made. It is recommended to provide more details in the PR description to help reviewers understand the purpose and impact of the changes. Commit e914908b2fc7b1aa9452d99d6e370c28d7fe7524Key changes:
Potential problems:
Commit 6d72f15b91103ecf9abc77de8c0617c3fabd4f1aKey changes:
Potential problems:
Commit 6be2ef9107e05ff46174f27bd50d56cbf208bb18Key changes in the patch:
Potential problems:
Commit 2d27eabecfb96b840e1fde42aae30b9328139111Key changes:
Potential problems:
Overall, the key change seems to be the temporary implementation of Commit 17221d00a3a2446bd77431cc2e5ce74d0160a93dThe key changes in this Pull Request include refactoring the Based on the patch, potential problems that could be identified are:
Overall, the reviewer should request more information on the motivation, expected behavior, and testing of the changes before proceeding with a thorough review. |
7f750bb
to
aa2639d
Compare
Signed-off-by: csh <[email protected]>
…data (WasmEdge#84) * feat(rust-sys): drop host_data in `Function::drop` Signed-off-by: Xin Liu <[email protected]> * chore(rust-sys): update `drop` of `ImportModule` and `Function` Signed-off-by: Xin Liu <[email protected]> * chore(rust-sdk): update test code Signed-off-by: Xin Liu <[email protected]> * chore(rust-sys): update `drop` of `ImportModule` and `Function` Signed-off-by: Xin Liu <[email protected]> * refactor(rust-sys): update `ImportModule::drop` Signed-off-by: Xin Liu <[email protected]> * chore(rust-sys): remove debug code Signed-off-by: Xin Liu <[email protected]> * chore(rust-sdk): remove debug code Signed-off-by: Xin Liu <[email protected]> * version(rust-sdk): bump to `0.13.0` Signed-off-by: Xin Liu <[email protected]> * chore(rust-sys): supress clippy warning Signed-off-by: Xin Liu <[email protected]> * ci(ci-build): update rust version Signed-off-by: Xin Liu <[email protected]> * ci(standalone): update rust version Signed-off-by: Xin Liu <[email protected]> * chore(rust-sys): update rustdoc Signed-off-by: Xin Liu <[email protected]> * chore(rust-sdk): update rustdoc and `README` Signed-off-by: Xin Liu <[email protected]> * chore(rust-sys): update dependencies Signed-off-by: Xin Liu <[email protected]> * ci: update to `macos-13` Signed-off-by: Xin Liu <[email protected]> --------- Signed-off-by: Xin Liu <[email protected]>
Signed-off-by: Xin Liu <[email protected]>
* chore(rust-sys): update build script Signed-off-by: Xin Liu <[email protected]> * chore(rust-sys): update build script Signed-off-by: Xin Liu <[email protected]> --------- Signed-off-by: Xin Liu <[email protected]>
Signed-off-by: csh <[email protected]>
* chore(rust-sdk): update `wat` dep Signed-off-by: Xin Liu <[email protected]> * chore(rust-sdk): update test code Signed-off-by: Xin Liu <[email protected]> * chore(rust-sys): update test code Signed-off-by: Xin Liu <[email protected]> * version(rust-sys): bump to `0.17.4` Signed-off-by: Xin Liu <[email protected]> * version(rust-sdk): bump to `0.13.1` Signed-off-by: Xin Liu <[email protected]> * doc: update `CHANGELOG` Signed-off-by: Xin Liu <[email protected]> --------- Signed-off-by: Xin Liu <[email protected]>
Signed-off-by: csh <[email protected]>
Signed-off-by: Jorge Prendes <[email protected]>
* ci: update workflows Signed-off-by: Xin Liu <[email protected]> * chore(rust-sys): update versioning table Signed-off-by: Xin Liu <[email protected]> * chore(rust-sdk): update versioning table Signed-off-by: Xin Liu <[email protected]> * ci(rust-static-lib): fix typo Signed-off-by: Xin Liu <[email protected]> * ci(rust-static-lib): update workflow Signed-off-by: Xin Liu <[email protected]> * chore(rust-sys): update rustdoc Signed-off-by: Xin Liu <[email protected]> * version(rust-sdk): bump to `0.13.2` Signed-off-by: Xin Liu <[email protected]> * chore(rust-sdk): update versioning table Signed-off-by: Xin Liu <[email protected]> * ci(rust-static-lib): update workflow Signed-off-by: Xin Liu <[email protected]> --------- Signed-off-by: Xin Liu <[email protected]>
* version(rust-sys): bump to `0.17.5` Signed-off-by: Xin Liu <[email protected]> * chore(rust-sys): update versioning table Signed-off-by: Xin Liu <[email protected]> * chore(rust-sys): update dependency Signed-off-by: Xin Liu <[email protected]> * chore(rust-sdk): update versioning table Signed-off-by: Xin Liu <[email protected]> --------- Signed-off-by: Xin Liu <[email protected]>
Signed-off-by: Xin Liu <[email protected]>
@apepkuss @CaptainVincent Please review. We should aim to merge soon. Thanks. |
* ci(rust-static-lib): update workflow Signed-off-by: Xin Liu <[email protected]> * ci(rust-static-lib): update workflow Signed-off-by: Xin Liu <[email protected]> * ci(rust-static-lib): update workflow Signed-off-by: Xin Liu <[email protected]> * ci(rust-static-lib): update workflow Signed-off-by: Xin Liu <[email protected]> * ci(rust-static-lib): remove `libboost-all-dev` dep Signed-off-by: Xin Liu <[email protected]> --------- Signed-off-by: Xin Liu <[email protected]>
@L-jasmine Please consider to merge both standalone and rust-static-lib workflows into this PR. These two workflows are necessary for quality assurance. For example, both |
@DarumaDocker Does this PR satisfy your requirement of using the |
@L-jasmine Please refer to #91 and #90 to update the relevant |
/// # Safety | ||
/// | ||
/// The lifetime of the returned pointer must not exceed that of the object itself. | ||
pub unsafe fn as_ptr(&self) -> *const ffi::WasmEdge_PluginContext { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use unsafe
here as only the return value is of pointer type.
@@ -38,7 +38,7 @@ impl_wasm_val_type!(i64, ValType::I64); | |||
impl_wasm_val_type!(f32, ValType::F32); | |||
impl_wasm_val_type!(f64, ValType::F64); | |||
impl_wasm_val_type!(i128, ValType::V128); | |||
impl_wasm_val_type!(FuncRef, ValType::FuncRef); | |||
// impl_wasm_val_type!(FuncRef, ValType::FuncRef); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove it if it's not useful. Thanks.
@@ -57,19 +57,19 @@ mod test_wasm_val_type { | |||
assert_eq!(f32::WASM_TYPE, ValType::F32); | |||
assert_eq!(f64::WASM_TYPE, ValType::F64); | |||
assert_eq!(i128::WASM_TYPE, ValType::V128); | |||
assert_eq!(FuncRef::WASM_TYPE, ValType::FuncRef); | |||
// assert_eq!(FuncRef::WASM_TYPE, ValType::FuncRef); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove it if it's not useful. Thanks!
// assert_eq!( | ||
// <(i32, i64, f32, f64, FuncRef, ExternRef)>::wasm_types(), | ||
// [ | ||
// ValType::I32, | ||
// ValType::I64, | ||
// ValType::F32, | ||
// ValType::F64, | ||
// ValType::FuncRef, | ||
// ValType::ExternRef, | ||
// ] | ||
// ); | ||
// assert_eq!( | ||
// <(FuncRef, ExternRef)>::wasm_types(), | ||
// [ValType::FuncRef, ValType::ExternRef] | ||
// ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove them if they're not useful. Thanks!
// impl WasmVal for FuncRef { | ||
// fn to_wasm_value(self) -> WasmValue { | ||
// WasmValue::from_func_ref(self.inner) | ||
// } | ||
// } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove them if they're not useful. Thanks!
// Val::FuncRef(Some(func_ref)) => WasmValue::from_func_ref(func_ref.inner), | ||
// Val::FuncRef(None) => WasmValue::from_null_ref(RefType::FuncRef), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove them if they're not useful. Thanks!
src/types.rs
Outdated
if value.is_null_ref() { | ||
Val::FuncRef(None) | ||
// Val::FuncRef(None) | ||
todo!() | ||
} else { | ||
let inner = value | ||
.func_ref() | ||
.expect("[wasmedge] Failed to convert a WasmValue to a FuncRef."); | ||
let ty: FuncType = inner.ty().unwrap().into(); | ||
Val::FuncRef(Some(FuncRef { inner, ty })) | ||
// let inner = value | ||
// .func_ref() | ||
// .expect("[wasmedge] Failed to convert a WasmValue to a FuncRef."); | ||
// let ty: FuncType = inner.ty().unwrap().into(); | ||
// Val::FuncRef(Some(FuncRef { inner, ty })) | ||
todo!() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove them or implement them if the if-else is still useful. Thanks!
Signed-off-by: csh <[email protected]>
Because FuncRef typically has state, its lifecycle depends on the Module it resides in. Currently, the need to use FuncRef is mostly in the context of wasm-gc, and Rust compilation to wasm doesn't yet support the usage of FuncRef. Therefore, I've commented it out. However, since wasm-gc is nearing completion, we will need to consider how to safely export FuncRef when it's implemented. Hence, I believe there's no need to delete the current comments related to FuncRef. |
Signed-off-by: csh <[email protected]>
cb14a15
to
17221d0
Compare
Refactor the SDK to resolve memory-unsafe bugs caused by its usage.