gecko-dev/toolkit/crashreporter/tools
Ted Mielczarek 6121dea7c8 bug 1392312 - fix filename mapping in symbolstore.py on Windows. r=chmanchester
symbolstore.py processes filenames in FILE lines of symbol files to encode
information about the source repository they came from, or to mark
known generated source files. It also reads the dist/include install
manifest so it can map header files from there back to their source locations.

These mappings were broken on Windows because symbolstore.py first passes
filenames into `FixFilenameCase`, which calls `GetFinalPathNameByHandleW`,
which breaks things in two ways:
1) It returns paths with an uppercase drive letter, and source paths from
   elsewhere have a lowercase drive letter.
2) It resolves symlinks, and on Taskcluster Windows builds the whole build
   is done within a symlinked directory so paths directly from the srcdir
   and objdir won't match those canonicalized paths.

This patch adds a `normpath` function to symbolstore.py and moves the
contents of `FixFilenameCase` into it on Windows, and just makes it
an alias for `os.path.normpath` everywhere else. It then uses it everywhere
we deal with paths that will be compared against source file paths from symbol
files so that all paths are canonicalized the same and we can do simple
string matching from there.

Additionally, this patch adds a check to the functional test to verify
that header files from dist/include are correctly mapped to the source
repository. Unfortunately there is still not a test for generated files
because they only appear in the libxul symbol file, and dumping symbols
from libxul is too slow to invoke as part of a unit test.

MozReview-Commit-ID: Dx3z1BZcIvc

--HG--
extra : rebase_source : 80179bbea58a804344a56ef27f438ada76e7fe77
2017-08-23 13:14:37 -04:00
..
win32
python.ini Bug 1317970 - Use manifestparser manifests for python unit tests, r=chmanchester 2016-11-16 09:59:22 -05:00
symbolstore.py bug 1392312 - fix filename mapping in symbolstore.py on Windows. r=chmanchester 2017-08-23 13:14:37 -04:00
unit-symbolstore.py bug 1392312 - fix filename mapping in symbolstore.py on Windows. r=chmanchester 2017-08-23 13:14:37 -04:00
upload_symbols.py