• Sep 12, 2026
  • 4 min read

Why a 9 MB Tauri Binary Becomes an 81 MB AppImage

My Rust/Tauri drone controller produced an optimized native executable of about 9.3 MB with a CNN face detector compiled inside it. The portable x86-64 AppImage was about 81 MB. Meanwhile, Cargo build folders consumed several gigabytes.

All three numbers were correct because they measured different things.

The three sizes

MeasurementApproximate sizeWhat it contains
Stripped face-edition executable9.3 MBApplication code, Vue assets, Tauri glue, CNN model
AppImage81 MBApplication plus bundled Linux GUI/runtime libraries
Cargo target/Multiple GBCaches, objects, debug data, dependencies, intermediates

Comparing them as though each were “the app size” hides the deployment model.

Why the native Tauri executable is small

Several choices reduce the final artifact:

  • Rust compiles application logic to native machine code.
  • Vue becomes static HTML, CSS, and JavaScript assets.
  • Tauri uses the operating system’s WebKitGTK webview rather than bundling a complete Chromium runtime.
  • Release builds strip symbols and enable link-time optimization.
  • One codegen unit gives the optimizer a broader view.
  • Panic behavior aborts rather than carrying unwind machinery.
  • The compact face CNN is compiled directly into the program.
  • FFmpeg is launched as a system program instead of embedded.

A representative Cargo release profile is:

[profile.release]
strip = true
lto = true
codegen-units = 1
panic = "abort"

The tradeoff is build time and reduced panic diagnostics in production, not free size reduction.

Small does not mean self-contained

The raw executable relies on compatible host components:

  • glibc
  • GTK/WebKitGTK and related desktop libraries
  • The system webview environment
  • ffmpeg in PATH for this application’s video pipeline

On the machine where it was built and tested, those dependencies already exist. Copying only the executable to a random Linux distribution may fail even though the file itself is small.

This is the key mental model:

native executable size ≠ complete transitive runtime footprint

Why AppImage grows

An AppImage improves portability by packaging the application together with many libraries that may not exist in compatible versions on another machine. That duplicates components the native executable normally borrows from the host.

The 81 MB result is therefore not Tauri suddenly becoming inefficient. It is the cost of carrying more of the runtime boundary with the artifact.

The current bundle still has limits:

  • It targets x86-64, not ARM64.
  • It retains a glibc compatibility floor.
  • FFmpeg remains an external dependency.
  • Desktop integration behavior varies by distribution.

Building on the oldest distribution you intend to support generally produces broader compatibility than building on a new system.

Why Cargo uses gigabytes

Cargo’s target/ directory optimizes development speed, not distribution size. It can contain:

  • Compiled dependency variants
  • Debug symbols
  • Incremental compilation state
  • Build-script output
  • Test binaries
  • Release objects before final linking and stripping

Sibling applications with similar dependencies can each retain their own large target tree. None of those files need to be shipped to users.

To recover space:

cargo clean --manifest-path desktop-rust/src-tauri/Cargo.toml

Cleaning deletes reproducible build output. It does not uninstall a copied application or erase photos and recordings stored elsewhere. The next build is slower because dependencies must be compiled again.

Keep distributable artifacts outside target/

The AppImage build copies its finished file to a dedicated distribution folder:

desktop-rust-face/appimage-dist/

This prevents a routine cargo clean from deleting the artifact intended for testing or release. Checksums should be recorded after the final copy.

Which number should you publish?

State what was measured:

  • Use executable size when comparing optimized program artifacts.
  • Use bundle/download size when describing what users obtain.
  • Use installed size when discussing disk use after extraction.
  • Treat target/ as developer cache, not application footprint.

For this project, “9.3 MB native executable and 81 MB AppImage” is honest. “A 9.3 MB portable Linux application” would not be.

Frequently asked questions

Why is my Cargo target directory larger than my Rust binary?

It stores compilation caches, dependency objects, debug data, tests, and link intermediates. The final stripped binary contains only the linked result.

Does Tauri bundle Chromium?

Tauri normally uses the operating system webview. On Linux that commonly means WebKitGTK, which affects both system requirements and bundle composition.

Will an AppImage run on every Linux computer?

No. CPU architecture, glibc, kernel behavior, graphics integration, and intentionally external tools can still impose compatibility limits.

Should FFmpeg be bundled?

It depends on licensing, size, codecs, and the desired installation experience. This project keeps FFmpeg external and documents it as a requirement.