summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJuergen Funk <juergen.funk_ml@cib.de>2019-11-04 10:42:06 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2020-04-21 17:17:54 +0200
commitc9408eceb0274c6c3bc6d726433af990bf34995b (patch)
treeeb169452ec2dbee9bf177e6a2ee40c8e2010e9c9 /bin
parent984a240975b87eff10ccda394de9e7ea0078ed30 (diff)
tdf#127711 - A runtime-switch for the MiniCrashDump and associated changes
- add CrashDumpEnable to soffice.ini - also check env var CRASH_DUMP_ENABLE (overrides soffice.ini) - make sure _all_ binaries are added to symstore This is a squash of: https://gerrit.libreoffice.org/79273 https://gerrit.libreoffice.org/81989 https://gerrit.libreoffice.org/c/core/+/87260 https://gerrit.libreoffice.org/c/core/+/87261 https://gerrit.libreoffice.org/79272 https://gerrit.libreoffice.org/83171 https://gerrit.libreoffice.org/82751 https://gerrit.libreoffice.org/83066 https://gerrit.libreoffice.org/83726 https://gerrit.libreoffice.org/c/core/+/86465
Diffstat (limited to 'bin')
-rwxr-xr-xbin/symstore.sh93
1 files changed, 75 insertions, 18 deletions
diff --git a/bin/symstore.sh b/bin/symstore.sh
index b368eb3e6715..564739a0279f 100755
--- a/bin/symstore.sh
+++ b/bin/symstore.sh
@@ -1,30 +1,75 @@
#!/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" ]; 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
-if [ -z "${INSTDIR}" ] || [ -z "${WORKDIR}" ]; then
+if [ -z "${INSTDIR}" -o -z "${WORKDIR}" ]; then
echo "INSTDIR or WORKDIR not set - script expects calling inside buildenv"
exit 1
fi
-if [ ! -d "${INSTDIR}" ] || [ ! -d "${WORKDIR}" ]; then
+if [ ! -d "${INSTDIR}" -o ! -d "${WORKDIR}" ]; then
echo "INSTDIR or WORKDIR not present - script expects calling after full build"
exit 1
fi
@@ -36,12 +81,17 @@ which symstore.exe > /dev/null 2>&1 || {
# defaults
MAX_KEEP=5
SYM_PATH=${WORKDIR}/symstore
+COMMENT=""
+COMCMD=""
+WITHEXEC=1
USAGE="Usage: $0 [-h|-k <keep_num_versions>|-p <symbol_store_path>]
- -h: this cruft
- -k <int>: keep this number of old symbol versions around
- (default: ${MAX_KEEP}. Set to 0 for unlimited)
- -p <path>: specify full path to symbol store tree
+ -h: this cruft
+ -c <comment> specifies a comment for the transaction
+ -n do not store exe/dll on the symbole server
+ -k <int>: keep this number of old symbol versions around
+ (default: ${MAX_KEEP}. Set to 0 for unlimited)
+ -p <path>: specify full path to symbol store tree
If no path is specified, defaults to ${SYM_PATH}.
"
@@ -51,7 +101,9 @@ do
case "$1" in
-k|--keep) MAX_KEEP="$2"; shift 2;;
-p|--path) SYM_PATH="$2"; shift 2;;
- -h|--help) echo "${USAGE}"; exit 0; shift;;
+ -c|--comment) COMCMD="/c"; COMMENT="$2"; shift 2;;
+ -n|--noexec) WITHEXEC=0; shift ;;
+ -h|--help) echo "${USAGE}"; exit 0;;
-*) echo "${USAGE}" >&2; exit 1;;
*) break;;
esac
@@ -66,20 +118,25 @@ 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}"
+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}"
rm -f "${TMPFILE}"
# Cleanup symstore, older revisions will be removed. Unless the
# .dll/.exe changes, the .pdb should be shared, so with incremental
# tinderbox several revisions should not be that space-demanding.
-if [ "${MAX_KEEP}" -gt 0 ] && [ -d "${SYM_PATH}/000Admin" ]; then
+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