WasmEdge / wasmedge-rust-sdk

Embed WasmEdge functions in a Rust host app
Apache License 2.0
30 stars 15 forks source link

[WIP] Feat/virtual file sys #99

Closed L-jasmine closed 10 months ago

juntao commented 11 months ago

Hello, I am a code review bot on flows.network. Here are my reviews of code commits in this PR.


Overall Summary:

It is recommended to thoroughly review and address the potential problems and important findings, and to provide more context, tests, and documentation before merging the changes.

Details

Commit d6b9bda2161e238d81390d653fe63255fa0f1e38

Key changes:

Potential problems:

Commit 198fcf110435ce4c3c46a130012b68e6f4c828bc

Summary of key changes:

Potential problems:

Commit 901c15c8ec94bbf21e53a341b3f6d3854f0cb028

Key changes:

Potential problems:

Commit 971cb10fb9035ff894666b5d7089a7c167500284

Key changes in the patch include:

  1. Changes to the AsyncWasiSocketInner struct, adding the accept function as an async method that uses tokio::time::timeout for a non-blocking behavior.
  2. Changes to the AsyncWasiSocket::accept function, implementing a non-blocking behavior with a timeout using tokio::time::timeout.
  3. Changes to the AsyncWasiSocket::recv_vectored_with_flags function, adding support for non-blocking behavior using AsyncFd.
  4. Other miscellaneous changes to imports, error handling, and timeouts.

Potential problems in the patch include:

  1. It seems that the author has mixed blocking and non-blocking behavior, as some functions are made async while others aren't. This inconsistency could lead to unexpected behavior or confusion.
  2. The timeout values used in the non-blocking behaviors (e.g., the tokio::time::timeout durations) are quite low (50 milliseconds) and might not be suitable for all scenarios. It would be better to allow configuration of these values.
  3. Error handling might not be complete, as some errors are simply logged or ignored, which could lead to hidden issues or bugs.
  4. The patch could benefit from more explanatory comments to improve code readability and maintainability.

Commit 9b20217bf01c77c16c2dfaaf3f42e73de3140353

Key changes:

Potential problems:

Additional notes:

Commit 0007434386942e5af6a7c093a9d1edac35d6f96a

Key changes in the patch:

  1. In vfs/impls.rs, the code has been updated to remove the usage of if let Some(_) = ... and instead use if self.paths.remove(path).is_some().
  2. In vfs/virtual_sys.rs, a Default implementation has been added for the WasiVirtualSys struct.
  3. In vfs/virtual_sys.rs, the code to handle the OFlags has been refactored to improve readability.
  4. In vfs/virtual_sys.rs, the code to open directories and files has been updated to remove the explicit return statements and use implicit returns.
  5. In vfs/virtual_sys.rs, the code to remove directories has been updated to remove the explicit return statement and use an implicit return.
  6. In env.rs, the code to handle fd_renumber has been updated to return Err(Errno::__WASI_ERRNO_NOTSUP).

Potential problems:

Overall, it is recommended to provide more context, complete the proposed changes, and consider adding tests and documentation. Additionally, further discussion and clarification are needed regarding the fd_renumber behavior in env.rs.

Commit 70a5f07b113eba8aedbaca67b31feef8856ef56f

Key changes:

Potential problems:

  1. The patch includes a WIP (Work in Progress) tag in the title, indicating that the work is not yet complete. This should be resolved before merging the changes.
  2. The patch introduces a new CI workflow, but it's unclear if the existing workflows are still needed or should be modified. It would be helpful to provide more information or context about the purpose of this new workflow.
  3. The patch modifies the .github/workflows directory by adding a new file. It's important to ensure that this file follows the existing naming and formatting conventions used in the repository.
  4. The patch includes changes to the GitHub Actions workflow files, but it doesn't mention any impact on the rest of the codebase. It's important to ensure that these changes don't introduce any regressions or break existing functionality.
  5. The patch updates the Rust toolchain for different jobs, but doesn't provide a clear explanation for the need to use different versions of Rust. This should be clarified or documented to ensure consistent behavior across platforms.
  6. The patch includes steps to download and install dependencies, such as WasmEdge and LLVM, but it doesn't specify the exact versions or sources being used. It's important to ensure that the dependencies are obtained from trusted and reliable sources.
  7. The patch includes commands to run code formatting and linting tools (Rustfmt and Clippy), but it doesn't describe what actions should be taken if any issues are flagged. It would be helpful to define a policy or guide on handling linting errors or warnings.

These are the most important findings and potential areas for improvement in the given patch. It's recommended to address these concerns and seek further clarification or feedback from the author before merging the changes.

Commit c908e9e24d7fbb50031619862ad81b87255ef6b7

Key Changes:

Potential Problems:

Suggestions for Improvement:

Commit 621698eda7d429a5ecde74c761a1ec3c671816bf

Key changes in the patch:

Potential problems:

apepkuss commented 10 months ago

@L-jasmine Please check the failed CI workflows. It is required to guarantee that the Continuous integration is passed.