On this page
Cargo, Workspaces & Profiles
Prev: cargo_and_tooling | Up: cargo_and_tooling | Next: Testing, Clippy & Rustdoc
Rel: Maturin, PyO3
Ref: The Cargo Book — Workspaces
Tags: #public #prog #rust #tooling #cargo
Contents
Cargo.toml, Profiles & Cargo.lock
- Commit
Cargo.lockfor binaries/apps (reproducible builds); omit or manage deliberately for published libraries. - Always benchmark and ship with
--release(opt-level = 3); debug builds skip optimizations and enable integer overflow checks.
[package]
name = "fast_core"
version = "0.1.0"
edition = "2024"
[profile.release]
lto = "thin"
codegen-units = 1
Multi-Crate Workspaces
Share a single target/ directory and Cargo.lock across related crates (e.g., pure-Rust core crate + thin py PyO3 binding crate):
[workspace]
members = ["crates/core", "crates/py_bindings"]
resolver = "3"
Linked from
Related notes
- tuts/rust/cargo_and_tooling Linked here; links to this page; shared tags: #cargo, #prog, #rust, #tooling
- tuts/rust/cargo_and_tooling/testing_clippy_and_docs Linked here; links to this page; shared tags: #prog, #rust, #tooling
- tuts/interop/rust_and_python_pyo3_maturin links to this page; shared tags: #prog, #rust
- tuts/third_party/python3/maturin Linked here; shared tags: #prog, #rust
- tuts/third_party/rust/pyo3 Linked here; shared tags: #prog, #rust
- tuts/rust shared tags: #prog, #rust
- tuts/rust/builtins shared tags: #prog, #rust
- tuts/rust/builtins/Clone shared tags: #prog, #rust
- tuts/rust/builtins/Copy shared tags: #prog, #rust
- tuts/rust/builtins/Drop shared tags: #prog, #rust