Skip to content

Enable aarch64-unknown-linux-musl build target in cargo-dist#250

Merged
Shnatsel merged 3 commits into
rust-secure-code:masterfrom
anelson:master
Mar 18, 2026
Merged

Enable aarch64-unknown-linux-musl build target in cargo-dist#250
Shnatsel merged 3 commits into
rust-secure-code:masterfrom
anelson:master

Conversation

@anelson
Copy link
Copy Markdown
Contributor

@anelson anelson commented Mar 18, 2026

It turns out that cargo-dist does support the aarch64-unknown-linux-musl target it just has to be enabled. In the workspace.metadata.dist section in Cargo.toml I just added aarch64-unknown-linux-musl:

targets = ["aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "aarch64-unknown-linux-musl", "aarch64-pc-windows-msvc", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc"]

In my fork I then made a new "release" tag and confirmed that it built and published to artifacts the aarch64 musl bits.

You can see the Release workflow built on my fork here. The specific aarch64-unknown-linux-musl build is here.

Closes #249

@Shnatsel
Copy link
Copy Markdown
Member

I do agree that supporting aarch64 musl target is worthwhile. However, I'm not keen on enabling a build target that just so happens to work right now but isn't officially supported and therefore could break at any moment.

Could you open a PR to cargo-dist adding support for this target? Once it's continually tested in upstream CI and subsequent upstream changes are accounting for its existence, the risk of unpredictable breakage should be eliminated.

@anelson
Copy link
Copy Markdown
Contributor Author

anelson commented Mar 18, 2026

As far as I know it is officially supported. I got this idea from axodotdev/cargo-dist#1581.

In the code it seems explicit that this is one of the targets that cargo-dist knows about:

https://github.com/axodotdev/cargo-dist/blob/e94ddf67c1887946b838130077e8e43665c23257/cargo-dist/src/platform/targets.rs#L129-L142

In the docs section on custom runners it specifically shows a config for aarch-unknown-linux-musl.

The latest cargo-dist release includes aarch64-unknown-linux-musl binaries.

It seems fully supported already as far as I can see...

@Shnatsel Shnatsel merged commit ab0d04c into rust-secure-code:master Mar 18, 2026
11 checks passed
@Shnatsel
Copy link
Copy Markdown
Member

Merged, thanks. But it won't take effect until I cut the next release, which might take a while.

@Shnatsel
Copy link
Copy Markdown
Member

I have published a new release, and aarch64 Linux binaries are now available.

anelson added a commit to anelson-labs/cgx that referenced this pull request May 27, 2026
Enable cargo-dist's built-in cargo-auditable support so that release
artifacts embed dependency information (SBOM) directly into the
binaries. Downstream tools like `cargo audit bin` can then scan a
shipped binary against the exact dependency tree it was built from.

Bumps cargo-dist from 0.30.2 to 0.31.0 and regenerates release.yml.

Note: this depends on cargo-auditable publishing an
aarch64-unknown-linux-musl binary. The fix has been merged upstream
(rust-secure-code/cargo-auditable#250) but a release containing that
artifact has not yet been cut, so until then the aarch64-musl release
job will fail at the install step.

Closes #27.
anelson added a commit to anelson-labs/cgx that referenced this pull request May 27, 2026
Update to the latest cargo-dist (probably not needed but making sure to
stay up to date) and enable cargo-auditable now that it finally
publishes all needed architecture/platform combinations of its
artifacts.

See
<rust-secure-code/cargo-auditable#250 (comment)>
for the event that finally made this possible.
anelson added a commit to anelson-labs/cgx that referenced this pull request May 27, 2026
Enable cargo-dist's built-in cargo-auditable support so that release
artifacts embed dependency information (SBOM) directly into the
binaries. Downstream tools like `cargo audit bin` can then scan a
shipped binary against the exact dependency tree it was built from.

Bumps cargo-dist from 0.30.2 to 0.31.0 and regenerates release.yml.

Note: this depends on cargo-auditable publishing an
aarch64-unknown-linux-musl binary. The fix has been merged upstream
(rust-secure-code/cargo-auditable#250) but a release containing that
artifact has not yet been cut, so until then the aarch64-musl release
job will fail at the install step.

Closes #27.
anelson added a commit to anelson-labs/cgx that referenced this pull request May 27, 2026
Update to the latest cargo-dist (probably not needed but making sure to
stay up to date) and enable cargo-auditable now that it finally
publishes all needed architecture/platform combinations of its
artifacts.

See
<rust-secure-code/cargo-auditable#250 (comment)>
for the event that finally made this possible.
anelson added a commit to anelson-labs/cgx that referenced this pull request May 27, 2026
…166)

Per [this issue
comment](rust-secure-code/cargo-auditable#250 (comment)),
the maintainer of cargo-auditable has published a new release (0.7.5)
that includes the missing `aarch64-unknown-linux-musl` artifact, the
lack of which was preventing us from enabling cargo-auditable in our
dist process. Now that this is available, we can run cargo-auditable
against all of our various platform binaries, thereby embedding an SBOM
that security scanner tools can read.

Closes #27.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Publish aarch64-unknown-linux-musl binaries

2 participants