-
Notifications
You must be signed in to change notification settings - Fork 48
Add tiny and small build images #259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
maribu
wants to merge
2
commits into
RIOT-OS:master
Choose a base branch
from
maribu:tinybuild
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,44 @@ | ||
| # 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 | | | | | ✔ | | | | | | ||
| - (*) Current g++ does not build for MSP430, so there is no `smallbuild-msp430` | ||
|
|
||
| ## 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| ARG DOCKER_REGISTRY="docker.io/riot" | ||
| FROM ${DOCKER_REGISTRY}/smallbuild-base:latest | ||
|
|
||
| LABEL maintainer="Marian Buschsieweke <marian.buschsieweke@posteo.net>" | ||
|
|
||
| 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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| ARG DOCKER_REGISTRY="docker.io/riot" | ||
| FROM ${DOCKER_REGISTRY}/tinybuild-base:latest | ||
| LABEL maintainer="Marian Buschsieweke <marian.buschsieweke@posteo.net>" | ||
|
|
||
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| ARG DOCKER_REGISTRY="docker.io/riot" | ||
| FROM ${DOCKER_REGISTRY}/tinybuild-msp430:latest | ||
|
|
||
| LABEL maintainer="Marian Buschsieweke <marian.buschsieweke@posteo.net>" | ||
|
|
||
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| ARG DOCKER_REGISTRY="docker.io/riot" | ||
| FROM ${DOCKER_REGISTRY}/smallbuild-base:latest | ||
|
|
||
| LABEL maintainer="Marian Buschsieweke <marian.buschsieweke@posteo.net>" | ||
|
|
||
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| ARG DOCKER_REGISTRY="docker.io/riot" | ||
| FROM ${DOCKER_REGISTRY}/smallbuild-base:latest | ||
|
|
||
| LABEL maintainer="Marian Buschsieweke <marian.buschsieweke@posteo.net>" | ||
|
|
||
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 <marian.buschsieweke@posteo.net>" | ||
|
|
||
| # 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 |
15 changes: 15 additions & 0 deletions
15
tinybuild-apks/aports/libucontext/0001-fix-header-install-dir.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # Maintainer: Ariadne Conill <ariadne@dereferenced.org> | ||
| 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 | ||
| " |
1 change: 1 addition & 0 deletions
1
tinybuild-apks/aports/libucontext/src/0001-fix-header-install-dir.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /home/maribu/Repos/software/aports/master/main/libucontext/0001-fix-header-install-dir.patch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /var/cache/distfiles/libucontext-1.3.2.tar.xz |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.