forked from signalapp/libsignal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
And set up a script to catch them in the future.
- Loading branch information
1 parent
02e03ee
commit 53ba4c2
Showing
4 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# | ||
# Copyright 2024 Signal Messenger, LLC. | ||
# SPDX-License-Identifier: AGPL-3.0-only | ||
# | ||
|
||
set -euo pipefail | ||
|
||
SCRIPT_DIR=$(dirname "$0") | ||
cd "${SCRIPT_DIR}"/.. | ||
. bin/build_helpers.sh | ||
|
||
# Get the list of *handled* error codes and the list of *declared* error codes and compare them. | ||
# When modifying this script, be mindful of potential differences between GNU grep and BSD grep. | ||
if ! diff -U 1 -L 'Codes handled in Error.swift' -L 'Codes declared in signal_ffi.h' \ | ||
<(grep -o -E 'case SignalErrorCode[^:]+' swift/Sources/LibSignalClient/Error.swift | cut -d' ' -f 2 | sort -u) \ | ||
<(grep -o -E '^ SignalErrorCode[^,]+' swift/Sources/SignalFfi/signal_ffi.h | grep -v 'UnknownError' | cut -d' ' -f 3 | sort -u) | ||
then | ||
printf '\n=== Make sure Error.swift is in sync with the error codes declared in Rust! ===\n\n' >&2 | ||
exit 1 | ||
fi |