From 16cd58a241597810fe85477ca56f262621180e45 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Wed, 26 Mar 2025 22:28:14 +0100 Subject: [PATCH 1/2] Add tiny and small build images This adds Alpine based images intended for use with make BUILD_IN_DOCKER=1 DOCKER_IMAGE=docker.io/riot/tinybuild- This adds the following images: - tinybuild-native64: C toolchain needed to build RIOT apps for `native64` - smallbuild-native64: C, C++, and rust toolchain needed to build RIOT apps for `native64` - tinybuild-arm: C toolchain needed to build RIOT apps for ARM7 & ARM Cortex M boards - smallbuild-arm: C, C++ and rust toolchain libc needed to build RIOT apps for ARM7 & ARM Cortex M boards - tinybuild-avr: C and C++ toolchain and AVR libc needed to build RIOT apps for AVR boards - tinybuild-msp430: C toolchain needed to build RIOT apps for MSP430 boards - smallbuild-msp430: C and C++ toolchain needed to build RIOT apps for MSP430 boards - tinybuild-risc-v: C toolchain needed to build RIOT apps for RISC-V boards - smallbuild-risc-v: C, C++, and rust toolchain needed to build RIOT apps for RISC-V boards Co-authored-by: crasbe --- .github/workflows/build.yml | 140 ++++++++++++++++++ README.md | 41 +++++ smallbuild-arm/Dockerfile | 20 +++ smallbuild-base/Dockerfile | 18 +++ smallbuild-msp430/Dockerfile | 10 ++ smallbuild-native64/Dockerfile | 14 ++ smallbuild-risc-v/Dockerfile | 13 ++ tinybuild-apks/Dockerfile | 35 +++++ .../0001-fix-header-install-dir.patch | 15 ++ tinybuild-apks/aports/libucontext/APKBUILD | 53 +++++++ .../src/0001-fix-header-install-dir.patch | 1 + .../libucontext/src/libucontext-1.3.2.tar.xz | 1 + tinybuild-apks/src/fixed-rustc.c | 32 ++++ tinybuild-arm/Dockerfile | 11 ++ tinybuild-avr/Dockerfile | 10 ++ tinybuild-base/Dockerfile | 15 ++ tinybuild-msp430/Dockerfile | 10 ++ tinybuild-native64/Dockerfile | 13 ++ tinybuild-risc-v/Dockerfile | 11 ++ 19 files changed, 463 insertions(+) create mode 100644 smallbuild-arm/Dockerfile create mode 100644 smallbuild-base/Dockerfile create mode 100644 smallbuild-msp430/Dockerfile create mode 100644 smallbuild-native64/Dockerfile create mode 100644 smallbuild-risc-v/Dockerfile create mode 100644 tinybuild-apks/Dockerfile create mode 100644 tinybuild-apks/aports/libucontext/0001-fix-header-install-dir.patch create mode 100644 tinybuild-apks/aports/libucontext/APKBUILD create mode 120000 tinybuild-apks/aports/libucontext/src/0001-fix-header-install-dir.patch create mode 120000 tinybuild-apks/aports/libucontext/src/libucontext-1.3.2.tar.xz create mode 100644 tinybuild-apks/src/fixed-rustc.c create mode 100644 tinybuild-arm/Dockerfile create mode 100644 tinybuild-avr/Dockerfile create mode 100644 tinybuild-base/Dockerfile create mode 100644 tinybuild-msp430/Dockerfile create mode 100644 tinybuild-native64/Dockerfile create mode 100644 tinybuild-risc-v/Dockerfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a5aee154..165f7119 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,6 +52,124 @@ jobs: with: driver: docker + - name: Build tinybuild-apks + uses: docker/build-push-action@v2 + with: + context: ./tinybuild-apks + tags: | + tinybuild-apks:latest + tinybuild-apks:${{ env.VERSION_TAG }} + + - name: Build tinybuild-base + uses: docker/build-push-action@v2 + with: + context: ./tinybuild-base + tags: | + ${{ env.DOCKER_REGISTRY }}/tinybuild-base:latest + ${{ env.DOCKER_REGISTRY }}/tinybuild-base:${{ env.VERSION_TAG }} + build-args: | + DOCKER_REGISTRY=${{ env.DOCKER_REGISTRY }} + + - name: Build smallbuild-base + uses: docker/build-push-action@v2 + with: + context: ./smallbuild-base + tags: | + ${{ env.DOCKER_REGISTRY }}/smallbuild-base:latest + ${{ env.DOCKER_REGISTRY }}/smallbuild-base:${{ env.VERSION_TAG }} + build-args: | + DOCKER_REGISTRY=${{ env.DOCKER_REGISTRY }} + + - name: Build tinybuild-arm + uses: docker/build-push-action@v2 + with: + context: ./tinybuild-arm + tags: | + ${{ env.DOCKER_REGISTRY }}/tinybuild-arm:latest + ${{ env.DOCKER_REGISTRY }}/tinybuild-arm:${{ env.VERSION_TAG }} + build-args: | + DOCKER_REGISTRY=${{ env.DOCKER_REGISTRY }} + + - name: Build smallbuild-arm + uses: docker/build-push-action@v2 + with: + context: ./smallbuild-arm + tags: | + ${{ env.DOCKER_REGISTRY }}/smallbuild-arm:latest + ${{ env.DOCKER_REGISTRY }}/smallbuild-arm:${{ env.VERSION_TAG }} + build-args: | + DOCKER_REGISTRY=${{ env.DOCKER_REGISTRY }} + + - name: Build tinybuild-avr + uses: docker/build-push-action@v2 + with: + context: ./tinybuild-avr + tags: | + ${{ env.DOCKER_REGISTRY }}/tinybuild-avr:latest + ${{ env.DOCKER_REGISTRY }}/tinybuild-avr:${{ env.VERSION_TAG }} + build-args: | + DOCKER_REGISTRY=${{ env.DOCKER_REGISTRY }} + + - name: Build tinybuild-msp430 + uses: docker/build-push-action@v2 + with: + context: ./tinybuild-msp430 + tags: | + ${{ env.DOCKER_REGISTRY }}/tinybuild-msp430:latest + ${{ env.DOCKER_REGISTRY }}/tinybuild-msp430:${{ env.VERSION_TAG }} + build-args: | + DOCKER_REGISTRY=${{ env.DOCKER_REGISTRY }} + + - name: Build smallbuild-msp430 + uses: docker/build-push-action@v2 + with: + context: ./smallbuild-msp430 + tags: | + ${{ env.DOCKER_REGISTRY }}/smallbuild-msp430:latest + ${{ env.DOCKER_REGISTRY }}/smallbuild-msp430:${{ env.VERSION_TAG }} + build-args: | + DOCKER_REGISTRY=${{ env.DOCKER_REGISTRY }} + + - name: Build tinybuild-native64 + uses: docker/build-push-action@v2 + with: + context: ./tinybuild-native64 + tags: | + ${{ env.DOCKER_REGISTRY }}/tinybuild-native64:latest + ${{ env.DOCKER_REGISTRY }}/tinybuild-native64:${{ env.VERSION_TAG }} + build-args: | + DOCKER_REGISTRY=${{ env.DOCKER_REGISTRY }} + + - name: Build smallbuild-native64 + uses: docker/build-push-action@v2 + with: + context: ./smallbuild-native64 + tags: | + ${{ env.DOCKER_REGISTRY }}/smallbuild-native64:latest + ${{ env.DOCKER_REGISTRY }}/smallbuild-native64:${{ env.VERSION_TAG }} + build-args: | + DOCKER_REGISTRY=${{ env.DOCKER_REGISTRY }} + + - name: Build tinybuild-risc-v + uses: docker/build-push-action@v2 + with: + context: ./tinybuild-risc-v + tags: | + ${{ env.DOCKER_REGISTRY }}/tinybuild-risc-v:latest + ${{ env.DOCKER_REGISTRY }}/tinybuild-risc-v:${{ env.VERSION_TAG }} + build-args: | + DOCKER_REGISTRY=${{ env.DOCKER_REGISTRY }} + + - name: Build smallbuild-risc-v + uses: docker/build-push-action@v2 + with: + context: ./smallbuild-risc-v + tags: | + ${{ env.DOCKER_REGISTRY }}/smallbuild-risc-v:latest + ${{ env.DOCKER_REGISTRY }}/smallbuild-risc-v:${{ env.VERSION_TAG }} + build-args: | + DOCKER_REGISTRY=${{ env.DOCKER_REGISTRY }} + - name: Build riotdocker-base uses: docker/build-push-action@v2 with: @@ -190,6 +308,28 @@ jobs: - name: Push Images if: "${{ github.ref == 'refs/heads/master' }}" run: | + docker image push ${{ env.DOCKER_REGISTRY }}/tinybuild-base:latest + docker image push ${{ env.DOCKER_REGISTRY }}/tinybuild-base:${{ env.VERSION_TAG }} + docker image push ${{ env.DOCKER_REGISTRY }}/smallbuild-base:latest + docker image push ${{ env.DOCKER_REGISTRY }}/smallbuild-base:${{ env.VERSION_TAG }} + docker image push ${{ env.DOCKER_REGISTRY }}/tinybuild-arm:latest + docker image push ${{ env.DOCKER_REGISTRY }}/tinybuild-arm:${{ env.VERSION_TAG }} + docker image push ${{ env.DOCKER_REGISTRY }}/smallbuild-arm:latest + docker image push ${{ env.DOCKER_REGISTRY }}/smallbuild-arm:${{ env.VERSION_TAG }} + docker image push ${{ env.DOCKER_REGISTRY }}/tinybuild-avr:latest + docker image push ${{ env.DOCKER_REGISTRY }}/tinybuild-avr:${{ env.VERSION_TAG }} + docker image push ${{ env.DOCKER_REGISTRY }}/tinybuild-msp430:latest + docker image push ${{ env.DOCKER_REGISTRY }}/tinybuild-msp430:${{ env.VERSION_TAG }} + docker image push ${{ env.DOCKER_REGISTRY }}/smallbuild-msp430:latest + docker image push ${{ env.DOCKER_REGISTRY }}/smallbuild-msp430:${{ env.VERSION_TAG }} + docker image push ${{ env.DOCKER_REGISTRY }}/tinybuild-native64:latest + docker image push ${{ env.DOCKER_REGISTRY }}/tinybuild-native64:${{ env.VERSION_TAG }} + docker image push ${{ env.DOCKER_REGISTRY }}/smallbuild-native64:latest + docker image push ${{ env.DOCKER_REGISTRY }}/smallbuild-native64:${{ env.VERSION_TAG }} + docker image push ${{ env.DOCKER_REGISTRY }}/tinybuild-risc-v:latest + docker image push ${{ env.DOCKER_REGISTRY }}/tinybuild-risc-v:${{ env.VERSION_TAG }} + docker image push ${{ env.DOCKER_REGISTRY }}/smallbuild-risc-v:latest + docker image push ${{ env.DOCKER_REGISTRY }}/smallbuild-risc-v:${{ env.VERSION_TAG }} docker image push ${{ env.DOCKER_REGISTRY }}/riotdocker-base:latest docker image push ${{ env.DOCKER_REGISTRY }}/riotdocker-base:${{ env.VERSION_TAG }} docker image push ${{ env.DOCKER_REGISTRY }}/static-test-tools:latest diff --git a/README.md b/README.md index 55906642..35744039 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,43 @@ # riotbuild + Dockerfiles for creating build environment for building RIOT projects. + +# `tinybuild-*`` and `smallbuild-*`` Containers + +Compared to the full fledges `riotbuild` container, the `smallbuild-*` +containers only a single architecture. The `tinybuild-*` are trimmed down +even more by only supporting C code by dropping the C++ and rust toolchains. +(Except for AVR, which always provides C++ support.) + +## Platform Support + +| Image | Size | `native32` | `native64` | ARM7 Boards | Cortex M Boards | RISC-V Boards | AVR8 Boards | MSP430 Boards | ESP* Xtensa Boards | ESP* RISC-V Boards | +| --------------------- | --------- | ---------- | ---------- | ----------- | --------------- | ------------- | ----------- | ------------- | ------------------ | ------------------ | +| `riotbuild` | ~ 13.5 GB | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | +| `smallbuild-arm` | ~ 4.3 GB | | | ✔ | ✔ | | | | | | +| `smallbuild-msp430` | ~ 0.5 GB | | | | | | | ✔ | | | +| `smallbuild-native64` | ~ 2.4 GB | | ✔ | | | | | | | | +| `smallbuild-risc-v` | ~ 3.3 GB | | | | | ✔ | | | | | +| `tinybuild-arm` | ~ 1.2 GB | | | ✔ | ✔ | | | | | | +| `tinybuild-avr` | ~ 0.4 GB | | | | | | ✔ | | | | +| `tinybuild-msp430` | ~ 0.4 GB | | | | | | | ✔ | | | +| `tinybuild-native64` | ~ 0.3 GB | | ✔ | | | | | | | | +| `tinybuild-risc-v` | ~ 1.1 GB | | | | | ✔ | | | | | + +## Language Support + +| Image | Size | C | C++ | rust | +| --------------------- | --------- | --- | ----- | ----- | +| `riotbuild` | ~ 13.5 GB | ✔ | ✔ [1] | ✔ [2] | +| `smallbuild-arm` | ~ 4.3 GB | ✔ | ✔ | ✔ | +| `smallbuild-msp430` | ~ 0.5 GB | ✔ | ✔ | | +| `smallbuild-native64` | ~ 2.4 GB | ✔ | ✔ | ✔ | +| `smallbuild-risc-v` | ~ 3.3 GB | ✔ | ✔ | ✔ | +| `tinybuild-arm` | ~ 1.2 GB | ✔ | | | +| `tinybuild-avr` | ~ 0.4 GB | ✔ | ✔ [1] | | +| `tinybuild-msp430` | ~ 0.4 GB | ✔ | | | +| `tinybuild-native64` | ~ 0.3 GB | ✔ | | | +| `tinybuild-risc-v` | ~ 1.1 GB | ✔ | | | + +1. On AVR, C++ is supported but libstdc++ is not +2. rust is not provided for some architectures diff --git a/smallbuild-arm/Dockerfile b/smallbuild-arm/Dockerfile new file mode 100644 index 00000000..0738f7ce --- /dev/null +++ b/smallbuild-arm/Dockerfile @@ -0,0 +1,20 @@ +ARG DOCKER_REGISTRY="docker.io/riot" +FROM ${DOCKER_REGISTRY}/smallbuild-base:latest + +LABEL maintainer="Marian Buschsieweke " + +RUN \ + --mount=type=cache,id=apk-cache,sharing=locked,target=/var/cache/apk \ + --mount=type=bind,target=/tinybuild-apks,source=/output,from=tinybuild-apks \ + apk add \ + newlib-arm-none-eabi \ + picolibc-arm-none-eabi \ + g++-arm-none-eabi && \ + CARGO_HOME=/opt/rustup/.cargo sh -c "\ + rustup target add thumbv7em-none-eabihf && \ + rustup target add thumbv7em-none-eabi && \ + rustup target add thumbv7m-none-eabi && \ + rustup target add thumbv6m-none-eabi && \ + rustup target add thumbv8m.main-none-eabihf && \ + rustup target add thumbv8m.main-none-eabi && \ + rustup target add thumbv8m.base-none-eabi" diff --git a/smallbuild-base/Dockerfile b/smallbuild-base/Dockerfile new file mode 100644 index 00000000..2b0c62b7 --- /dev/null +++ b/smallbuild-base/Dockerfile @@ -0,0 +1,18 @@ +ARG DOCKER_REGISTRY="docker.io/riot" +FROM ${DOCKER_REGISTRY}/tinybuild-base:latest +LABEL maintainer="Marian Buschsieweke " + +ENV \ + RUSTUP_HOME=/opt/rustup/.rustup \ + PATH=${PATH}:/opt/rustup/.cargo/bin + +RUN \ + --mount=type=cache,id=apk-cache,sharing=locked,target=/var/cache/apk \ + --mount=type=bind,target=/tinybuild-apks,source=/output,from=tinybuild-apks \ + apk add \ + rustup \ + musl-dev \ + clang-libclang \ + c2rust && \ + CARGO_HOME=/opt/rustup/.cargo rustup-init -y && \ + cp /tinybuild-apks/rustc /opt/rustup/.cargo/bin diff --git a/smallbuild-msp430/Dockerfile b/smallbuild-msp430/Dockerfile new file mode 100644 index 00000000..c1e3148a --- /dev/null +++ b/smallbuild-msp430/Dockerfile @@ -0,0 +1,10 @@ +ARG DOCKER_REGISTRY="docker.io/riot" +FROM ${DOCKER_REGISTRY}/tinybuild-msp430:latest + +LABEL maintainer="Marian Buschsieweke " + +RUN \ + --mount=type=cache,id=apk-cache,sharing=locked,target=/var/cache/apk \ + --mount=type=bind,target=/tinybuild-apks,source=/output,from=tinybuild-apks \ + apk add \ + g++-msp430-elf diff --git a/smallbuild-native64/Dockerfile b/smallbuild-native64/Dockerfile new file mode 100644 index 00000000..00bf2907 --- /dev/null +++ b/smallbuild-native64/Dockerfile @@ -0,0 +1,14 @@ +ARG DOCKER_REGISTRY="docker.io/riot" +FROM ${DOCKER_REGISTRY}/smallbuild-base:latest + +LABEL maintainer="Marian Buschsieweke " + +RUN \ + --mount=type=cache,id=apk-cache,sharing=locked,target=/var/cache/apk \ + --mount=type=bind,target=/tinybuild-apks,source=/output,from=tinybuild-apks \ + apk add \ + libucontext-dev@riotapks \ + gcc \ + musl-dev \ + linux-headers && \ + CARGO_HOME=/opt/rustup/.cargo rustup target add x86_64-unknown-linux-gnu diff --git a/smallbuild-risc-v/Dockerfile b/smallbuild-risc-v/Dockerfile new file mode 100644 index 00000000..2dea12f5 --- /dev/null +++ b/smallbuild-risc-v/Dockerfile @@ -0,0 +1,13 @@ +ARG DOCKER_REGISTRY="docker.io/riot" +FROM ${DOCKER_REGISTRY}/smallbuild-base:latest + +LABEL maintainer="Marian Buschsieweke " + +RUN \ + --mount=type=cache,id=apk-cache,sharing=locked,target=/var/cache/apk \ + --mount=type=bind,target=/tinybuild-apks,source=/output,from=tinybuild-apks \ + apk add \ + newlib-riscv-none-elf \ + picolibc-riscv-none-elf \ + g++-riscv-none-elf && \ + CARGO_HOME=/opt/rustup/.cargo rustup target add riscv32imac-unknown-none-elf diff --git a/tinybuild-apks/Dockerfile b/tinybuild-apks/Dockerfile new file mode 100644 index 00000000..90a4f8ac --- /dev/null +++ b/tinybuild-apks/Dockerfile @@ -0,0 +1,35 @@ +# This docker is not intended to be run, it is rather an intermediate step +# to create custom packages for consumption by other docker containers +FROM alpine:latest +LABEL maintainer="Marian Buschsieweke " + +# install all package needed for building apks +RUN \ + --mount=type=cache,id=apk-cache,sharing=locked,target=/var/cache/apk \ + apk add \ + alpine-sdk \ + doas \ + findutils \ + lua-aports + +# setup a user and create keys needed to sign apks +RUN \ + adduser -D builder && \ + adduser builder abuild && \ + echo "permit nopass builder as root" > /etc/doas.conf && \ + su builder -c 'abuild-keygen -ian' && \ + mkdir /output && \ + chmod 777 /output -R && \ + su builder -c 'cp ~/.abuild/*.rsa.pub /output/' + +# create an output directory and build all packages from the aports folder +RUN \ + --mount=type=cache,id=apk-cache,sharing=locked,target=/var/cache/apk \ + --mount=type=bind,target=/var/aports,source=aports \ + su builder -c 'mkdir -p ~/aports && cp /var/aports ~/aports/riotapks -r' && \ + su builder -c 'buildrepo -d /output riotapks' + +# built custom binaries that are not packaged +RUN \ + --mount=type=bind,target=/var/src,source=src \ + gcc -Os -Wall -Werror -Wpedantic -o /output/rustc /var/src/fixed-rustc.c diff --git a/tinybuild-apks/aports/libucontext/0001-fix-header-install-dir.patch b/tinybuild-apks/aports/libucontext/0001-fix-header-install-dir.patch new file mode 100644 index 00000000..c469f959 --- /dev/null +++ b/tinybuild-apks/aports/libucontext/0001-fix-header-install-dir.patch @@ -0,0 +1,15 @@ +Drop the paths from LIBUCONTEXT_HEADERS when installing, so that `libucontext.h` +will find `bits.h`. +--- a/Makefile 2024-10-07 03:37:08.000000000 +0200 ++++ b/Makefile 2025-03-21 21:16:16.761054357 +0100 +@@ -215,8 +215,8 @@ install: all + install -D -m664 ${LIBUCONTEXT_STATIC_NAME} ${DESTDIR}${LIBUCONTEXT_STATIC_PATH} + ln -sf ${LIBUCONTEXT_SONAME} ${DESTDIR}${shared_libdir}/${LIBUCONTEXT_NAME} + for i in ${LIBUCONTEXT_HEADERS}; do \ +- destfn=$$(echo $$i | sed s:include/::g); \ +- install -D -m644 $$i ${DESTDIR}${includedir}/$$destfn; \ ++ destfn=$$(basename $$i); \ ++ install -D -m644 $$i ${DESTDIR}${includedir}/$(basename $(LIBUCONTEXT_NAME))/$$destfn; \ + done + install -D -m644 ${LIBUCONTEXT_PC} ${DESTDIR}${pkgconfigdir}/${LIBUCONTEXT_PC} + if [ -n "${LIBUCONTEXT_POSIX_NAME}" ]; then \ diff --git a/tinybuild-apks/aports/libucontext/APKBUILD b/tinybuild-apks/aports/libucontext/APKBUILD new file mode 100644 index 00000000..67916ea4 --- /dev/null +++ b/tinybuild-apks/aports/libucontext/APKBUILD @@ -0,0 +1,53 @@ +# Maintainer: Ariadne Conill +pkgname=libucontext +pkgver=1.3.2 +pkgrel=1 +pkgdesc="ucontext function implementations" +url="https://github.com/kaniini/libucontext" +arch="all" +license="ISC" +subpackages="$pkgname-dev" +if [ "$BOOTSTRAP" != "nobase" ]; then + subpackages="$subpackages $pkgname-doc" + makedepends="scdoc" +fi +source=" + https://distfiles.ariadne.space/libucontext/libucontext-$pkgver.tar.xz + + 0001-fix-header-install-dir.patch + " + +case "$CTARGET_ARCH" in + arm*) LIBUCONTEXT_ARCH="arm" ;; + ppc64le) LIBUCONTEXT_ARCH="ppc64" ;; + *) LIBUCONTEXT_ARCH="$CTARGET_ARCH" ;; +esac + +build() { + make ARCH="$LIBUCONTEXT_ARCH" + if [ "$BOOTSTRAP" != "nobase" ]; then + make ARCH="$LIBUCONTEXT_ARCH" docs + fi +} + +check() { + make ARCH="$LIBUCONTEXT_ARCH" check +} + +package() { + case "$BOOTSTRAP" in + nobase) + # omit pkgconfig files during bootstrap to + # avoid auto-tracing a dependency on that + make ARCH="$LIBUCONTEXT_ARCH" DESTDIR="$pkgdir" pkgconfigdir=/.omit install + ;; + *) + make ARCH="$LIBUCONTEXT_ARCH" DESTDIR="$pkgdir" install install_docs + ;; + esac +} + +sha512sums=" +3911a9a772832dad68dc4dbb78ca646cba92170d4e192948e0a6e78295f6ee27f20b637986d39450edae805c96b08f7e1716fa7904fc84258acab8691d87c4f5 libucontext-1.3.2.tar.xz +55e2b4f58835bf9305e23623cc77e8a0af752a70920f5922466702dc80abb9d545cbc541c1fcd9dc0f9a4d5bcfc1566d6e46ecc92d79c580fde8c3cdb41d0cad 0001-fix-header-install-dir.patch +" diff --git a/tinybuild-apks/aports/libucontext/src/0001-fix-header-install-dir.patch b/tinybuild-apks/aports/libucontext/src/0001-fix-header-install-dir.patch new file mode 120000 index 00000000..84b4d2b1 --- /dev/null +++ b/tinybuild-apks/aports/libucontext/src/0001-fix-header-install-dir.patch @@ -0,0 +1 @@ +/home/maribu/Repos/software/aports/master/main/libucontext/0001-fix-header-install-dir.patch \ No newline at end of file diff --git a/tinybuild-apks/aports/libucontext/src/libucontext-1.3.2.tar.xz b/tinybuild-apks/aports/libucontext/src/libucontext-1.3.2.tar.xz new file mode 120000 index 00000000..8397939c --- /dev/null +++ b/tinybuild-apks/aports/libucontext/src/libucontext-1.3.2.tar.xz @@ -0,0 +1 @@ +/var/cache/distfiles/libucontext-1.3.2.tar.xz \ No newline at end of file diff --git a/tinybuild-apks/src/fixed-rustc.c b/tinybuild-apks/src/fixed-rustc.c new file mode 100644 index 00000000..4feb26a3 --- /dev/null +++ b/tinybuild-apks/src/fixed-rustc.c @@ -0,0 +1,32 @@ +/* + * SPDX-License-Identifier: 0BSD + */ + +#include +#include +#include + +int main(int argc, char **argv) +{ + static char *rustc = "rustc"; + static char *fix_linking = "-Ctarget-feature=-crt-static"; + char **args = calloc(sizeof(char *), argc + 1); + if (!args) { + puts("calloc() failed"); + return EXIT_FAILURE; + } + + args[0] = rustc; + args[1] = fix_linking; + + + int pos = 1; + while (argv[pos] != NULL) { + args[pos + 1] = argv[pos]; + pos++; + } + + int retval = execv("/usr/bin/rustup-init", args); + printf("execv() failed with: %d\n", retval); + return EXIT_FAILURE; +} diff --git a/tinybuild-arm/Dockerfile b/tinybuild-arm/Dockerfile new file mode 100644 index 00000000..b09d2d64 --- /dev/null +++ b/tinybuild-arm/Dockerfile @@ -0,0 +1,11 @@ +ARG DOCKER_REGISTRY="docker.io/riot" +FROM ${DOCKER_REGISTRY}/tinybuild-base:latest + +LABEL maintainer="Marian Buschsieweke " + +RUN \ + --mount=type=cache,id=apk-cache,sharing=locked,target=/var/cache/apk \ + --mount=type=bind,target=/tinybuild-apks,source=/output,from=tinybuild-apks \ + apk add \ + newlib-arm-none-eabi \ + picolibc-arm-none-eabi diff --git a/tinybuild-avr/Dockerfile b/tinybuild-avr/Dockerfile new file mode 100644 index 00000000..1a8f2ed3 --- /dev/null +++ b/tinybuild-avr/Dockerfile @@ -0,0 +1,10 @@ +ARG DOCKER_REGISTRY="docker.io/riot" +FROM ${DOCKER_REGISTRY}/tinybuild-base:latest + +LABEL maintainer="Marian Buschsieweke " + +RUN \ + --mount=type=cache,id=apk-cache,sharing=locked,target=/var/cache/apk \ + --mount=type=bind,target=/tinybuild-apks,source=/output,from=tinybuild-apks \ + apk add \ + avr-libc diff --git a/tinybuild-base/Dockerfile b/tinybuild-base/Dockerfile new file mode 100644 index 00000000..e59f1ae3 --- /dev/null +++ b/tinybuild-base/Dockerfile @@ -0,0 +1,15 @@ +ARG DOCKER_REGISTRY="docker.io/riot" +FROM alpine:latest +LABEL maintainer="Marian Buschsieweke " + +RUN \ + --mount=type=cache,id=apk-cache,sharing=locked,target=/var/cache/apk \ + --mount=type=bind,target=/tinybuild-apks,source=/output,from=tinybuild-apks \ + echo "@riotapks /tinybuild-apks/riotapks" >> /etc/apk/repositories && \ + cp /tinybuild-apks/*.rsa.pub /etc/apk/keys/ && \ + apk update && \ + apk add \ + python3 \ + make \ + unzip \ + git diff --git a/tinybuild-msp430/Dockerfile b/tinybuild-msp430/Dockerfile new file mode 100644 index 00000000..e2916268 --- /dev/null +++ b/tinybuild-msp430/Dockerfile @@ -0,0 +1,10 @@ +ARG DOCKER_REGISTRY="docker.io/riot" +FROM ${DOCKER_REGISTRY}/tinybuild-base:latest + +LABEL maintainer="Marian Buschsieweke " + +RUN \ + --mount=type=cache,id=apk-cache,sharing=locked,target=/var/cache/apk \ + --mount=type=bind,target=/tinybuild-apks,source=/output,from=tinybuild-apks \ + apk add \ + newlib-msp430-elf diff --git a/tinybuild-native64/Dockerfile b/tinybuild-native64/Dockerfile new file mode 100644 index 00000000..26447d02 --- /dev/null +++ b/tinybuild-native64/Dockerfile @@ -0,0 +1,13 @@ +ARG DOCKER_REGISTRY="docker.io/riot" +FROM ${DOCKER_REGISTRY}/tinybuild-base:latest + +LABEL maintainer="Marian Buschsieweke " + +RUN \ + --mount=type=cache,id=apk-cache,sharing=locked,target=/var/cache/apk \ + --mount=type=bind,target=/tinybuild-apks,source=/output,from=tinybuild-apks \ + apk add \ + libucontext-dev@riotapks \ + gcc \ + musl-dev \ + linux-headers diff --git a/tinybuild-risc-v/Dockerfile b/tinybuild-risc-v/Dockerfile new file mode 100644 index 00000000..3b980290 --- /dev/null +++ b/tinybuild-risc-v/Dockerfile @@ -0,0 +1,11 @@ +ARG DOCKER_REGISTRY="docker.io/riot" +FROM ${DOCKER_REGISTRY}/tinybuild-base:latest + +LABEL maintainer="Marian Buschsieweke " + +RUN \ + --mount=type=cache,id=apk-cache,sharing=locked,target=/var/cache/apk \ + --mount=type=bind,target=/tinybuild-apks,source=/output,from=tinybuild-apks \ + apk add \ + newlib-riscv-none-elf \ + picolibc-riscv-none-elf From d77f530e13fa00358f573b6c93dcd36ab7860baa Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Sat, 8 Nov 2025 19:17:31 +0100 Subject: [PATCH 2/2] smallbuild-msp430: Disable build Due to the bug in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119953 we cannot build g++ for MSP430 right now. --- .github/workflows/build.yml | 10 ---------- README.md | 25 +++++++++++++------------ 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 165f7119..39905999 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -120,16 +120,6 @@ jobs: build-args: | DOCKER_REGISTRY=${{ env.DOCKER_REGISTRY }} - - name: Build smallbuild-msp430 - uses: docker/build-push-action@v2 - with: - context: ./smallbuild-msp430 - tags: | - ${{ env.DOCKER_REGISTRY }}/smallbuild-msp430:latest - ${{ env.DOCKER_REGISTRY }}/smallbuild-msp430:${{ env.VERSION_TAG }} - build-args: | - DOCKER_REGISTRY=${{ env.DOCKER_REGISTRY }} - - name: Build tinybuild-native64 uses: docker/build-push-action@v2 with: diff --git a/README.md b/README.md index 35744039..50ce420b 100644 --- a/README.md +++ b/README.md @@ -11,18 +11,19 @@ even more by only supporting C code by dropping the C++ and rust toolchains. ## Platform Support -| Image | Size | `native32` | `native64` | ARM7 Boards | Cortex M Boards | RISC-V Boards | AVR8 Boards | MSP430 Boards | ESP* Xtensa Boards | ESP* RISC-V Boards | -| --------------------- | --------- | ---------- | ---------- | ----------- | --------------- | ------------- | ----------- | ------------- | ------------------ | ------------------ | -| `riotbuild` | ~ 13.5 GB | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | -| `smallbuild-arm` | ~ 4.3 GB | | | ✔ | ✔ | | | | | | -| `smallbuild-msp430` | ~ 0.5 GB | | | | | | | ✔ | | | -| `smallbuild-native64` | ~ 2.4 GB | | ✔ | | | | | | | | -| `smallbuild-risc-v` | ~ 3.3 GB | | | | | ✔ | | | | | -| `tinybuild-arm` | ~ 1.2 GB | | | ✔ | ✔ | | | | | | -| `tinybuild-avr` | ~ 0.4 GB | | | | | | ✔ | | | | -| `tinybuild-msp430` | ~ 0.4 GB | | | | | | | ✔ | | | -| `tinybuild-native64` | ~ 0.3 GB | | ✔ | | | | | | | | -| `tinybuild-risc-v` | ~ 1.1 GB | | | | | ✔ | | | | | +| Image | Size | `native32` | `native64` | ARM7 Boards | Cortex M Boards | RISC-V Boards | AVR8 Boards | MSP430 Boards | ESP* Xtensa Boards | ESP* RISC-V Boards | +| ----------------------- | --------- | ---------- | ---------- | ----------- | --------------- | ------------- | ----------- | ------------- | ------------------ | ------------------ | +| `riotbuild` | ~ 13.5 GB | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | +| `smallbuild-arm` | ~ 4.3 GB | | | ✔ | ✔ | | | | | | +| `smallbuild-msp430` (*) | ~ 0.5 GB | | | | | | | ✔ | | | +| `smallbuild-native64` | ~ 2.4 GB | | ✔ | | | | | | | | +| `smallbuild-risc-v` | ~ 3.3 GB | | | | | ✔ | | | | | +| `tinybuild-arm` | ~ 1.2 GB | | | ✔ | ✔ | | | | | | +| `tinybuild-avr` | ~ 0.4 GB | | | | | | ✔ | | | | +| `tinybuild-msp430` | ~ 0.4 GB | | | | | | | ✔ | | | +| `tinybuild-native64` | ~ 0.3 GB | | ✔ | | | | | | | | +| `tinybuild-risc-v` | ~ 1.1 GB | | | | | ✔ | | | | | +- (*) Current g++ does not build for MSP430, so there is no `smallbuild-msp430` ## Language Support