-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Slow incremental run when single module has errors #4135
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
Comments
@gvanrossum in #4130 (comment):
|
Adding topic-daemon label because this impedes one of the important use cases for the daemon (quickly rechecking code with errors). |
This is blocking progress in fine-grained incremental mode. ASTs can't be reused when there is an error. In fine-grained incremental mode we want to cache every module that has no blocking errors. I'll try to fix or work around this. |
I've worked around this in my local branch (but have not fixed the underlying issue). |
I've got a clue about why this is happening: in build.py, in State.write_cache(), on line 1943, there's a check for self.manager.errors.is_errors(). But this returns True when there was an error in any previous file! And then two lines down we actually call delete_cache(). (This was added recently in PR #4045.) What we actually need is a little different -- we want to check if the current SCC or any of its dependents has errors. |
Fixes #4135. We now decide more carefully whether a module has an error -- only if there's an error for that specific file or for any of its (transitive) dependencies (including the SCC it's a member of). Previously, once an error was detected, *all* modules processed later were considered to be at risk.
mypy -i
is slower than expected in the following scenario:mypy.x
that generates an error:echo '1 + ""' > mypy/x.py
mypy -i mypy
mypy/x.py
as expectedmypy -i mypy
The text was updated successfully, but these errors were encountered: