[Libreoffice-commits] core.git: bin/symstore.sh

Juergen Funk (via logerrit) logerrit at kemper.freedesktop.org
Tue Dec 17 09:27:32 UTC 2019


 bin/symstore.sh |   68 ++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 59 insertions(+), 9 deletions(-)

New commits:
commit 6ca3adf22b62b88b313c8fc9311183efdabe445a
Author:     Juergen Funk <juergen.funk_ml at cib.de>
AuthorDate: Tue Nov 26 08:06:39 2019 +0100
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Tue Dec 17 10:26:25 2019 +0100

    symstore.sh: collect PDBs for *all* artifacts
    
    - a number of external library PDBs where missing
    - also the soffice.bin and unopkg.bin (renaming that to *.bin.pdb)
    
    Change-Id: Idafcce87bfefadfa669807a861efab76b4122c62
    Reviewed-on: https://gerrit.libreoffice.org/83726
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

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


More information about the Libreoffice-commits mailing list