Repository navigation
Description
Goal
Ship the decdn CLI (the client) for OpenWrt routers. OpenWrt is musl-based, and the common SoC families split into three Rust targets:
| OpenWrt family | Rust target | Rust tier |
|---|---|---|
| filogic, ipq807x, rockchip, bcm27xx (64-bit) | aarch64-unknown-linux-musl |
2 (prebuilt std) |
| ipq40xx, mvebu, bcm53xx | armv7-unknown-linux-musleabihf |
2 (prebuilt std) |
| ath79, ramips (mt7621/mt7620), lantiq | mipsel-unknown-linux-musl / mips-unknown-linux-musl |
3 (nightly + -Zbuild-std) |
The release matrix in .github/workflows/release.yml builds only glibc Linux (x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu), macOS and Windows. None of these run on an OpenWrt box.
What a local probe established (2026-10-26, toolchain 1.99.1, cargo-zigbuild 0.24.0 with zig as the C cross-compiler)
aarch64-unknown-linux-musl: the whole dependency graph compiles. 474 crates built with zero errors, including the ones that usually break on musl cross-builds: ring 0.17.14 (C sources), redb, iroh 1.3.0 / noq, netwatch, rustls, alloy. The run was stopped while decdn-cli itself was compiling, so the final link step and a binary on a real device are still unverified.
armv7-unknown-linux-musleabihf: not attempted (queued behind aarch64, stopped before it started). Same tier, same expectation, same unknowns.
mipsel-unknown-linux-musl: will not compile as-is. The target spec is 32-bit, soft-float, max-atomic-width: 32. Our own crates use std::sync::atomic::AtomicU64 directly, which does not exist on that target:
crates/client/src/driver.rs(unbilled_from,verified,frontier, progress and stop counters)crates/client/src/stream_cap.rs(next_lane)crates/client/src/lane_sources.rs(seeded)crates/client/src/progress.rs(byte counters)crates/client/src/downloader.rscrates/protocol
The same pattern appears in dependencies that have no target_has_atomic fallback: iroh, iroh-dns, iroh-relay, iroh-metrics, noq-proto, redb, alloy-primitives, alloy-rpc-client, indicatif, rustls. (tokio, crossbeam-utils, serde, zerocopy already gate on target_has_atomic = "64" or route through portable-atomic.) Fixing our crates is a portable-atomic swap; the upstream list means MIPS32 is a multi-upstream effort, not a target we can add in one PR.
Work items
- Finish the aarch64-musl and armv7-musl builds to a linked
decdnbinary, rundecdn --versionand a paiddecdn geton a real OpenWrt device (or qemu). Record stripped release size: typical OpenWrt flash is 16 to 128 MB, so size may decide whether this ships as anopkg/apkpackage or only as a USB/extroot install. - Decide the build mechanism for the release workflow:
cargo-zigbuild(one runner, zig links musl),cross(Docker images per target), or themusl-toolsnative path for x86_64 only. The glibcaarch64-unknown-linux-gnuentry already cross-compiles onubuntu-latest, so the matrix shape exists. - Add
aarch64-unknown-linux-muslandarmv7-unknown-linux-musleabihfto the release matrix and to theself-updatetarget table, once (1) passes. - MIPS32 (
mipsel/mips): file as a separate follow-up after (3). Needsportable-atomicindecdn-clientanddecdn-protocol, nightly-Zbuild-std, and upstream fixes or forks for the crates listed above. Do not block the aarch64/armv7 work on it.
Reproduce the probe
rustup target add aarch64-unknown-linux-musl armv7-unknown-linux-musleabihf
uvx --from cargo-zigbuild cargo-zigbuild zigbuild --target aarch64-unknown-linux-musl -p decdn-cli --bin decdn --release
# MIPS target facts
rustc +nightly -Z unstable-options --print target-spec-json --target mipsel-unknown-linux-musl | grep -E 'features|max-atomic-width'Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsBacklog
Activity