Skip to content

Commit acf9312

Browse files
committed
Merge branch 'check-for-missing-dlls-i686'
This topic branch fixes the `check-for-missing-dlls.sh` script so that it works correctly in the 32-bit SDK of Git for Windows. If we had had this, and had hooked it up in an Azure Pipeline, we would have caught the problem much earlier where `gpg.exe` stopped working because of a `libnettle` upgrade that broke the dependency chain of `msys-gnutls-30.dll`. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents fe2dcb2 + 6f92a0e commit acf9312

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

check-for-missing-dlls.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ else
3131
fi
3232

3333
used_dlls_file=/tmp/used-dlls.$$.txt
34-
trap "rm \"$used_dlls_file\"" EXIT
34+
tmp_file=/tmp/tmp.$$.txt
35+
trap "rm \"$used_dlls_file\" \"$tmp_file\"" EXIT
3536

3637
all_files="$(export ARCH BITNESS && "$thisdir"/make-file-list.sh | tr A-Z a-z)" &&
3738
usr_bin_dlls="$(echo "$all_files" | grep '^usr/bin/[^/]*\.dll$')" &&
@@ -42,14 +43,21 @@ do
4243
printf "dir: $dir$next_line\\r" >&2
4344

4445
case "$dir" in
45-
usr/*) dlls="$dlls$LF$usr_bin_dlls$LF";;
46-
mingw$BITNESS/*) dlls="$dlls$LF$mingw_bin_dlls$LF";;
46+
usr/*) dlls="$sys_dlls$LF$usr_bin_dlls$LF";;
47+
mingw$BITNESS/*) dlls="$sys_dlls$LF$mingw_bin_dlls$LF";;
4748
*) dlls="$sys_dlls$LF";;
4849
esac
4950

50-
/usr/bin/objdump -p $(echo "$all_files" | sed -ne 's,[][],\\&,g' -e "s,^$dir[^/]*\.\(dll\|exe\)$,/&,p") |
51+
paths=$(echo "$all_files" |
52+
sed -ne 's,[][],\\&,g' -e "s,^$dir[^/]*\.\(dll\|exe\)$,/&,p")
53+
out="$(/usr/bin/objdump -p $paths 2>"$tmp_file")"
54+
paths="$(sed -n 's|^/usr/bin/objdump: \([^ :]*\): file format not recognized|\1|p' <"$tmp_file")"
55+
test -z "$paths" ||
56+
out="$out$LF$(ldd $paths)"
57+
58+
echo "$out" |
5159
tr A-Z\\r a-z\ |
52-
grep -e '^.dll name:' -e '^[^ ]*\.\(dll\|exe\):' |
60+
grep -e '^.dll name:' -e '^[^ ]*\.\(dll\|exe\):' -e '\.dll =>' |
5361
while read a b c d
5462
do
5563
case "$a,$b" in

make-file-list.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,12 @@ grep -v -e '\.[acho]$' -e '\.l[ao]$' -e '/aclocal/' \
164164
-e '^/mingw../share/git\(k\|-gui\)/lib/msgs/' \
165165
-e '^/mingw../share/nghttp2/' \
166166
-e '^/usr/bin/msys-\(db\|curl\|icu\|gfortran\|stdc++\|quadmath\)[^/]*\.dll$' \
167-
-e '^/usr/bin/msys-\(fdisk\|gettextpo\|gmpxx\|gnutlsxx\|gomp\|lzma\|xml2\|xslt\|exslt\)-.*\.dll$' \
167+
-e '^/usr/bin/msys-\('$(if test i686 = "$ARCH"
168+
then
169+
echo 'uuid\|'
170+
else
171+
echo 'lzma\|'
172+
fi)'fdisk\|gettextpo\|gmpxx\|gnutlsxx\|gomp\|xml2\|xslt\|exslt\)-.*\.dll$' \
168173
-e '^/usr/bin/msys-\(hdb\|history8\|kadm5\|kdc\|otp\|sl\).*\.dll$' \
169174
-e '^/usr/bin/msys-\(atomic\|blkid\|charset\|gthread\|metalink\|nghttp2\|pcre2-8\|ssh2\)-.*\.dll$' \
170175
-e '^/usr/bin/msys-\(ncurses++w6\|asprintf-[0-9]*\|\)\.dll$' \

0 commit comments

Comments
 (0)