Add script and CI to make sure `ring` doesn't show up in arti/full

See arti#493.
This commit is contained in:
Nick Mathewson 2022-06-16 08:59:45 -04:00
parent 19679a6f13
commit c16b32f1d4
2 changed files with 27 additions and 1 deletions

View File

@ -43,16 +43,18 @@ rust-checks:
script: script:
- rustup show - rustup show
- rustup component add rustfmt - rustup component add rustfmt
- ./maint/via-cargo-install-in-ci cargo-audit cargo-sort cargo-license - ./maint/via-cargo-install-in-ci cargo-audit cargo-sort cargo-license cargo-tree
- cargo fmt -- --check - cargo fmt -- --check
- ./maint/check_licenses - ./maint/check_licenses
- ./maint/cargo_audit - ./maint/cargo_audit
- ./maint/cargo_sort - ./maint/cargo_sort
- ./maint/check_tree
cache: cache:
paths: paths:
- cargo-audit - cargo-audit
- cargo-sort - cargo-sort
- cargo-license - cargo-license
- cargo-tree
rust-latest: rust-latest:
stage: build stage: build

24
maint/check_tree Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
#
# Use cargo-tree to check our dependencies for crates which we must
# not depend on unconditionally.
forbid () {
local our_crate="$1"
local feature="$2"
local forbidden="$3"
if cargo tree -i "$forbidden" -p "$our_crate" --features "$feature" 2>/dev/null ; then
echo "Uh-oh: $forbidden has shown up in $our_crate/$feature."
exit 1
else
echo "Didn't find $forbidden in $our_crate/$feature. Good."
fi
}
# We can't use these crates in arti/full, since they expose us to the old
# OpenSSL (3BSD + SSLeay) license.
forbid arti full ring
forbid arti full webpki
echo "Everything looks fine."