Add custom section sample and enable CI test#4891
Merged
lum1n0us merged 2 commits intobytecodealliance:mainfrom Mar 30, 2026
Merged
Add custom section sample and enable CI test#4891lum1n0us merged 2 commits intobytecodealliance:mainfrom
lum1n0us merged 2 commits intobytecodealliance:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new custom-section sample demonstrating embedding an external payload into a Wasm custom section and retrieving/printing it from the host via wasm_runtime_get_custom_section, and wires the sample into CI so it’s built and executed (Wasm + AoT).
Changes:
- Add a new
samples/custom-sectionsample (host app + wasm app + build/run scripts) for custom-section payload resolution via handle-based native APIs. - Add documentation entries for the new sample.
- Update multiple GitHub Actions workflows to build/run the sample in CI, including AoT builds that preserve the custom section.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
samples/custom-section/wasm-apps/custom_section_payload.s |
Defines a .custom_section.demo section and includes an external payload via .incbin. |
samples/custom-section/wasm-apps/custom_section_payload.bin |
Sample payload content to embed into the Wasm custom section. |
samples/custom-section/wasm-apps/custom_section.c |
Wasm-side demo entrypoint importing host APIs to resolve and print the custom section. |
samples/custom-section/src/native_impl.c |
Host native implementations to resolve a section name to a handle and print its bytes. |
samples/custom-section/src/main.c |
Host executable wiring runtime init, loading the Wasm module, and calling run_demo. |
samples/custom-section/run.sh |
Helper script to run the sample (Wasm or AoT). |
samples/custom-section/build.sh |
Builds the host app + Wasm module and optionally an AoT artifact preserving custom sections. |
samples/custom-section/README.md |
Sample documentation and usage instructions. |
samples/custom-section/CMakeLists.txt |
CMake project definition enabling WAMR_BUILD_LOAD_CUSTOM_SECTION. |
samples/custom-section/.gitignore |
Ignores the sample’s out/ directory. |
samples/README.md |
Adds the new sample to the samples index. |
.github/workflows/nightly_run.yml |
Builds/runs the new sample (Wasm + AoT) in nightly CI. |
.github/workflows/compilation_on_macos.yml |
Builds/runs the new sample (Wasm + AoT) in macOS CI. |
.github/workflows/compilation_on_android_ubuntu.yml |
Builds/runs the new sample (Wasm + AoT) in Android-on-Ubuntu CI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lum1n0us
approved these changes
Mar 30, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.