Repository navigation
build: containerised devkit and reproducible RK3588 firmware build - #64
Merged
Merged
Conversation
Rust-KVM
marked this pull request as ready for review
October 17, 2026 14:48
Building RustKVM needed the reference WSL workbench: a self-built stage2 rustc, /opt/rk3588-buildkit, and a FriendlyElec SDK with uncommitted local changes in five projects. - ci/devkit: buildkit image + pinned nightly-2026-06-14 / 1.96.0 + trunk; RUSTUP_TOOLCHAIN overrides the stage2 rust-toolchain.toml. - ci/firmware: Ubuntu 22.04 SDK host with a hash-pinned repo launcher. - scripts/devkit.sh, build-app.sh, build-firmware.sh: one command each for the app package (out/app) and SD/eflasher images (out/firmware), with proxy forwarding and download/ccache caches. - os/rk3588: SDK pinned per project to upstream commits, every local SDK change as a patch, the rustkvm rootfs overlay. S99rustkvm now stops the app with SIGTERM instead of SIGKILL, which tripped the watchdog. - Root password is no longer in the defconfig: injected at build time via RUSTKVM_ROOT_PASSWORD, otherwise root login is disabled. - release.yml pins the same nightly; buildkit.yml uses the named context. - docs/building.md and docs/firmware-release.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RUSTSEC-2026-0346..0349 (rustls) and 0367..0369 (zip) fail cargo deny on dev. zip is only used for ZipWriter, whose API is unchanged in 9.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- One pinned nightly builds both the device binary and the wasm frontend; the separate stable toolchain is gone (devkit 4.0 GB -> 3.2 GB). - buildkit image drops docs, translations, target executables and the sysroot password database before it is published. - devkit.sh defaults to ghcr.io/rust-kvm/rk3588-buildkit:20250527 and rustkvm-devkit:nightly-2026-06-14, pulls before building, and gains `push` for maintainers. OCI source labels link the packages to the repo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rust-KVM
force-pushed
the
claude/project-thread-9dvesw
branch
from
October 17, 2026 15:39
b1f2a20 to
731377a
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Requested by 4c
Summary
Before: only the reference WSL workbench could build RustKVM. The device binary needed a self-built
stage2rustc and/opt/rk3588-buildkit, and the firmware came from a FriendlyElec SDK checkout whose RustKVM changes were uncommitted local edits in five projects (one of them a local branch).After: any x86_64 Linux host with Docker builds the application package with
scripts/devkit.sh run scripts/build-app.shand the SD / eMMC-flasher firmware images withscripts/devkit.sh firmware. Every toolchain and SDK commit is pinned in the repository, and every SDK change lives here as a patch.How
ci/devkit/Dockerfile: the RK3588 buildkit image plusnightly-2026-06-14(device binary,-Z build-std),1.96.0(frontend) and Trunk 0.21.14.RUSTUP_TOOLCHAINoverrides thestage2rust-toolchain.toml, so nobody else has to build rustc..devcontainer/uses the same image.ci/firmware/Dockerfile: Ubuntu 22.04 host for the FriendlyElec SDK with a sha256-pinnedrepolauncher; runs--privilegedfor loop devices.ci/buildkit/Dockerfile: now takes the Buildroot host dir as therk3588-buildkitnamed context, so it can be built from/opt/rk3588-buildkitor a firmware build without copying into the repo.buildkit.ymlpasses the context.os/rk3588/:manifest.xmlpins all 14 SDK projects to upstream commits on github.com/friendlyarm;patches/holds the buildroot, kernel, sd-fuse, external and device changes exported from the workbench (checked to apply cleanly to the pinned commits);rootfs-overlay/is the formerdevice/friendlyelec/rustkvm-files.scripts/build-firmware.shstepssync → patch → build → collectproduceout/firmware/rustkvm-rk3588-<app>-<date>-<rev>-{sd,eflasher}.img.gz,/etc/rustkvm-releaseandSHA256SUMS.S99rustkvmstop/restart usedkillall -9, which skips the watchdog disarm and reboots the board. It now sends SIGTERM and waits.RUSTKVM_ROOT_PASSWORD(a crypt hash, outside the repo) sets it at build time; otherwise root password login is disabled. SSH was already key-only (dropbear-s, devmode only).release.ymlpins the same nightly as the devkit.zip8 → 9 andrustls0.23.46 in the lockfile, because new RustSec advisories (RUSTSEC-2026-0346..0349, 0367..0369) madecargo denyfail on dev.zipis only used throughZipWriter, whose API did not change.docs/building.md,docs/firmware-release.md(versions, release checklist, flashing, factory state, acceptance test),os/rk3588/README.md, AGENTS.md and README updated.Look closely at: the firmware build has not been run end to end from this tree yet (first run is a ~15 GB sync and several hours), and the
RUSTKVM_ROOT_PASSWORDdefault changes serial-console login on newly built images.Testing
scripts/devkit.sh imagethenscripts/devkit.sh run scripts/build-app.shon the workbench: Trunk build + aarch64 release binary in 6m19s,rustc 1.98.0-nightly (1f087276b 2026-06-13), output is an aarch64 ELF.scripts/devkit.sh firmware-imagebuilds;repo2.69 and passwordless sudo verified in the container.Every patch in
os/rk3588/patchesapplies withgit applyto its pinned commit (checked against a temporary index of the workbench SDK).repo init --depth=1+repo sync -c -dagainst a pinned non-tip commit checks out the exact commit (tested withbuildroot_device_friendlyelec).fmt, host clippy
-D warningsandcargo test --workspacepass inside the devkit container (so the devkit doubles as the local quality gate);cargo deny checkpasses.cargo +nightly fmt --allcargo +nightly clippy --workspace --release --all-targets -- -D warningscargo +nightly test --workspaceFrontend touched:
trunk build --lockedand wasm32 clippy incrates/rkvm-web(not touched;trunk build --release --lockedran in the devkit)Tested on an RK3588 device (describe below), or not applicable — not applicable, nothing was flashed or deployed
Checklist
#[allow(...)]suppressions and no newunwrap()/expect()in production pathsMissedTickBehavior::Delayrkvm-protoapp/tests/rpc_methods.txtupdatedAGENTS.mdupdated🤖 Generated with Claude Code