Skip to content

Commit d2a8df2

Browse files
committed
ci: trace more verbosely to facilitate debugging
This also changes the `check-for-missing-dlls` script a bit so that its output is not gargantuan. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 4a17cd3 commit d2a8df2

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ jobs:
345345
- name: build build-installers-${{ matrix.arch.name }} artifact
346346
shell: bash
347347
run: |
348+
set -x &&
348349
INCLUDE_OBJDUMP=t \
349350
./please.sh create-sdk-artifact \
350351
--architecture=${{ matrix.arch.name }} \
@@ -354,10 +355,11 @@ jobs:
354355
cygpath -aw "$PWD/sdk-artifact/usr/bin/core_perl" >>$GITHUB_PATH &&
355356
cygpath -aw "$PWD/sdk-artifact/usr/bin" >>$GITHUB_PATH &&
356357
cygpath -aw "$PWD/sdk-artifact/${{ matrix.arch.mingw-prefix }}/bin" >>$GITHUB_PATH &&
357-
echo "MSYSTEM=${{ matrix.arch.msystem }}" >>$GITHUB_ENV
358+
echo "MSYSTEM=${{ matrix.arch.msystem }}" >>$GITHUB_ENV &&
359+
cat $GITHUB_PATH
358360
- name: check for missing DLLs
359361
shell: bash
360-
run: ./check-for-missing-dlls.sh
362+
run: sh -x ./check-for-missing-dlls.sh
361363
- name: check for missing DLLs (MinGit)
362364
shell: bash
363365
run: MINIMAL_GIT=1 ./check-for-missing-dlls.sh

check-for-missing-dlls.sh

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,38 +47,36 @@ unused_dlls_file=/tmp/unused-dlls.$$.txt
4747
tmp_file=/tmp/tmp.$$.txt
4848
trap "rm \"$used_dlls_file\" \"$missing_dlls_file\" \"$unused_dlls_file\" \"$tmp_file\"" EXIT
4949

50-
all_files="$(export ARCH && "$thisdir"/make-file-list.sh | tr A-Z a-z | grep -v '/getprocaddr64.exe$')" &&
51-
usr_bin_dlls="$(echo "$all_files" | grep '^usr/bin/[^/]*\.dll$')" &&
52-
mingw_bin_dlls="$(echo "$all_files" | grep '^'$MINGW_PREFIX'/bin/[^/]*\.dll$')" &&
53-
dirs="$(echo "$all_files" | sed -n 's/[^/]*\.\(dll\|exe\)$//p' | sort | uniq)" &&
50+
ARCH=$ARCH "$thisdir"/make-file-list.sh | tr A-Z a-z | grep -v '/getprocaddr64.exe$' >"$tmp_file.all" &&
51+
usr_bin_dlls="$(grep '^usr/bin/[^/]*\.dll$' "$tmp_file.all")" &&
52+
mingw_bin_dlls="$(grep '^'$MINGW_PREFIX'/bin/[^/]*\.dll$' "$tmp_file.all")" &&
53+
dirs="$(sed -n 's/[^/]*\.\(dll\|exe\)$//p' "$tmp_file.all" | sort | uniq)" &&
5454
for dir in $dirs
5555
do
5656
test -z "$print_dir" ||
5757
printf "dir: $dir\\033[K\\r" >&2
5858

5959
case "$dir" in
60-
usr/*) dlls="$sys_dlls$LF$usr_bin_dlls$LF";;
61-
$MINGW_PREFIX/*) dlls="$sys_dlls$LF$mingw_bin_dlls$LF";;
62-
*) dlls="$sys_dlls$LF";;
60+
usr/*) dlls="$usr_bin_dlls$LF";;
61+
$MINGW_PREFIX/*) dlls="$mingw_bin_dlls$LF";;
62+
*) dlls="";;
6363
esac
6464

65-
paths=$(echo "$all_files" |
66-
sed -ne 's,[][],\\&,g' -e "s,^$dir[^/]*\.\(dll\|exe\)$,/&,p")
67-
out="$(/usr/bin/objdump -p $paths 2>"$tmp_file")"
65+
paths=$(sed -ne 's,[][],\\&,g' -e "s,^$dir[^/]*\.\(dll\|exe\)$,/&,p" "$tmp_file.all")
66+
/usr/bin/objdump -p $paths 2>"$tmp_file" >"$tmp_file.ldd"
6867
paths="$(sed -n 's|^/usr/bin/objdump: \([^ :]*\): file format not recognized|\1|p' <"$tmp_file")"
6968
test -z "$paths" ||
70-
out="$out$LF$(ldd $paths)"
69+
ldd $paths >>"$tmp_file.ldd"
7170

72-
echo "$out" |
73-
tr A-Z\\r a-z\ |
71+
tr A-Z\\r a-z\ <"$tmp_file.ldd" |
7472
grep -e '^.dll name:' -e '^[^ ]*\.\(dll\|exe\):' -e '\.dll =>' |
7573
while read a b c d
7674
do
7775
case "$a,$b" in
7876
*.exe:,*|*.dll:,*) current="${a%:}";;
7977
*.dll,"=>") # `ldd` output
8078
echo "$a" >>"$used_dlls_file"
81-
case "$dlls" in
79+
case "$sys_dlls$LF$dlls" in
8280
*"/$a$LF"*) ;; # okay, it's included
8381
*)
8482
echo "$current is missing $a" >&2
@@ -88,7 +86,7 @@ do
8886
;;
8987
dll,name:) # `objdump -p` output
9088
echo "$c" >>"$used_dlls_file"
91-
case "$dlls" in
89+
case "$sys_dlls$LF$dlls" in
9290
*"/$c$LF"*) ;; # okay, it's included
9391
*)
9492
echo "$current is missing $c" >&2
@@ -106,8 +104,7 @@ used_dlls_regex="/\\($(test -n "$MINIMAL_GIT" || printf 'p11-kit-trust\\|';
106104
uniq |
107105
sed -e 's/+x/\\+/g' -e 's/\.dll$/\\|/' -e '$s/\\|//' |
108106
tr -d '\n')\\)\\.dll\$"
109-
echo "$all_files" |
110-
grep '\.dll$' |
107+
grep '\.dll$' "$tmp_file.all" |
111108
grep -v \
112109
-e "$used_dlls_regex" \
113110
-e '^usr/lib/perl5/' \

0 commit comments

Comments
 (0)