The Rust package manager https://doc.rust-lang.org/cargo
  • Rust 96.1%
  • Roff 3.6%
  • JavaScript 0.2%
  • Shell 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Weihang Lo 2be5575ba3
Allow uncommon_codepoints in confusable test (#17676)
https://github.com/rust-lang/rust/pull/165289 updates the Unicode
version used by the lexer to 18, which includes a new set of characters
firing `uncommon_codepoints`. Allow this in a test to prevent failures
there.
2026-11-03 00:17:39 +00:00
.cargo feat: Add a typos CI job 2025-11-12 10:39:43 -07:00
.github chore(deps): update rust-lang/crates-io-auth-action action to v1.0.6 (#17670) 2026-11-02 13:36:25 +00:00
benches chore: Update imports for workspace rename 2026-07-17 14:14:20 -05:00
ci refactor(help): embed man pages without a tarball 2026-10-24 20:49:48 -04:00
crates Fix manifest schema generation: TomlOptLevel and StringOrVec (#17660) 2026-10-30 17:00:37 +00:00
credential chore: Bump versions of crates with MSRV changes 2026-10-07 10:14:14 -06:00
doc remove deprecated tempdir 2026-10-29 22:46:00 +01:00
etc refactor: Rename internal content from target-triple to target-tuple 2026-09-29 10:19:51 -05:00
src doc: update outdated registry function comments 2026-10-30 08:46:35 +10:00
tests Allow uncommon_codepoints in confusable test 2026-11-02 23:42:46 +00:00
.git-blame-ignore-revs Ignore rustfmt 2024 commit 2025-07-05 19:51:10 -07:00
.gitignore chore: Move src/doc/ to doc/ 2026-07-17 11:20:52 -05:00
.ignore chore: Move src/doc/ to doc/ 2026-07-17 11:20:52 -05:00
build.rs chore: Move the delay-load list out of windows_manifest 2026-10-28 13:08:08 -07:00
Cargo.lock refactor(cargo-test-support): remove build.rs 2026-10-24 10:06:41 -04:00
Cargo.toml refactor(help): embed man pages without a tarball 2026-10-24 20:49:48 -04:00
CHANGELOG.md Fix changelog link 2025-02-04 06:11:14 -08:00
clippy.toml Disallow using stdlib's HashMap/HashSet and IndexMap/IndexSet data structures 2026-07-05 23:06:18 -04:00
CODE_OF_CONDUCT.md Add CoC 2023-01-25 10:18:15 +00:00
CONTRIBUTING.md docs: adopt rust-lang/rust's LLM usage policy 2026-08-07 22:38:46 -04:00
deny.toml Update all dependencies 2025-02-09 15:50:36 -08:00
LICENSE-APACHE HTTPS all the things 2019-01-30 15:34:37 -05:00
LICENSE-MIT Remove inaccurate (misattributed) copyright notices 2017-07-26 17:19:24 -07:00
LICENSE-THIRD-PARTY HTTPS all the things 2019-01-30 15:34:37 -05:00
publish.py refactor(term): Create a no-op cargo-util-terminal 2026-03-27 16:51:48 -05:00
README.md chore: Removed the Code Status section from README.md 2026-09-21 23:49:06 +09:00
rustfmt.toml Rustfmt 2024 2025-07-05 19:50:36 -07:00
triagebot.toml chore: Add Muscraft to the review rotation 2026-09-14 07:57:18 -06:00
typos.toml chore: Allow secur32 in typos 2026-10-27 14:12:38 -07:00
windows.manifest.xml Add a windows manifest file 2023-12-07 14:24:58 +00:00

Cargo

Cargo downloads your Rust project’s dependencies and compiles your project.

To start using Cargo, learn more at The Cargo Book.

To start developing Cargo itself, read the Cargo Contributor Guide.

The Cargo binary distributed through with Rust is maintained by the Cargo team for use by the wider ecosystem. For all other uses of this crate (as a binary or library) this is maintained by the Cargo team, primarily for use by Cargo and not intended for external use (except as a transitive dependency). This crate may make major changes to its APIs.

Compiling from Source

Requirements

Cargo requires the following tools and packages to build:

Other requirements:

The following are optional based on your platform and needs.

  • pkg-config — This is used to help locate system packages, such as libssl headers/libraries. This may not be required in all cases, such as using vendored OpenSSL, or on Windows.

  • OpenSSL — Only needed on Unix-like systems and only if the vendored-openssl Cargo feature is not used.

    This requires the development headers, which can be obtained from the libssl-dev package on Ubuntu or openssl-devel with apk or yum or the openssl package from Homebrew on macOS.

    If using the vendored-openssl Cargo feature, then a static copy of OpenSSL will be built from source instead of using the system OpenSSL. This may require additional tools such as perl and make.

    On macOS, common installation directories from Homebrew, MacPorts, or pkgsrc will be checked. Otherwise it will fall back to pkg-config.

    On Windows, the system-provided Schannel will be used instead.

    LibreSSL is also supported.

Optional system libraries:

The build will automatically use vendored versions of the following libraries. However, if they are provided by the system and can be found with pkg-config, then the system libraries will be used instead:

  • libcurl — Used for network transfers.
  • libgit2 — Used for fetching git dependencies.
  • libssh2 — Used for SSH access to git repositories.
  • libz (AKA zlib) — Used by the above C libraries for data compression. (Rust code uses zlib-rs instead.)

It is recommended to use the vendored versions as they are the versions that are tested to work with Cargo.

Compiling

First, you'll want to check out this repository

git clone https://github.com/rust-lang/cargo.git
cd cargo

With cargo already installed, you can simply run:

cargo build --release

Adding new subcommands to Cargo

Cargo is designed to be extensible with new subcommands without having to modify Cargo itself. See the Wiki page for more details and a list of known community-developed subcommands.

Releases

Cargo releases coincide with Rust releases. High level release notes are available as part of Rust's release notes. Detailed release notes are available in the changelog.

Reporting issues

Found a bug? We'd love to know about it!

Please report all issues on the GitHub issue tracker.

Contributing

See the Cargo Contributor Guide for a complete introduction to contributing to Cargo.

Code documentation: https://doc.rust-lang.org/nightly/nightly-rustc/cargo/

License

Cargo is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE and LICENSE-MIT for details.

Third party software

This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (https://www.openssl.org/).

In binary form, this product includes software that is licensed under the terms of the GNU General Public License, version 2, with a linking exception, which can be obtained from the upstream repository.

See LICENSE-THIRD-PARTY for details.