Skip to content

feat(riscv64): add RISC-V build support to devcontainers and CI#189

Closed
gounthar wants to merge 3 commits intoproject-ocre:mainfrom
gounthar:feat/add-riscv64-support
Closed

feat(riscv64): add RISC-V build support to devcontainers and CI#189
gounthar wants to merge 3 commits intoproject-ocre:mainfrom
gounthar:feat/add-riscv64-support

Conversation

@gounthar
Copy link
Copy Markdown
Contributor

Description

Add RISC-V (rv64gc) build support to the Ocre Runtime devcontainers and Zephyr CI pipeline.

WASI-SDK only ships pre-built host binaries for x86_64 and arm64. On other architectures (notably riscv64), the current mkdir && curl | tar unconditionally fails. This PR makes the WASI-SDK install conditional in both Dockerfiles and adds the riscv64 Zephyr toolchain + QEMU board to CI.

This builds on PR #188 (merged), which added the OCRE_BUILD_DEMO_CONTAINERS cmake option to skip demo container cross-compilation when WASI-SDK is absent.

Type of change

  • New feature (non-breaking change which adds functionality)
  • CI system update

How Has This Been Tested?

Three full native builds on a Banana Pi F3 board, building all three sample apps (mini, demo, supervisor) with the Linux variant. The cmake fix from #188 combined with the conditional WASI-SDK install in this PR allows a clean end-to-end build.

Blog post with full build logs and verification: https://bruno.verachten.fr/2026/02/24/WebAssembly-on-RISC-V-Banana-Pi-F3/

Test Configuration (required):

  • Host OS type, version, and arch: Debian Trixie (riscv64)
  • Developer Board make & model: Banana Pi F3 (SpacemiT K1, rv64gc, 16 GB RAM)
  • Board Tools Installed: cmake, gcc, make, git

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@gounthar gounthar requested review from kr-t and srberard as code owners March 12, 2026 10:32
Make WASI-SDK installation conditional in both linux and zephyr
Dockerfiles since pre-built binaries are only available for x86_64 and
arm64. Add riscv64-zephyr-elf toolchain to the Zephyr SDK install and
qemu_riscv64 to the Zephyr CI build matrix.

Tested on Banana Pi F3 (SpacemiT K1, rv64gc, 16 GB RAM, Debian Trixie):
all three sample apps (mini, demo, supervisor) build successfully.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Bruno Verachten <gounthar@gmail.com>
@gounthar gounthar force-pushed the feat/add-riscv64-support branch from 07b52b0 to 41672f6 Compare March 12, 2026 10:33
@kr-t kr-t requested a review from casaroli March 12, 2026 12:41
@kr-t
Copy link
Copy Markdown
Collaborator

kr-t commented Mar 12, 2026

Hi @gounthar , thanks for the PR!

It seems we have permission issues for pushing packages from forks during the PR check. We will think of the current design and how to fix these restrictions.

Copy link
Copy Markdown
Collaborator

@casaroli casaroli left a comment

Choose a reason for hiding this comment

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

Hello, thank you for you contribution.

We have plans to increase build platform support by using the ubuntu provided clang + wasi-sysroot + runtime lib. I hope this will be implemented soon, so we won't need the "binary" wasi-sdk installed.

I would prefer to do use it instead, because it will make the containers consistent across multiple platforms.

For this reason, I suggest we keep this PR as draft for now, and we rework/merge parts of it when RISCV64 support is "officially" added.

Please bear with me 😅

@gounthar
Copy link
Copy Markdown
Contributor Author

gounthar commented Mar 13, 2026

@casaroli Thanks for the context; that makes total sense. Using Ubuntu's clang + wasi-sysroot will be much cleaner across platforms.

I'll convert this to draft. Happy to help test or rework when you're ready to add riscv64 officially. In the meantime, the fork at https://github.com/gounthar/ocre-runtime works for anyone who needs it now.

@gounthar gounthar marked this pull request as draft March 13, 2026 14:10
@casaroli
Copy link
Copy Markdown
Collaborator

Please see this PR: #193
and the related PR in ocre-sdk: project-ocre/ocre-sdk#15

@casaroli
Copy link
Copy Markdown
Collaborator

this was cherry-picked into #196

@casaroli casaroli closed this Mar 23, 2026
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