Skip to content

Building from Source

Daniel Struis edited this page Aug 4, 2026 · 5 revisions

Building from source

ClutterCutter ships as two implementations of the same app — the Rust build (the primary, winget-packaged one) and the original C# build. CI builds both on every push. Contributors should read AGENTS.md for the full dev workflow, architecture, and conventions.

Rust build (primary)

Needs the Rust stable toolchain.

cd rust
cargo build --release   # -> rust/target/release/cluttercutter.exe

There's also a console harness for testing the scanners without the GUI:

cargo run --bin cluttercutter-cli -- --top-n 20 C:\Users

Keep the tree cargo fmt-clean and cargo clippy --release-clean.

Tests & coverage

cd rust
cargo test                       # unit tests for the logic modules

The GUI is a large body of unsafe Win32 code (window procedures, GDI, list-view messages) that can't be meaningfully unit-tested without a live desktop, so the tests target the pure logic instead: byte/size/count formatting, the top-/oldest-files heap queries, temp-location discovery, the directory walker, and the MFT record/data-run parsers. Coverage on those modules runs high (formatting and types at 100%, analysis ~95%, the walker ~87%, temp ~83%). To measure it yourself:

cargo install cargo-llvm-cov      # one-time
cargo llvm-cov --lib --summary-only

C# build

You only need a Windows machine — the .NET Framework 4 C# compiler ships with Windows; no Visual Studio or SDK install required.

& "$env:WINDIR\Microsoft.NET\Framework64\v4.0.30319\csc.exe" `
    -nologo -target:winexe -optimize+ -platform:anycpu `
    -reference:System.Windows.Forms.dll -reference:System.Drawing.dll `
    -reference:System.dll -reference:System.Core.dll `
    -reference:Microsoft.VisualBasic.dll `
    -win32icon:ClutterCutter.ico -out:ClutterCutter.exe ClutterCutter.cs

CI & releases

GitHub Actions reproduces both builds on every push (.github/workflows/build.yml). Releases are managed by release-please under Semantic Versioning: conventional-commit messages on main keep an open release PR up to date; merging it tags the version and creates the GitHub Release. The winget manifest for each version is generated automatically and the winget folder is submitted to the community repository. See the README for the full procedure.

Clone this wiki locally