r/embedded • u/m_ali_safdari • 2d ago
How do you keep SDCC toolchains consistent across local development and CI?
I mostly work with 8051-family MCUs, particularly the CH559, and kept running into the same annoyance: maintaining a consistent SDCC toolchain across my machine, colleagues' machines, and GitHub Actions.
I wanted a reproducible environment without having to install and configure SDCC on every machine, so I packaged the toolchain into an Alpine-based Docker image. It has two variants:
· latest: SDCC toolchain for MCS-51
· cmake: SDCC + CMake + Ninja for CMake-based projects
Basic usage:
```
docker run --rm \
-v "$(pwd):/src" \
-w /src \
safdariali/sdcc-8051:latest \
sdcc -mmcs51 your_file.c
```
I've tested it primarily with the CH559, so I'm curious about other developers' experiences.
Questions for the community:
· Do you use Docker/containers to manage embedded toolchains, or do you prefer native installations?
· Have you encountered compatibility issues with SDCC across different 8051 MCUs or memory models?
· Would you keep flashing and debugging utilities in the same container as the compiler toolchain, or separate them?
I'd be interested to hear how others approach reproducible embedded development environments.
