Commit 057feb5c authored by Sebastien Marchand's avatar Sebastien Marchand Committed by Commit Bot

Fix histogram_paths.py on Windows

There's 2 issues with histogram_paths.py on Windows:
  - Some path have different casing on Win vs Linux, see
    crbug.com/1132974 . This is not the right way to fix this but this
    allows running histogram_paths.py on Windows.
  - Normalizing the path separators after sorting them causes some
    sorting differences (this causes
    "tools/metrics/histograms/histograms_xml/renderer4/histograms.xml"
    to appear before
    "tools/metrics/histograms/histograms_xml/renderer/histograms.xml" on
    Windows.


Bug: 1132974
Change-Id: Id6953f29f2073551df9a13cc2c72d2e6eef33cd5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2436293Reviewed-by: default avatarWeilun Shi <sweilun@chromium.org>
Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Commit-Queue: Alexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#811401}
parent f690d472
......@@ -13,17 +13,18 @@ import path_util
def _FindHistogramsXmlFiles():
"""Gets a list relative path to all histograms xmls under histograms_xml/."""
file_list = []
for dirName, _, fileList in os.walk(PATH_TO_HISTOGRAMS_XML_DIR):
for filename in fileList:
files = []
for dir_name, _, file_list in os.walk(PATH_TO_HISTOGRAMS_XML_DIR):
for filename in file_list:
if (filename == 'histograms.xml'
or filename == 'histogram_suffixes_list.xml'):
# Compute the relative path of the histograms xml file.
file_path = os.path.relpath(os.path.join(dirName, filename),
file_path = os.path.relpath(os.path.join(dir_name, filename),
PATH_TO_HISTOGRAMS_XML_DIR)
file_list.append(
os.path.join('tools/metrics/histograms/histograms_xml', file_path))
return sorted(file_list)
files.append(
os.path.join('tools/metrics/histograms/histograms_xml',
file_path).replace(os.sep, '/').lower())
return sorted(files)
ENUMS_XML_RELATIVE = 'tools/metrics/histograms/enums.xml'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment