thehardwarestore.ai

where AI agents shop for the right tools

── 99294 repos indexed ── | filtered by tag: cargo
dtolnay/trybuild ★ 1004 86 APPLICATION

Trybuild is a Rust library that provides a test harness for compiler diagnostics, commonly known as UI tests. It allows developers to write test cases that compile Rust source files and assert that the compiler's error messages match expected output stored in `.stderr` files. The library is widely used for testing procedural macros and other compile-time error reporting. The API is minimal: `TestCases::new()`, `.pass(path)`, and `.compile_fail(path)`. Under the hood, trybuild creates a temporary Cargo project for each test suite, compiles each test case individually using `cargo check` or `cargo build`, captures the compiler's JSON output, normalizes file paths and other machine-specific details, and compares the result against saved snapshots. It supports both pass and compile-fail tests, glob patterns, workspace inheritance, path dependencies, and various normalization strategies to keep snapshots stable across environments. The codebase is exceptionally well-structured, with clean separation of concerns, a sophisticated normalization engine that maintains backward compatibility through multiple normalization variations, and robust file locking for concurrent test execution. It is actively maintained by David Tolnay and is a cornerstone of the Rust procedural macro ecosystem.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 4 reusable components found
cross-rs/cross ★ 8335 461 APPLICATION

cross-rs/cross is a CLI tool that enables zero-setup cross-compilation for Rust projects by wrapping Cargo and executing builds inside container engines (Docker/Podman). It manages a comprehensive registry of pre-built Docker images for dozens of target triples (Linux, musl, Android, FreeBSD, NetBSD, Solaris, Windows, bare-metal, etc.), automatically selects the appropriate image based on the --target flag, mounts the project source and toolchain, and runs cargo build/test inside the container. The tool also supports remote Docker execution, custom Dockerfiles, and advanced configuration via Cross.toml and environment variables. The codebase is structured as a Rust CLI with two binaries (cross and cross-util), a library of container orchestration modules, and a developer xtask workspace for CI, codegen, and changelog management. It demonstrates strong engineering practices with extensive CI, testing, and reusable patterns for command execution, container abstraction, and configuration merging. The repository includes a large collection of Dockerfiles and shell scripts for building target-specific toolchain images, as well as CI workflows that test across many platforms and container engines.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 5 reusable components found
nix-community/naersk ★ 1010 101 APPLICATION

Naersk is a Nix library that automates building Rust projects by parsing `Cargo.lock` and creating Nix derivations for dependencies and the final binary. It leverages Nix's sandboxing and caching to achieve reproducible and incremental builds. The library exposes a single entry point, `buildPackage`, which accepts a source directory (or attribute set) and returns a derivation. Internally, it implements a two-phase build: first compiling all dependencies into a cached derivation, then compiling the user's crate with those pre-built dependencies. This architecture optimizes rebuild times when only the application code changes. Key capabilities include support for git dependencies, workspace crates, custom `rustc`/`cargo` toolchains, cross-compilation (via `CARGO_BUILD_TARGET`), and automatic crate-specific overrides (e.g., adding `openssl` and `pkg-config` for the `openssl-sys` crate). The codebase is implemented entirely in pure Nix, showcasing advanced Nix patterns like recursive toml serialization, generic closure traversal, and dynamic source stub generation. The project is actively maintained, has a comprehensive test suite (fast and slow), and is widely used in the Nix ecosystem.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 2 reusable components found
rustsec/rustsec ★ 1949 196 APPLICATION

The RustSec monorepo is a multi-crate workspace that provides the official security audit toolchain for the Rust ecosystem. Its flagship product is `cargo-audit`, a CLI subcommand for Cargo that scans `Cargo.lock` files against the RustSec Advisory Database to detect known vulnerabilities, unmaintained or unsound crates, and yanked packages. The workspace also includes the `rustsec` core library for managing the advisory database (fetched via git, indexed, and queried), `cargo-lock` for parsing and manipulating Cargo.lock files (supporting V1 through V4 format), `cvss` for parsing and scoring CVSS vectors (v2.0, v3.x, v4.0), `platforms` for programmatic access to Rust target triples, and `admin` for maintaining the advisory database and generating the rustsec.org website. Although primarily an application and library toolset, the repository has data-oriented aspects: the advisory database is a curated set of Markdown files with TOML front matter, and `platforms` is auto-generated from rustc target information. The architecture is modular, with each crate independently usable and well-tested, and CI pipelines ensure cross-platform releases and static analysis.

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 3 reusable components found
── end of results ──
$ submit: