---
title: "Comment by teor on \"Cross-Compiling 10,000+ Rust CLI Crates Statically\" | Hashnode"
description: "I wonder if using --all-features also brought in more system or architecture dependencies, leading to more failures?"
url: "https://hashnode.com/posts/cross-compiling-10000-rust-cli-crates-statically/685d476a73349620fb4000c9/comment/6866fb8628dcb56e814790ef"
---

[Discussion](https://hashnode.com/posts/cross-compiling-10000-rust-cli-crates-statically/685d476a73349620fb4000c9)

Comment [Cross-Compiling 10,000+ Rust CLI Crates Statically](https://hashnode.com/posts/cross-compiling-10000-rust-cli-crates-statically/685d476a73349620fb4000c9)

[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)
