Conversation
Summary of ChangesHello @R4ken, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new port for the WebAssembly Micro Runtime (WAMR) to the Phoenix-RTOS ecosystem. It establishes a foundational layer that allows WebAssembly modules to run on Phoenix-RTOS, complete with custom platform adaptations for file system access, threading primitives, and mathematical functions. The integration supports multiple architectures and includes configurations for resource-constrained environments, paving the way for deploying WebAssembly applications on the RTOS. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds a port for the WebAssembly Micro Runtime (WAMR) to Phoenix-RTOS, which is a significant new feature. The changes include a build script, patches to adapt WAMR to the Phoenix-RTOS environment, and example files. The patches correctly disable features not supported on Phoenix-RTOS, such as AOT/JIT and dynamic linking, and provide workarounds for missing system calls and library functions. However, the review has identified several issues, including a critical compilation error, potential memory leaks, incorrect logic in file operations, and leftover debug code. These issues should be addressed to ensure the stability and correctness of the port.
| fi | ||
|
|
||
| mkdir -p "${PRODUCT_MINI_DIR}" | ||
| (cd "${PRODUCT_MINI_DIR}" && cmake ${WAMR_FLAGS} .. && make) |
There was a problem hiding this comment.
Double quotes preserve indentation between flags which breaks passing them to cmake
|
Ported runtime seems to run well, though I have some nitpicks. Patching Also, instead of patching |
|
Actually, since we are planning on adding missing POSIX features, we can probably leave this patchset as it is. |
oI0ck
left a comment
There was a problem hiding this comment.
This pull request is a bit hacky, due to Phoenix not being fully POSIX compilant.
The patchset should probably be reworked before upstreaming in the future, however, it makes little sense to change it now, before we implement missing POSIX features.
Porting this runtime was a considerable undertaking, thank you for your work.
|
Merge after phoenix-rtos/libphoenix#433 |
adamgreloch
left a comment
There was a problem hiding this comment.
One (debatable) nit, otherwise LGTM from port.def.sh perspective
6db7bf0 to
51f87c3
Compare
5655e18 to
09b8d51
Compare
adamgreloch
left a comment
There was a problem hiding this comment.
LGTM port def-wise. I acknowledge the limitation of supports field, I hope we resolve this once the release process is dealt with.
| case "${TARGET_FAMILY}" in | ||
| arm*) | ||
| CMAKE_FLAGS="${CMAKE_FLAGS} -DWAMR_BUILD_TARGET=THUMB -DWAMR_BUILD_INVOKE_NATIVE_GENERAL=1" | ||
| if [[ "${TARGET_FAMILY}" =~ "armv7m" || "${TARGET_FAMILY}" =~ "armv7m" ]]; then |
There was a problem hiding this comment.
My bad, this used to be v7 and v8. Corrected
| - os_munmap(new_mem, new_size); | ||
| + os_munmap(new_mem, new_size); |
There was a problem hiding this comment.
Discarded this hunk from the patch
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request ports WAMR (WebAssembly Micro Runtime) to the Phoenix operating system by introducing platform-specific patches for math, file, thread, and clock APIs, alongside a port definition script. The code review highlights several critical issues, including multiple potential deadlocks due to missing mutex unlocks on error paths in the custom rwlock implementation, numerous NULL pointer dereferences from unchecked path resolutions, memory and resource leaks, uninitialized memory usage, and minor redundancies in the port script.
8d05a5a to
f92fab9
Compare
|
I fixed the more blatant memory issues and leaks. I'm not sure what is up here with the |
Add add webassembly-micro-runtime port JIRA: RTOS-1087 Co-authored-by: Michal Lach <michal.lach@phoenix-rtos.com>
Add add webassembly-micro-runtime port
JIRA: RTOS-1087
Description
Motivation and Context
Types of changes
How Has This Been Tested?
Checklist:
Special treatment