Makefile.in        |    2 +-
 bin/symbolstore.py |   38 +++++++++++++++++++++++++++++++-------
 2 files changed, 32 insertions(+), 8 deletions(-)

New commits:
commit 65dee56eed2111dfbe923ef82b3ba41a4c5edf75
Author:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
AuthorDate: Thu Jun 17 14:46:03 2021 +0200
Commit:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
CommitDate: Fri Jun 18 15:03:44 2021 +0200

    don't ignore dump_syms errors during symbol extraction
    
    also fix the file filtering in case directories are passed for recursive
    traversal (pdb files are not created in instdir, so that never really
    matched our build-env)
    Pass a directory to the invocation to make use of that filtering, and
    also add a retry in case dump_syms segfaults during processing
    (see also 73299faa75a4974eb49c93ffdfb2d6329cb4e519)
    
    Change-Id: I8989c3fd72de0b18eecce490fac81db956f87515
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117386
    Tested-by: Jenkins
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
    (cherry picked from commit 960b2878cb504f10a27b24714d3c81bba6f48634)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117306

diff --git a/Makefile.in b/Makefile.in
index b6a93cdeb8c6..f9a2644e569a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -430,7 +430,7 @@ symbols:
        rm -fr $(WORKDIR)/symbols/
        mkdir -p $(WORKDIR)/symbols/
 ifeq ($(OS),WNT)
-       $(SRCDIR)/bin/symbolstore.py 
$(WORKDIR)/UnpackedTarball/breakpad/src/tools/windows/dump_syms/Release/dump_syms.exe
 $(WORKDIR)/symbols/ $(INSTDIR)/program/*
+       $(SRCDIR)/bin/symbolstore.py 
$(WORKDIR)/UnpackedTarball/breakpad/src/tools/windows/dump_syms/Release/dump_syms.exe
 $(WORKDIR)/symbols/ $(INSTDIR)/program/
        $(SRCDIR)/bin/symstore.sh
 else
        $(SRCDIR)/bin/symbolstore.py 
$(WORKDIR)/UnpackedTarball/breakpad/src/tools/linux/dump_syms/dump_syms 
$(WORKDIR)/symbols/ $(INSTDIR)/program/*
diff --git a/bin/symbolstore.py b/bin/symbolstore.py
index 1f80e2f69e99..2101e396153b 100755
--- a/bin/symbolstore.py
+++ b/bin/symbolstore.py
@@ -452,12 +452,17 @@ class Dumper:
                             if filename.startswith("cvs"):
                                 (ver, checkout, source_file, revision) = 
filename.split(":", 3)
                                 sourceFileStream += sourcepath + "*MYSERVER*" 
+ source_file + '*' + revision + "\r\n"
-                            f.write("FILE %s %s\n" % (index, filename))
+                            f.write("FILE %s %s\r\n" % (index, filename))
                         else:
                             # pass through all other lines unchanged
                             f.write(line)
                     f.close()
-                    cmd.close()
+                    command_exit = cmd.close()
+                    if command_exit:
+                        if command_exit == 11:
+                            print >> sys.stderr, "INFO: dump_syms segfault 
while processing {}, retrying".format(file)
+                            return self.ProcessFile(file)
+                        raise Exception("ERROR - dump_syms error while 
processing {} (exit code {})".format(file, command_exit))
                     # we output relative paths so callers can get a list of 
what
                     # was generated
                     print rel_path
@@ -468,6 +473,7 @@ class Dumper:
                         result = self.SourceServerIndexing(debug_file, guid, 
sourceFileStream, cvs_root)
                     result = True
             except StopIteration:
+                print >> sys.stderr, "WARN: dump_syms - no debug info 
extracted for {}".format(file)
                 pass
             except:
                 print >> sys.stderr, "Unexpected error: ", sys.exc_info()[0]
@@ -483,11 +489,29 @@ class Dumper_Win32(Dumper):
     def ShouldProcess(self, file):
         """This function will allow processing of pdb files that have dll
         or exe files with the same base name next to them."""
-        if file.endswith(".pdb"):
-            (path,ext) = os.path.splitext(file)
-            if os.path.isfile(path + ".exe") or os.path.isfile(path + ".dll") 
or os.path.isfile(path + ".bin"):
-                return True
-        return False
+
+        skip_extensions = [
+           ".bat", ".class", ".config", ".css", ".glsl", ".hrc", ".ini", 
".jar", ".mo", ".msu",
+           ".ods", ".png", ".py", ".pyc", ".rdb", ".rst", ".sh", ".svg", 
".ttf", ".txt", ".xml",
+        ]
+        (path,ext) = os.path.splitext(file)
+        basename = os.path.basename(file)
+        if ext in skip_extensions:
+           return False
+        elif os.path.getsize(file) == 21:
+           # content is the "invalid - merged lib" stub
+           return False
+        elif basename.startswith("LICENSE") or basename.startswith("README"):
+           return False
+        elif basename == "msvcp140.dll" or basename == "vcruntime140.dll":
+           return False
+        elif basename.startswith("wininst-") or basename == "fetch_macholib" 
or basename == "command_template":
+           # ignore python distutils stubs and scripts
+           return False
+        elif ext == "":
+           print >> sys.stderr, "INFO: Skipping {}, has no 
extension".format(file)
+           return False
+        return True
 
     def FixFilenameCase(self, file):
         """Recent versions of Visual C++ put filenames into
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to