Merge branch 'check_all_lockfiles' into 'main'

Add maint/check_all_lockfiles

See merge request tpo/core/arti!1468
This commit is contained in:
Nick Mathewson 2023-08-03 20:07:33 +00:00
commit d7f7a7751f
2 changed files with 20 additions and 0 deletions

View File

@ -69,6 +69,7 @@ rust-checks:
- ./maint/check_licenses
- ./maint/cargo_sort
- ./maint/check_tree
- ./maint/check_all_lockfiles
cache:
paths:
- cargo-sort

19
maint/check_all_lockfiles Executable file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env bash
#
# Everywhere we have a Cargo.lock checked into git, check that it's usable.
#
# This avoids doing a full `cargo check` which actually compiles the crates.
# Our needs are closer to `cargo verify-project`, but we do want to check
# the entire dependency tree without compiling anything.
#
# The approach we use now is to run `cargo tree --locked`, which catches
# missing dependencies relatively quickly.
#
set -eu
for subdir in $(git ls-files | sed -n 's/^/.\//;s/Cargo.lock$//p'); do
echo
echo "---- Checking $subdir"
(cd "$subdir" && cargo tree --locked > /dev/null)
done