My new machine setup for Rust
After I’ve got the laptop I described in the previous article, I had multiple attempts to install different flavors of Linux and BSD to find the optimal one, which wiped the binaries and settings I had on the machine.
The binaries and settings I care about are Rust development related.
In this article I will put them all together so that I can easily automate the process later and also get some opinions from others who are doing the same.
So here we go:
This particular setup is done on the latest stable Debian
lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
Install Rust toolchain management:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
To speed up the linkking phase of the compilation, add the following settings:
sudo apt install lld clang
cat ~/.cargo/config.toml
[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "linker=clang", "-C", "link-arg=-fuse-ld=lld"]
For the inner development loop install the following:
cargo install cargo-llvm-cov
rustup component add clippy
rustup component add rustfmt
cargo install cargo-audit
Install VSCode:
echo "code code/add-microsoft-repo boolean true" | sudo debconf-set-selections
sudo apt-get install wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" |sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null
rm -f packages.microsoft.gpg
sudo apt install apt-transport-https
sudo apt update
sudo apt install code # or code-insiders
Install VSCode extensions:
code --install-extension rust-analyzer
code --install-extension ms-rust-analyzer
code --install-extension rust-lang.rust-analyzer
code --install-extension vadimcn.vscode-lldb
code --install-extension tamasfe.even-better-toml
code --install-extension fill-labs.dependi
code --install-extension usernamehw.errorlens
code --install-extension gruntfuggly.todo-tree
code --install-extension github-copilot
code --install-extension github.copilot
How to use the inner development loop.
Inside the project directory run
cargo watch -x check -x test -x run