Skip to content

Commit

Permalink
Make multiprocess store working on OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
vodorok authored and dkrupp committed Nov 12, 2023
1 parent 083aa69 commit e9105b1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion web/client/codechecker_client/blame_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def assemble_blame_info(
# being present in windows, so stuff like setting up
# PYTHONPATH in parent CodeChecker before store is executed
# are lost.
if sys.platform == "win32":
if sys.platform == "win32" or sys.platform == "darwin":
file_blame_info = __collect_blame_info_for_files(file_paths)
else:
with ProcessPoolExecutor() as executor:
Expand Down
13 changes: 12 additions & 1 deletion web/client/codechecker_client/cmd/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,12 @@ def filter_source_files_with_comments(
# being present in windows, so stuff like setting up
# PYTHONPATH in parent CodeChecker before store is executed
# are lost.
if sys.platform == "win32":
if sys.platform == "win32": #or sys.platform == "darwin":
return get_source_file_with_comments(jobs)
elif sys.platform == "darwin":
import multiprocess
with multiprocess.Pool() as pool:
return get_source_file_with_comments(jobs, pool.map)
else:
with ProcessPoolExecutor() as executor:
return get_source_file_with_comments(jobs, executor.map)
Expand Down Expand Up @@ -449,6 +453,13 @@ def assemble_zip(inputs, zip_file, client, checker_labels: CheckerLabels):
if sys.platform == "win32":
analyzer_result_file_reports = parse_analyzer_result_files(
analyzer_result_file_paths, checker_labels)

elif sys.platform == "darwin":
import multiprocess
with multiprocess.Pool() as pool:
analyzer_result_file_reports = parse_analyzer_result_files(
analyzer_result_file_paths, checker_labels, pool.map)

else:
with ProcessPoolExecutor() as executor:
analyzer_result_file_reports = parse_analyzer_result_files(
Expand Down

0 comments on commit e9105b1

Please sign in to comment.