feat: add WebAssembly build target for MicroPythonOS#1
Draft
Copilot wants to merge 2 commits into
Draft
Conversation
Agent-Logs-Url: https://github.com/DrSkunk/MicroPythonOS/sessions/6ca897e0-5c83-4a0f-8119-fda95c81db2e Co-authored-by: DrSkunk <[email protected]>
Agent-Logs-Url: https://github.com/DrSkunk/MicroPythonOS/sessions/6ca897e0-5c83-4a0f-8119-fda95c81db2e Co-authored-by: DrSkunk <[email protected]>
Copilot created this pull request from a session on behalf of
DrSkunk
April 28, 2026 09:13
View session
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.
Adds infrastructure to compile and run MicroPythonOS in the browser via Emscripten. Since
lvgl_micropython/make.pyhas nowebassemblytarget, the build uses MicroPython's upstreamports/webassemblyMakefile directly (plain MicroPython + frozen Python files; LVGL canvas rendering is a follow-up once lvgl_micropython gains an Emscripten builder with-s USE_SDL=2).C modules (
c_mpos/micropython_wasm.mk)quirc(pure C, no system deps)webcam(v4l2),adc_mic/pdm_mic(ESP-IDF),rvswd(ESP32 debugger),secp256k1-embedded-ecdh(possible x86 asm — pure-Python fallback already inlib/)Python adaptation
detect_board()inmpos/main.pyreturns"webassembly"whensys.platform == "webassembly", slotted between thelinux/darwinandesp32branchesmpos/board/webassembly.py: attempts SDL2 display/pointer init insidetry/except(no-op without LVGL); skips audio, camera, and WiFi (WifiServicealready handles a missingnetworkmodule gracefully)Build script (
scripts/build_mpos.sh wasm)Sources emsdk, strips
@micropython.viper(restored after build), compilesmpy-cross, then:make -C ports/webassembly \ USER_C_MODULES=".../c_mpos/micropython_wasm.mk" \ FROZEN_MANIFEST=".../manifests/manifest.py"Stages
micropython.mjs,micropython.wasm, andhtml/index.htmlintolvgl_micropython/build/. The script documents the exactmake.pyinvocation to switch to once lvgl_micropython gains Emscripten SDL2 support.HTML shell (
html/index.html)<canvas id="lvgl">(320×240) for future LVGL SDL2 rendering via Emscripten's SDL2 portModule.print/Module.printErrmp_js_do_execviaccallCI (
.github/workflows/wasm.yml)Installs and caches emsdk, runs
build_mpos.sh wasm, uploads.mjs,.wasm, andindex.htmlas 7-day artifacts.