-
Notifications
You must be signed in to change notification settings - Fork 508
ci: add armv6 (Raspberry Pi B/Zero) build support #1400
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
b0bbywan
wants to merge
4
commits into
Spotifyd:master
Choose a base branch
from
b0bbywan:ci/armv6
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.
+175
−19
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4289720
ci: add armv6 (Raspberry Pi B/Zero) build support
b0bbywan e39bc0b
ci: replace aarch64 native runner and armv7 cross with QEMU docker bu…
b0bbywan 425b2f0
ci: add .deb packaging for Linux builds
b0bbywan 998ca0e
ci: trigger APT repo rebuild after release
b0bbywan 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # syntax=docker/dockerfile:1 | ||
|
|
||
| # ── Builder base images ──────────────────────────────────────────────────────── | ||
| # amd64: native build on Debian Trixie | ||
| # arm64/arm: RaspiOS (Trixie), runs natively via QEMU binfmt_misc — | ||
| # no cross-compiler needed, even for bindgen | ||
| FROM debian:trixie-slim AS base-amd64 | ||
| FROM vascoguita/raspios:arm64 AS base-arm64 | ||
| FROM vascoguita/raspios:armhf AS base-arm | ||
|
|
||
| # ── Builder ─────────────────────────────────────────────────────────────────── | ||
| ARG TARGETARCH | ||
| FROM base-${TARGETARCH} AS builder | ||
|
|
||
| ARG TARGETARCH | ||
| ARG TARGETVARIANT | ||
| # Default: slim build with alsa only | ||
| ARG FEATURES="--no-default-features --features alsa_backend" | ||
|
|
||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
| curl \ | ||
| ca-certificates \ | ||
| gcc \ | ||
| libc6-dev \ | ||
| # required by aws-lc-rs (bindgen) on non-x86_64/aarch64 targets | ||
| libclang-dev \ | ||
| cmake \ | ||
| pkg-config \ | ||
| # alsa_backend + base | ||
| libasound2-dev \ | ||
| libssl-dev \ | ||
| # dbus_mpris | ||
| libdbus-1-dev \ | ||
| # pulseaudio_backend | ||
| libpulse-dev \ | ||
| # rodiojack_backend | ||
| libjack-dev \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # Force the correct rustup host triple. | ||
| # QEMU reports armv7 even inside an armv6 container — override manually. | ||
| RUN set -eux; \ | ||
| case "${TARGETARCH}${TARGETVARIANT}" in \ | ||
| armv6) RUST_HOST="arm-unknown-linux-gnueabihf" ;; \ | ||
| armv7) RUST_HOST="armv7-unknown-linux-gnueabihf" ;; \ | ||
| arm64) RUST_HOST="aarch64-unknown-linux-gnu" ;; \ | ||
| amd64) RUST_HOST="x86_64-unknown-linux-gnu" ;; \ | ||
| *) RUST_HOST="" ;; \ | ||
| esac; \ | ||
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ | ||
| sh -s -- -y --default-toolchain stable --profile minimal \ | ||
| ${RUST_HOST:+--default-host "$RUST_HOST"} | ||
| ENV PATH="/root/.cargo/bin:$PATH" | ||
|
|
||
| # Use native bindgen (no cross-compilation) | ||
| ENV AWS_LC_SYS_BINDGEN=1 | ||
|
|
||
| WORKDIR /build | ||
|
|
||
| COPY Cargo.lock Cargo.toml ./ | ||
| COPY src/ src/ | ||
|
|
||
| # Cargo cache is preserved between builds so changing FEATURES | ||
| # does not recompile all dependencies from scratch. | ||
| # shellcheck disable=SC2086 # $FEATURES must be word-split intentionally | ||
| RUN --mount=type=cache,target=/root/.cargo/registry \ | ||
| --mount=type=cache,target=/root/.cargo/git \ | ||
| --mount=type=cache,target=/build/target \ | ||
| cargo build --locked --release $FEATURES && \ | ||
| cp target/release/spotifyd /spotifyd | ||
|
|
||
| # ── Binary export: extract via --output type=local ─────────────────────────── | ||
| FROM scratch AS export | ||
| COPY --from=builder /spotifyd /spotifyd | ||
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 |
|---|---|---|
|
|
@@ -36,3 +36,6 @@ tags | |
| .vscode | ||
| # Windows logs | ||
| *.log | ||
|
|
||
| # docker cross build | ||
| dist/ | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why Raspberry Pi OS for arm64? I'd use official Debian slim really for everything but armv6. Those are marked as official Docker images, assured to remain stable, updated, slim etc. Even if Raspberry Pi OS uses the Debian repository for arm64, it adds their own Raspberry Pi repo for kernel and also some other/overlapping library packages on top, potentially causing conflicts on non RPi systems, overhead in every case, and vascoguita is not a trusted publisher.