Repository navigation
Ship a prebuilt agent binary instead of the crate source - #5
Merged
Merged
Conversation
Following the published guide end to end from a clean project does not work. `avocado ext package` runs no build step, so the published RPM can only carry what is in the repo - which made it a source package and pushed the compile onto the consumer. A consumer has no Rust cross toolchain in their SDK and no reason to, and the extension's own sdk.packages do not travel with a package-sourced extension, so the build died inside ring's build script looking for x86_64-avocado-linux-gcc. Both `avocado install` and the extension's sysroot creation had already reported success, so nothing pointed at the extension. Fetching a prebuilt artifact is what ext-microclaw does, and this is why rather than convenience: the release path has nowhere to compile, so the only question is who compiles and when. Doing it in the extension's own CI puts it where the toolchain is already known-good. The binaries are static musl rather than glibc. A gnu build pins the runner's glibc version into the artifact and fails on any older device at exec time; static musl has no libc coupling at all, so one artifact per architecture serves every target of that architecture. Measured: 3.8 MB x86_64 static-pie, 3.3 MB aarch64 static, both built under `cross`, ring included. SHA256SUMS comes from the same release as the artifact, so it verifies the transfer and not the provenance. That is proportionate for a first-party artifact and avoids pinning a digest in the compile hook, which would force every release through build, commit, then tag just to record a hash the tag itself produces. cad-install.sh now checks the staged binary's architecture against the target. The packaged extension is noarch and nothing downstream re-checks that the two agree, so a mismatch would install cleanly and fail only when the device tried to exec it. Triple resolution is gone from both hooks along with the compile. The ambiguity guard it carried is no longer needed here, but the five sibling extensions still resolve by first prefix match and are still exposed on any target whose architecture matches the SDK host's. Signed-off-by: Javier Tia <javier@peridio.com>
nicksinas
approved these changes
Sep 15, 2026
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.
Stacked on #3 (base is
release-matrix-by-feed, notmain).Problem
Following the published guide end to end from a clean project fails at build.
avocado ext packageruns no build step, so the published RPM can only carry whatis in the repo - which made it a source package and pushed the compile onto the
consumer. A consumer has no Rust cross toolchain in their SDK, and the extension's
own
sdk.packagesdo not travel with a package-sourced extension:avocado installand the extension's own sysroot creation both reported successfirst, so nothing pointed at the extension.
Solution
Fetch a prebuilt artifact, which is what
ext-microclawdoes. The release path hasnowhere to compile, so the only question is who compiles and when; doing it in this
repo's CI puts it where the toolchain is already known-good.
Static musl, not gnu. A gnu build pins the runner's glibc version into the
artifact and fails on older devices at exec time. Static musl has no libc coupling,
so one artifact per architecture serves every target of that architecture.
Verification
Both architectures build under
cross, ring included:The x86_64 binary runs - it reaches
reading bootstrap at /var/lib/avocado/container-dev/bootstrap.json, which is correct without a bootstrap.Hook error paths exercised directly: unmapped architecture exits 1, unset
architecture exits 1, absent staged binary exits 1, and the new architecture guard
rejects a real aarch64 binary staged for an x86_64 target:
Reviewer notes
that release's own assets. Everything up to the fetch is tested above.
SHA256SUMSships in the same release as the artifact, so it verifies thetransfer rather than the provenance - the release is the trust anchor. That avoids
pinning a digest in the hook, which would force every release through
build-commit-tag just to record a hash the tag produces.
guard it carried is no longer needed here, but
cli,connect,tunnels,jtopandmicroclawstill resolve by first prefix match in avocado-os and arestill exposed on any target whose architecture matches the SDK host's.
in Publish the container dev mode guide and its two field notes peridio/docs#509 should be removed - consumers will need no toolchain.