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

Daemon can lose updates if there is a blocking error in intermediate run #6906

Open
ilevkivskyi opened this issue May 28, 2019 · 2 comments
Open

Comments

@ilevkivskyi
Copy link
Member

Inline options parsing causes files to force-included in the build if they were previously excluded. For example this test fails with "Unrecognized option..." on the last run:

[case testBlockerBadBuild]
$ dmypy start -- --follow-imports=skip
Daemon started
$ dmypy check a.py
a.py:1: error: Unsupported operand types for + ("int" and "str")
== Return code: 1
$ {python} -c "import shutil; shutil.copy('a.py.2', 'a.py')"
$ dmypy recheck --update b.py --remove a.py
b.py:1: error: invalid syntax
== Return code: 1
$ dmypy recheck --update c.py --remove b.py

[file a.py]
42 + 'no'

[file a.py.2]
# mypy: why-is-this-file-checked-again
42 + 'no'

[file b.py]
syntax error

[file c.py]
# OK

In fact, a.py shouldn't be even parsed on the last run. Note that it is actually correctly not parsed if the error on the second run is non-blocking (like 42 + 'no').

Note that exactly the same problem appears if update is called directly, this test equally fails with same symptoms:

[case testBlockerBadBuild]
# flags: --follow-imports=skip
# cmd: mypy a.py
# cmd2: mypy b.py
# cmd3: mypy c.py

[file a.py]
# OK

[file b.py.2]
syntax error here

[file c.py.3]
# OK

[file a.py.3]
# mypy: this-file-is-not-in-build-in-cmd3-why-is-it-checked

[out]
==
b.py:1: error: invalid syntax
==
@ilevkivskyi
Copy link
Member Author

@msullivan I think you have the most context on this.

@msullivan msullivan changed the title Inline options parsing breaks daemon if there is a blocking error in intermediate run Daemon can lose updates if there is a blocking error in intermediate run May 28, 2019
@msullivan
Copy link
Collaborator

The inline options seem to be a red herring.

It looks like the issue is that the blocking error in b causes the deletion of a to become lost, and this has probably been an issue for a while. It looks like it will also cause updates to be lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants