fix: make demo container building optional via cmake option#188
Merged
casaroli merged 1 commit intoproject-ocre:mainfrom Mar 12, 2026
Merged
Conversation
Add OCRE_BUILD_DEMO_CONTAINERS option (default ON) to control whether demo_containers.cmake is included. This allows building the Ocre runtime on platforms where WASI SDK is not available (e.g. riscv64), by passing -DOCRE_BUILD_DEMO_CONTAINERS=OFF. The demo containers require the ocre-sdk submodule which uses WASI SDK to compile C to WebAssembly. WASI SDK ships pre-built binaries for x86_64 and arm64 only, so the demo build fails on other architectures. The runtime itself (ocre_mini, ocre_demo, ocre_cmd) builds and runs correctly on riscv64 without this dependency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Bruno Verachten <gounthar@gmail.com>
226ed93 to
58cec7d
Compare
casaroli
approved these changes
Mar 12, 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.
Summary
Add
OCRE_BUILD_DEMO_CONTAINERScmake option (defaultON) to control whetherdemo_containers.cmakeis included during the build. This allows building the Ocre runtime on host platforms where WASI SDK is not available.Motivation
WASI SDK ships pre-built binaries for six host platforms (x86_64 and arm64 on Linux, macOS, Windows) but not for riscv64. When building the Ocre runtime on RISC-V hardware, the demo container compilation fails because it depends on WASI SDK through the ocre-sdk submodule.
The runtime itself (
ocre_mini,ocre_demo,ocre_cmd) compiles and runs correctly on riscv64 without this dependency. I verified this on a Banana Pi F3 (SpacemiT K1, rv64gc, 16 GB RAM, Debian Trixie). All three binaries build clean and successfully run .wasm containers.Usage
Context
Blog post documenting the full RISC-V build and testing: Can WebAssembly Run on RISC-V?
Test plan
-DOCRE_BUILD_DEMO_CONTAINERS=ON) behaves identically to current main-DOCRE_BUILD_DEMO_CONTAINERS=OFFskips demo container compilationocre_mini,ocre_demo,ocre_cmd) build successfully with the option OFF