0
0
mirror of https://github.com/signalapp/libsignal.git synced 2024-09-20 03:52:17 +02:00
libsignal/bin/verify_duplicate_crates
Jordan Rose e94dc9cf3c verify_duplicate_crates: Use improved --edges no-proc-macro
Previously this didn't compose correctly with `--duplicates` (`-d`),
but now it prunes out dependencies in proc-macros just like we already
were for non-"normal" dependencies (build and dev), allowing us to
maintain our focus on code size.

While here, prefer long forms of flags for more readable code, and
improve the comments around the dependencies we can't avoid
duplicating.
2023-09-14 06:25:59 -07:00

26 lines
731 B
Bash
Executable File

#!/bin/bash
#
# Copyright 2021 Signal Messenger, LLC.
# SPDX-License-Identifier: AGPL-3.0-only
#
# To keep code size down, we try to avoid depending on multiple versions of crates.
#
# For now, these dependencies have conflicting requirements.
# You can use the `cargo tree` command below to see where they come from,
# and then document them here.
#
# bitflags:
# mostly provides a macro, with only a small bit of code that actually
# makes it into the final build.
EXPECTED="\
bitflags v1.3.2
bitflags v2.3.3"
if [[ "$(cargo tree --duplicates --edges normal,no-proc-macro --workspace --locked --depth 0)" != "${EXPECTED}" ]]; then
cargo tree --duplicates --edges normal,no-proc-macro --workspace --locked
exit 1
fi