Skip to content

Add custom section sample and enable CI test#4891

Merged
lum1n0us merged 2 commits intobytecodealliance:mainfrom
TianlongLiang:dev/add_custom_section_sample
Mar 30, 2026
Merged

Add custom section sample and enable CI test#4891
lum1n0us merged 2 commits intobytecodealliance:mainfrom
TianlongLiang:dev/add_custom_section_sample

Conversation

@TianlongLiang
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-section sample (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 lum1n0us merged commit d0f8ac0 into bytecodealliance:main Mar 30, 2026
827 of 832 checks passed
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