Skill detail

rust-cargo-build

Configures, operates, and diagnoses Cargo for Rust packages, including beginner Cargo workflows, manifests, and build diagnostics.

MatchPossibleRecommended for Beginners
Sourcefull-stack-skills/​rust-skillsExternal source
Reported installs94Popularity signal only

Inspect before use

Read the source instructions and check the requirements before you install this skill.

Saved source preview

SKILL.md

The saved excerpt is a snapshot from when this skill was listed. The external source remains the complete and most current version.

---
name: rust-cargo-build
license: Apache-2.0
description: Configure, operate, diagnose, and automate Cargo for Rust packages and workspaces. Cover manifests and targets, commands, dependency resolution and features, profiles, build scripts, configuration and environment variables, caches and build diagnostics, cross-compilation, registries, packaging, publishing, metadata, CI reproducibility, and stable-versus-nightly feature gates. Use for Cargo.toml, Cargo.lock, .cargo/config.toml, cargo build/check/run/tree/metadata/package/publish, resolver or feature problems, build output and performance, private registries, and beginner Cargo workflows. Route crate selection and supply-chain audits to rust-dependencies, workspace topology to rust-workspace, test design to rust-testing, documentation design to rust-documentation, lint policy to rust-style-clippy, and API compatibility decisions to rust-semver.
---

# Rust Cargo Build System

Use Cargo as a versioned package manager, build orchestrator, and automation interface. Base decisions on the project's actual Cargo version, MSRV, workspace root, targets, and release model. Use the official Cargo Book as the authority; keep this skill focused on task selection, execution, and validation.

## Preflight

Run the smallest relevant subset:

```bash
rustc --version --verbose
cargo --version
cargo locate-project --workspace
cargo metadata --no-deps --format-version 1
```

Determine:

- whether the root manifest is a package or virtual workspace;
- the declared `edition`, `rust-version`, resolver, and lockfile policy;
- selected packages, targets, features, profiles, and target triples;
- dependency sources, registry configuration, and offline constraints;
- whether the requested behavior is stable on the installed Cargo version.

## Route to the Right Reference

Read only the reference needed for the current task:

| Task | Reference |
|---|---|
| Find the authoritative Cargo Guide, Reference, command, or changelog page | [Official Documentation Map](references/official-doc-map.md) |
| Select a Cargo command and understand its side effects | [Cargo Command Map](references/cargo-command-map.md) |
| Start, build, run, test, document, or add CI to a package | [Cargo Guide Workflow](references/cargo-guide-workflow.md) |
| Configure package metadata and lib/bin/example/test/bench targets | [Manifest and Targets](references/manifest-targets.md) |
| Configure dependency sources, features, overrides, or resolvers | [Dependencies, Features, and Resolvers](references/dependencies-features-resolver.md) |
| Configure members and inherited workspace fields | [Workspaces](references/workspaces.md) |
| Configure `.cargo/config.toml`, environment variables, aliases, network, or target settings | [Configuration and Environment](references/configuration-environment.md) |
| Tune dev/release/custom profiles | [Profiles](references/profiles.md) |
| Generate code, compile native dependencies, or emit Cargo instructions from `build.rs` | [Build Scripts](references/build-scripts.md) |
| Diagnose rebuilds, duplicate compilation, cache layout, timings, or future incompatibilities | [Build Cache and Diagnostics](references/build-cache-diagnostics.md) |
| Configure a linker, runner, or non-host target | [Cross-compilation](references/cross-compilation.md) |
| Configure registries, source replacement, vendoring, credentials, or authentication | [Registries and Authentication](references/registries-authentication.md) |
| Inspect package contents, publish, manage owners, or yank a version | [Packaging and Publishing](references/publishing.md) |
| Build scripts and tooling around stable Cargo JSON or package IDs | [Metadata and Automation](references/metadata-automation.md) |
| Evaluate `cargo-features`, `-Z`, or other nightly-only behavior | [Unstable Cargo Features](references/unstable-features.md) |

## Core Workflow

1. **Locate the root** — Confirm the workspace root and effective manifest before editing.
2. **D
Read the full source on GitHub (opens external page)
Context

Related work