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
Deprecate TOC class and remove its usage from codebase #7615
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
609d9ba
depend: imphookapi: rework TOC-style tuple detection
rokm 132f673
building: splash: remove reference to TOC class
rokm 24e57a7
building: splash: clean up string formatting in logger method calls
rokm e0e0ae0
depend: remove use of TOC class in get_bootstrap_modules
rokm ec13909
depend: remove optional TOC argument to _make_toc() helper
rokm 73e202e
building: have Tree inherit from list instead of TOC
rokm 2792fc2
building: begin replacing TOC class with normalization helper function
rokm 7634f85
building: main: move extension processing further up in workflow
rokm 1f2bed8
building: main: remove direct uses of TOC class
rokm 5d9cab5
building: work around the issue with passing code cache around
rokm b59792f
tests: fix CONF override in test_issue_2492 and test_issue_5131
rokm 7527eaf
building: splash: fix detection of tkinter usage
rokm f83dad6
building: implement TOC list normalization helpers
rokm 0603e01
building: EXE: remove the work-around for merging PYZ.dependencies
rokm e6f6f1f
tests: add basic tests for the new TOC normalization helpers
rokm 69e6130
building: add deprecation warning to TOC class
rokm cf95497
docs: update documentation on TOC lists
rokm 97bc98e
building: ensure TOC de-duplication when dest_name contains pardir loops
rokm File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's going into these
code_cache
dicts? I'm guessing a mapping from module names tomodule.__code__
attribute? If so then why does this cache need to be separated per toc? Why not one single process-widecode_cache
global dict?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, code_cache dicts are mappings of module names to their code objects, retrieved from modulegraph's nodes:
pyinstaller/PyInstaller/depend/analysis.py
Lines 523 to 542 in fb545db
Previously, they were attached to
pure
TOC objects and then collected inPYZ
- although in practice,PYZ
usually receives only onepure
TOC, so it ended up with one such dictionary.I tried to match the original behavior mostly because of possible corner cases - for example, spec instantiates two
Analysis
objects, with different search paths. In that case, I assume we might end up with different but eponymous modules, and would need separate code caches for each resulting PYZ and executable.It's not a very likely scenario (hopefully?), but I didn't want to delve too much into it at this point. I think we'll need to rework the part with code caches again when we switch from the old modulegraph, anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that switching to a single global code cache seems reasonable, though. It was my first idea as well, until I started to think about possible implications. If those are not a concern, I can add a commit that switches to single global code cache for the current build process.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. Let's leave it as is for now.