Skip to content

build: add a devcontainer for development - #1

Open
russoz wants to merge 2 commits into
ucode-lang:mainfrom
russoz:devcontainer
Open

russoz wants to merge 2 commits into
ucode-lang:mainfrom
russoz:devcontainer

Conversation

@russoz

@russoz russoz commented Oct 11, 2026 •

Copy link
Copy Markdown

Summary

Adds a devcontainer so the project can be developed without installing anything on the host beyond Docker and an editor, and an .editorconfig so editors follow the repo's whitespace conventions.

Everything in the Makefile already runs inside openwrt/rootfs and openwrt/sdk images via docker run -v $(CURDIR)/..., so the only host-side requirement is a Docker daemon those bind mounts resolve against. The container provides one through the docker-in-docker feature, plus make and the docs toolchain.

  • Dockerfile: Debian base with make and python3; mkdocs-material installed in /opt/mkdocs, pinned to the version used by .github/workflows/docs.yml.
  • devcontainer.json: docker-in-docker using Docker CE (moby: false, since moby packages are not published for Debian trixie); forwards port 8000 for mkdocs serve; installs the Docker and EditorConfig extensions.
  • post-create.sh: pre-pulls the test rootfs so the first make test does not stall on it. The image name is read from the Makefile's IMAGE_OPENWRT instead of being duplicated. Best effort, since the daemon may still be starting.
  • devcontainer-lock.json: pins the docker-in-docker feature by digest.
  • .editorconfig: ucode's settings as the default (tabs, width 4, UTF-8, LF, final newline, trimmed trailing whitespace), matching the .uc sources and Makefiles; shell scripts and Markdown use 4 spaces, YAML and the test/json fixtures use 2.

Notes

  • If your host git config signs commits with an SSH key file, the path is copied into the container but the key is not, so commits fail with "Couldn't load public key". Signing through a forwarded SSH agent (or a key path valid in both places) avoids this.

Testing

  • Built and opened the container; docker works through docker-in-docker.
  • Ran OpenWrt 24.10 and 25.12 rootfs containers from inside it.
  • mkdocs build --strict succeeds with the bundled toolchain.

🤖 Generated with Claude Code

@russoz

russoz commented Nov 3, 2026

Copy link
Copy Markdown
Author

friendly ping @m00qek

@m00qek

m00qek commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

Hey, sorry for taking some time to look into this. Everything already runs in containers, you just need CMake to orchestrate the dev tasks... what is it to gain with this other one?

@russoz

russoz commented Nov 14, 2026

Copy link
Copy Markdown
Author

The advantage is that people who don't work with C on a daily basis do not need to install anything in their systems to be able to help the development of this project. Like me, for example ;-)

The other advantage is that by having a devcontainer you can manage dependencies and their versions in a controlled environment. So, everyone that works on this project will be using the same versions of any tool and dependencies, potentially minimizing miscommunications like "it works [not] on mine!".

I understand the tests all run in containers, and that is not affected by this. This is about a development environment. I would recommend taking a look at https://containers.dev/ for more info.

This branch has not been deployed

No deployments
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.

2 participants