---
title: "Discussion on \"Cross-Compiling 10,000+ Rust CLI Crates Statically\" | Hashnode"
description: "Discussion on \"Cross-Compiling 10,000+ Rust CLI Crates Statically\". The Largest Collection of Pre-Compiled Cargo/Rust Static Binaries"
url: "https://hashnode.com/posts/cross-compiling-10000-rust-cli-crates-statically/685d476a73349620fb4000c9"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Cross-Compiling 10,000+ Rust CLI Crates Statically](https://blog.pkgforge.dev/cross-compiling-10000-rust-cli-crates-statically?utm_source=hashnode&utm_medium=feed)

The Largest Collection of Pre-Compiled Cargo/Rust Static Binaries

Jun 26, 2025 · 10 min read · blog.pkgforge.dev  
Read the article

-   [#rust](https://hashnode.com/tag/rust)
-   [#rust-lang](https://hashnode.com/tag/rust-lang)
-   [#cargo](https://hashnode.com/tag/cargo)
-   [#rust-programming](https://hashnode.com/tag/rust-programming)
-   [#programming-languages](https://hashnode.com/tag/programming-languages)
-   [#cli](https://hashnode.com/tag/cli)
-   [#experimentation](https://hashnode.com/tag/experimentation)
-   [#scale](https://hashnode.com/tag/scale)
-   [#automation](https://hashnode.com/tag/automation)
-   [#linux](https://hashnode.com/tag/linux)
-   [#package-manager](https://hashnode.com/tag/package-manager)

## Written by

[Ajam](https://hashnode.com/@azathothas)

@azathothas · Nepal

  
[View profile](https://hashnode.com/@azathothas)

## Responses 1

Markdown supported · ⌘↵ to post

[teor](https://hashnode.com/@teor)

[Jul 3, 2025](https://hashnode.com/posts/cross-compiling-10000-rust-cli-crates-statically/685d476a73349620fb4000c9/comment/6866fb8628dcb56e814790ef)

I wonder if using --all-features also brought in more system or architecture dependencies, leading to more failures?

[Ajam](https://hashnode.com/@azathothas)

[Jul 4, 2025](https://hashnode.com/posts/cross-compiling-10000-rust-cli-crates-statically/685d476a73349620fb4000c9/comment/6866fb8628dcb56e814790ef#reply-6867912480d9d41adaf8bdbf)

We use the --all-features flag because some crates don't produce an executable unless we specifically use the --feature flag.

We couldn't find an easy way to determine what features produced an executable, so decided to use --all-features directly.

What you hypothesize is actually true. We notice some errors were due to us using this --all-features flag.

In a future update, I will write a resolver which will resolve and use the correct feature flag automatically. But that's far in the future.

[teor](https://hashnode.com/@teor)

[Jul 7, 2025](https://hashnode.com/posts/cross-compiling-10000-rust-cli-crates-statically/685d476a73349620fb4000c9/comment/6866fb8628dcb56e814790ef#reply-686c44e6268c10778204630b)

[Ajam](https://hashnode.com/@azathothas) A simple first step could be: try with all features, and if that fails for any reason, try with default features.

[Ajam](https://hashnode.com/@azathothas)

[Jul 8, 2025](https://hashnode.com/posts/cross-compiling-10000-rust-cli-crates-statically/685d476a73349620fb4000c9/comment/6866fb8628dcb56e814790ef#reply-686caf563dc698775dfd2cb3)

[teor](https://hashnode.com/@teor) The problem is, it won't fail. It will compile just fine but produce no executables. Which brings us back to needing a parser/resolver, which can parse the cargo metadata and look if a feature flag produced any executables.

Temporarily, I will try building with default first, check if at least 1 executable was produced, else build with all features: [github.com/pkgforge-cargo/builder/commit/06bbb506…](https://github.com/pkgforge-cargo/builder/commit/06bbb506e123ae7d2a1d9fdd8d459131a596b350)
