Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate report hash fix #1235

Merged
merged 1 commit into from
Dec 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions libcodechecker/analyze/plist_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

"""

import os
import plistlib
import sys
import traceback
Expand Down Expand Up @@ -72,7 +73,7 @@ def get_report_hash(diagnostic, source_file):
return report_hash


def parse_plist(path):
def parse_plist(path, source_root=None):
"""
Parse the reports from a plist file.
One plist file can contain multiple reports.
Expand Down Expand Up @@ -102,8 +103,12 @@ def parse_plist(path):

# We need to extend information for plist files generated
# by older clang version (before 3.8).
file_path = files[diag['location']['file']]
if source_root:
file_path = os.path.join(source_root, file_path.lstrip('/'))

main_section['issue_hash_content_of_line_in_context'] = \
get_report_hash(diag, files[diag['location']['file']])
get_report_hash(diag, file_path)

bug_path_items = [item for item in diag['path']]

Expand Down
5 changes: 1 addition & 4 deletions libcodechecker/server/api/report_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -1983,11 +1983,8 @@ def massStoreRun(self, name, tag, version, b64zip, force):
LOG.debug("Parsing input file '" + f + "'")

try:
# FIXME: We are parsing the plists for the
# second time here. Use re-use the
# previous results.
files, reports = plist_parser.parse_plist(
os.path.join(report_dir, f))
os.path.join(report_dir, f), source_root)
except Exception as ex:
LOG.error('Parsing the plist failed: ' + str(ex))
continue
Expand Down