summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuergen Funk <juergen.funk_ml@cib.de>2019-11-26 08:06:39 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-01-23 15:49:17 +0100
commitf2ec0b8017bab4263b3003c8b40bbec536d27031 (patch)
tree200bdaa7ecb31a1f6bba0935c6e99b388238c666
parente37503aa5a45046e132127a67cf8749676bdb7ed (diff)
symstore.sh: collect PDBs for *all* artifacts
- a number of external library PDBs where missing Reviewed-on: https://gerrit.libreoffice.org/83726 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 6ca3adf22b62b88b313c8fc9311183efdabe445a) §§{JNKCMD:NoBuild}§§ Change-Id: Idafcce87bfefadfa669807a861efab76b4122c62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87267 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rwxr-xr-xbin/symstore.sh68
1 files changed, 59 insertions, 9 deletions
diff --git a/bin/symstore.sh b/bin/symstore.sh
index 2f7ad2f77610..564739a0279f 100755
--- a/bin/symstore.sh
+++ b/bin/symstore.sh
@@ -1,22 +1,67 @@
#!/usr/bin/env bash
+# Files listed here would not be store in the symbolestore-server.
+# The format is a string with files e.g.
+# BLACKLIST="python.exe
+# file.dll
+# next_file.exe"
+#
+# It removes "python.exe", "file.dll", and "next_file.exe" from what's
+# added to the symstore. Separator is the newline
+BLACK_LIST="python.exe"
+
+# List files here where it's ok for this script to find more than one
+# occurence in the build tree. Files _not_ included here will generate
+# an error, if duplicates are found.
+#
+# Same format as for BLACK_LIST above above
+MOREPDBS_OKLIST="libcurl.dll"
+
+
add_pdb()
{
extension=$1
- type=$2
+ pdbext=$2
list=$3
- for file in $(find "${INSTDIR}/" -name "*.${extension}"); do
+ stats_notfound=0
+ stats_found=0
+ stats_morefound=0
+ declare -a pdball
+ echo "Collect $extension"
+ ret=$(find "${INSTDIR}/" -type f -name "*.${extension}" | grep -vF "$BLACK_LIST")
+ while IFS= read -r file
+ do
# store dll/exe itself (needed for minidumps)
- if [ -f "$file" -a $WITHEXEC == 1 ] ; then
+ if [ $WITHEXEC == 1 ] ; then
cygpath -w "$file" >> "$list"
fi
# store pdb file
filename=$(basename "$file" ".${extension}")
- pdb="${WORKDIR}/LinkTarget/${type}/${filename}.pdb"
- if [ -f "$pdb" ]; then
- cygpath -w "$pdb" >> "$list"
+ pdball+=($(grep -i "/${filename}${pdbext}" <<< ${ALL_PDBS}))
+ if [ -n "${pdball[0]}" ]; then
+ cygpath -w "${pdball[0]}" >> "$list"
fi
- done
+ case ${#pdball[@]} in
+ 0) ((++stats_notfound)) ;;
+ 1) ((++stats_found)) ;;
+ *) ((++stats_morefound))
+ if [ -z "$(echo $file | grep -F "$MOREPDBS_OKLIST")" ]; then
+ echo "Error: found duplicate PDBs:"
+ for morepdbs in ${pdball[@]} ; do
+ echo " $morepdbs"
+ done
+ exit 1
+ fi
+ ;;
+ esac
+ unset pdball
+ done <<EOF
+${ret}
+EOF
+
+ echo " Found PDBs : $stats_found"
+ echo " Missing PDBs : $stats_notfound"
+ echo " Multiple PDBs : $stats_morefound"
}
# check preconditions
@@ -73,9 +118,13 @@ fi
TMPFILE=$(mktemp) || exit 1
trap '{ rm -f ${TMPFILE}; }' EXIT
+# collect all PDBs
+ALL_PDBS=$(find "${WORKDIR}/" -type f -name "*.pdb")
+
# add dlls and executables
-add_pdb dll Library "${TMPFILE}"
-add_pdb exe Executable "${TMPFILE}"
+add_pdb dll .pdb "${TMPFILE}"
+add_pdb exe .pdb "${TMPFILE}"
+add_pdb bin .bin.pdb "${TMPFILE}"
# stick all of it into symbol store
symstore.exe add /compress /f "@$(cygpath -w "${TMPFILE}")" /s "$(cygpath -w "${SYM_PATH}")" /t "${PRODUCTNAME}" /v "${LIBO_VERSION_MAJOR}.${LIBO_VERSION_MINOR}.${LIBO_VERSION_MICRO}.${LIBO_VERSION_PATCH}${LIBO_VERSION_SUFFIX}${LIBO_VERSION_SUFFIX_SUFFIX}" "${COMCMD}" "${COMMENT}"
@@ -87,6 +136,7 @@ rm -f "${TMPFILE}"
if [ "${MAX_KEEP}" -gt 0 -a -d "${SYM_PATH}/000Admin" ]; then
to_remove=$(ls -1 "${SYM_PATH}/000Admin" | grep -v '\.txt' | grep -v '\.deleted' | sort | head -n "-${MAX_KEEP}")
for revision in $to_remove; do
+ echo "Remove $revision from symstore"
symstore.exe del /i "${revision}" /s "$(cygpath -w "${SYM_PATH}")"
done
fi