Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,19 @@ incremental = true
[profile.test]
debug = "line-tables-only"
incremental = false

# rust-lld ships with the Rust toolchain (no extra install) and links
# 2-5x faster than MSVC's link.exe on link-heavy rebuilds. The dev
# profile already lives in the hot iteration loop; cutting the link
# step is the biggest single win there. Set per Windows target so
# unix/macos builds keep their platform default linker.
#
# Escape hatch if rust-lld trips on a foreign object file:
# RUSTFLAGS="-C linker=link.exe" cargo build
#
# See fbuild#744 and zackees/template-python-rust-cmd#2.
[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"

[target.aarch64-pc-windows-msvc]
linker = "rust-lld.exe"
11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,14 @@ homepage = "https://github.com/example/template-python-rust-cmd"
[workspace.dependencies]
anyhow = "1"
pyo3 = { version = "0.23", features = ["extension-module"] }

# Keep third-party crates release-grade even in the dev profile.
# `cargo build` (no --release) compiles first-party crates unoptimized
# for fast iteration; third-party deps (pyo3, serde, etc.) are compiled
# once and cached at opt-level 3 so the runtime hot path stays as fast
# as a release build. This is what makes "default to dev for local
# iteration" safe — see fbuild#744 (~5x faster Rust-edit rebuild on
# fbuild's workspace) and zackees/template-python-rust-cmd#2.
[profile.dev.package."*"]
opt-level = 3
debug = false
Loading