Files
microduck/scripts/dev-build.Dockerfile
apirroneandClaude Opus 5.5 9cd5b3e72a Bring the Rust floor back to 1.89, and keep it under Yocto's 1.94
The Yocto image builds each release from source with the Rust its OE release
ships -- 1.94.1 on wrynose -- and 0.15.1's rust-version of 1.99 (for the
atomics' try_update in mediad) made it unbuildable there: the image had to
seed 0.15.0 instead.

Both call sites become compare-exchange loops, which mean the same thing on
every version and trip neither 1.99's deprecation of fetch_update under CI's
-D warnings nor 1.94's lack of try_update. rust-version returns to 1.89, and
CONTRIBUTING now says the number is a ceiling as well as a floor.

Checked: `cargo +1.94.1 check --workspace --all-targets`, stable clippy
--workspace --all-targets -D warnings, mediad's tests (122 pass).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 18:37:02 +02:00

32 lines
2.1 KiB
Docker

# Build image for `scripts/dev-push.sh --docker`: the board's userland, with the one C
# dependency installed the way CI installs it.
#
# **Why this exists at all.** The default path cross-compiles with `cargo zigbuild`, which needs
# `zig`, `cargo-zigbuild`, and — because `padd` links libudev and a Mac cannot install an aarch64
# Linux library — a copy of `libudev.so.1` taken off a board. Each of those is a way for "I want
# to try this on the robot" to turn into an afternoon of toolchain work. In here, the target *is*
# the host: `apt-get install libudev-dev` is all it takes, and there is nothing to cross.
#
# **Bookworm, not Trixie**, and this is the same reasoning as `scripts/board-test.sh`: build
# against an older glibc than any userland we might ship. Bookworm's 2.36 is below Trixie's 2.41,
# so a binary built here loads on the board we ship *and* on an older image, while one built on
# Trixie would require 2.41 and fail on anything older with a message that names no cause. This
# is the container equivalent of the `.2.31` glibc pin in `.cargo/config.toml`.
#
# **On an arm64 host this is a native build**, not an emulated one: the daemons that come out are
# aarch64 ELF because the container is. `dev-push.sh` passes `--platform linux/arm64` so that
# holds on an x86 laptop too, where it costs qemu and the script says so.
#
# `rust:1-bookworm` floats to the newest 1.x rather than pinning: the workspace declares its own
# floor (`rust-version = "1.89"`), so a toolchain below it fails with that message rather than
# with a missing method, and a pin here would be a second place to bump.
FROM rust:1-bookworm
# libudev for `gilrs` (via `padd`) — the one exception to "everything reaching the board is pure
# Rust", and the reason `scripts/ci-cross-deps.sh` exists on the CI side. pkg-config is how
# libudev-sys finds it. Nothing else: `zstd`'s C is compiled from source by the crate, and the
# rust image already carries a C compiler for that.
RUN apt-get update \
&& apt-get install -y --no-install-recommends libudev-dev pkg-config \
&& rm -rf /var/lib/apt/lists/*