Skip to content

Dev containers: build any port in a codespace - #170

Merged
bdbarnett merged 2 commits into
mainfrom
devcontainers
Oct 22, 2026
Merged

bdbarnett merged 2 commits into
mainfrom
devcontainers

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

You can now build firmware without installing a toolchain, in a GitHub codespace or a local dev container. Each port gets its own config, so building one port doesn't pull in the others' packages.

  • .devcontainer/{unix,webassembly,rp2,windows,esp32}/devcontainer.json, one shared Dockerfile with a PORT build arg. The image runs install.sh --deps $PORT, which installs from the same package list install.sh prints for your own machine. build_mp.py still fetches each toolchain on its first build, into deps/. Each config keeps deps/ in a named volume, so rebuilding a container doesn't fetch the toolchain again.
  • esp32 fetches MicroPython, the modules and ESP-IDF with its compilers in onCreateCommand, so a Codespaces prebuild of that config does the slow part ahead of time. Its compilers go into the volume through IDF_TOOLS_PATH.
  • webassembly: scripts/serve_workbench.sh downloads the newest workbench release, swaps in your build's micropython.mjs and micropython.wasm, and serves it on port 8000. The config forwards that port and opens it in your browser.
  • The Dev containers workflow builds each config from a clean image and runs one real build in it: unix and webassembly with every module (each then runs a script that imports displaydev), rp2 RPI_PICO2, windows, and esp32 ESP32_GENERIC_S3. The webassembly job also checks that workbench serves the build it just made. It runs when a config changes, and weekly.
  • docs/newcomers.md gains "In a codespace", the README gets the Codespaces badge, and the roadmap gains "Install from a file".

@bdbarnett
bdbarnett merged commit 7179618 into main Oct 22, 2026
5 checks passed
@bdbarnett
bdbarnett deleted the devcontainers branch October 22, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant