Skip to content

Commit 0aaa129

Browse files
committed
contrib: fix check-deps.sh when libraries do not import symbols
Script was failing when called on libraries that do not import symbols, because bash pipefail option was specified, and grep was used in some pipelines to filter symbols, and grep returns status 1 when it doesn't match any lines. This could cause the script to fail on some systems and configurations, such as the clang-tidy CI configuration https://cirrus-ci.com/task/4801670352207872?logs=ci#L6191 where the libbitcoin_crypto_x86_shani.a library does not import symbols.
1 parent 3c99f5a commit 0aaa129

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/devtools/check-deps.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ extract_symbols() {
7575
local temp_dir="$1"
7676
for lib in "${!LIBS[@]}"; do
7777
for lib_path in ${LIBS[$lib]}; do
78-
nm -o "$lib_path" | grep ' T \| W ' | awk '{print $3, $1}' >> "${temp_dir}/${lib}_exports.txt"
79-
nm -o "$lib_path" | grep ' U ' | awk '{print $3, $1}' >> "${temp_dir}/${lib}_imports.txt"
78+
nm -o "$lib_path" | { grep ' T \| W ' || true; } | awk '{print $3, $1}' >> "${temp_dir}/${lib}_exports.txt"
79+
nm -o "$lib_path" | { grep ' U ' || true; } | awk '{print $3, $1}' >> "${temp_dir}/${lib}_imports.txt"
8080
awk '{print $1}' "${temp_dir}/${lib}_exports.txt" | sort -u > "${temp_dir}/${lib}_exported_symbols.txt"
8181
awk '{print $1}' "${temp_dir}/${lib}_imports.txt" | sort -u > "${temp_dir}/${lib}_imported_symbols.txt"
8282
done

0 commit comments

Comments
 (0)