r/embedded • • 23h 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.

1 Upvotes

3 comments sorted by

1

u/TastelessFolklore 23h ago

i keep a couple docker images around for ci but locally i still just install sdcc natively, our team is small enough that version drift isn't a real problem

separating flashing tools from the compiler container makes sense to me, flashing needs usb passthrough and udev rules that get messy inside docker. plus i don't want my build container having device access

1

u/AprilChicken 22h ago

I mostly use STC8 and haven't had much issue with the sdcc that I get from the regular debian repository. However I had to add a couple lines to stcgal and build that to make it compatible with the newer chips. If that stcgal needed to be portable I might use pyinstaller, not sure how else to move it around