Skip to content

Add browser runtime, Emscripten build, and persistent submodule updates - #6

Merged
espmaniac merged 11 commits into
mainfrom
feature/browser-runtime-main
Jul 12, 2026
Merged

Add browser runtime, Emscripten build, and persistent submodule updates#6
espmaniac merged 11 commits into
mainfrom
feature/browser-runtime-main

Conversation

@espmaniac

@espmaniac espmaniac commented Jul 12, 2026

Copy link
Copy Markdown
Member

Summary

  • add an English-only os/main.c for the Emscripten browser target
  • provide browser HAL functions using emscripten_get_now()
  • expose task and runtime control functions to JavaScript
  • add root-level build-browser.sh
  • add .github/workflows/build-browser.yml
  • generate os/wasm-rtos.js and os/wasm-rtos.wasm
  • update os/wasm-rtos and nested wasm3 before every build
  • persist an updated top-level os/wasm-rtos gitlink back to the current GitHub branch after a successful push-triggered build

Submodule update

The workflow runs:

git submodule sync --recursive
git submodule update --init --remote --recursive

This updates the top-level os/wasm-rtos checkout and the nested os/wasm-rtos/wasm3 checkout before Emscripten compilation.

Persistence on GitHub

After a successful push-triggered build, the workflow stages and persists the top-level gitlink:

git add os/wasm-rtos
git commit -m "Update wasm-rtos submodule"
git push origin "HEAD:$branch"

Pull-request-triggered runs do not push. This avoids duplicate writes and prevents write failures for forked pull requests.

wasm3 is owned by the wasm-rtos repository. A newer nested checkout is used for the current build, but its gitlink can only become permanent through a commit in wasm-rtos itself. The workflow emits a warning when the nested checkout differs from the gitlink recorded by wasm-rtos.

Build architecture

The Emscripten build compiles:

  • os/main.c
  • os/wasm-rtos/os.c
  • every C source in os/wasm-rtos/wasm3/source

It does not compile os/wasm-rtos/hal.c, because os/main.c supplies the browser HAL implementation.

Outputs

The build creates and validates:

  • os/wasm-rtos.js
  • os/wasm-rtos.wasm

Both files are uploaded together as the wasm-rtos-browser workflow artifact and are not committed by the submodule persistence step.

Validation

Workflow run #11 successfully completed recursive submodule update, Emscripten installation, browser runtime compilation, output validation, and artifact upload. The persistence step is intentionally skipped on the pull-request run and executes on the corresponding push run.

Do not merge until the browser API and persistent top-level submodule update behavior are accepted.

@espmaniac espmaniac changed the title Add browser runtime entry point Add browser runtime and Emscripten build Jul 12, 2026
@espmaniac espmaniac changed the title Add browser runtime and Emscripten build Add browser runtime, Emscripten build, and persistent submodule updates Jul 12, 2026
@espmaniac
espmaniac marked this pull request as ready for review July 12, 2026 12:59
@espmaniac
espmaniac merged commit 78f94a7 into main Jul 12, 2026
1 check passed
@espmaniac
espmaniac deleted the feature/browser-runtime-main branch July 12, 2026 13:00
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.

1 participant