build: use cargo vendor --locked

This commit is contained in:
Michael Aaron Murphy 2026-01-10 04:48:17 +01:00 committed by Michael Murphy
parent d2d0b51da6
commit c81a6af2cf

View file

@ -2,7 +2,7 @@ cargo-target-dir := env('CARGO_TARGET_DIR', 'target')
# Compile with debug profile
build-debug *args:
cargo build {{args}}
cargo build {{ args }}
# Compile with release profile
build-release *args: (build-debug '--release' args)
@ -12,7 +12,7 @@ build-vendored *args: vendor-extract (build-release '--frozen --offline' args)
# Check for errors and linter warnings
check *args:
cargo clippy --all-features {{args}} -- -W clippy::pedantic
cargo clippy --all-features {{ args }} -- -W clippy::pedantic
# Runs a check with JSON message format for IDE integration
check-json: (check '--message-format=json')
@ -29,23 +29,24 @@ clean-dist: clean
# Run the application for testing purposes
run *args:
env RUST_LOG=debug RUST_BACKTRACE=full cargo run {{args}} --release
env RUST_LOG=debug RUST_BACKTRACE=full cargo run {{ args }} --release
# Run `cargo test`
test *args:
cargo test {{args}}
cargo test {{ args }}
# Vendor Cargo dependencies locally
[no-cd]
vendor:
mkdir -p .cargo
cargo vendor | head -n -1 > .cargo/config.toml
cargo vendor --locked | head -n -1 > .cargo/config.toml
echo 'directory = "vendor"' >> .cargo/config.toml
tar pcf vendor.tar vendor
rm -rf vendor
# Extracts vendored dependencies
[no-cd, private]
[no-cd]
[private]
vendor-extract:
rm -rf vendor
tar pxf vendor.tar