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

Fix fine-grained crash caused by unneeded extra parse_file()s #4980

Merged
merged 1 commit into from
Apr 27, 2018

Conversation

msullivan
Copy link
Collaborator

load_graph() contains code to parse ancestor modules that
get new children. Since load_graph() did not communicate that
these modules had been parsed to fine-grained mode, this caused
problems with fine-grained mode.

That code was added in #1865 to fix a bug where 'import from'
of a newly added submodule would not work in incremental mode
because it didn't appear in the parent module's symbol table.
The need to reload the parent to fix this was obviated by #2061,
which makes semantic analysis directly inspect the modules map
when doing 'import from' to find possible submodules.

Since the code isn't needed any more and it is causing trouble,
we just remove it.

I would like to cherry-pick this into 0.600 (#4946).

load_graph() contains code to parse ancestor modules that
get new children. Since load_graph() did not communicate that
these modules had been parsed to fine-grained mode, this caused
problems with fine-grained mode.

That code was added in #1865 to fix a bug where 'import from'
of a newly added submodule would not work in incremental mode
because it didn't appear in the parent module's symbol table.
The need to reload the parent to fix this was obviated by
at the modules map to find possible submodules.

Since the code isn't needed any more and it is causing trouble,
we just remove it.
@msullivan msullivan requested a review from JukkaL April 27, 2018 07:25
@msullivan
Copy link
Collaborator Author

@Michael0x2a If you still have any context on this and it seems like I'm missing something, feel free to let me know

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fix seems good to me, but I don't fully understand the intricacies of how this part of the build process works, so I'd appreciate another pair of eyes.

Maybe @gvanrossum can also have a look?

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't say I understand this code in detail, but Sully has convinced me off-line that he's done all the necessary checking to see whether this is safe, so let's go with it.

@msullivan msullivan merged commit 1c9888f into master Apr 27, 2018
@msullivan msullivan deleted the load_graph_crashfix branch April 27, 2018 18:03
msullivan added a commit that referenced this pull request Apr 27, 2018
load_graph() contains code to parse ancestor modules that
get new children. Since load_graph() did not communicate that
these modules had been parsed to fine-grained mode, this caused
problems with fine-grained mode.

That code was added in #1865 to fix a bug where 'import from'
of a newly added submodule would not work in incremental mode
because it didn't appear in the parent module's symbol table.
The need to reload the parent to fix this was obviated by
at the modules map to find possible submodules.

Since the code isn't needed any more and it is causing trouble,
we just remove it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants