Skip to content

Commit

Permalink
Gio/release with static analysis (#110)
Browse files Browse the repository at this point in the history
* Fix issue missing tree_sitter_python

* Explicitly make FORK the multiprocessing option to choose

This is because in the MacOS release build (at least) I keep seeing errors like:
```
Error: No such option: --multiprocessing-fork
Usage: main [OPTIONS] COMMAND [ARGS]...
Try 'main --help' for help.

Error: No such option: -B
Usage: main [OPTIONS] COMMAND [ARGS]...
Try 'main --help' for help.
```

Which are from instantiating new processes, for sure.
This SO question: https://stackoverflow.com/questions/67999589/multiprocessing-with-pool-throws-error-on-m1-macbook
Indicates it might be the way it creates new processes and suggests using "fork" explicitly.
We're giving that a go.
  • Loading branch information
giovanni-guidini authored Mar 16, 2023
1 parent 0556cd6 commit b714d0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions codecov_cli/services/staticanalysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import logging
import typing
from functools import partial
from multiprocessing import Pool
from multiprocessing import get_context
from pathlib import Path

import click
Expand Down Expand Up @@ -41,7 +41,7 @@ async def run_analysis_entrypoint(
length=len(files),
label="Analyzing files",
) as bar:
with Pool(processes=numberprocesses) as pool:
with get_context("fork").Pool(processes=numberprocesses) as pool:
file_results = pool.imap_unordered(mapped_func, files)
for x in file_results:
bar.update(1, x)
Expand Down

0 comments on commit b714d0e

Please sign in to comment.