Repository navigation
fix(pathfinder): check for an already-loaded library before searching the disk #3623
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
Open
rparolin
wants to merge
9
commits into
main
from
pathfinder-readability/17-check-loaded-before-searching
+169
−21
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9550142
fix(pathfinder): check for an already-loaded library before searching…
rparolin 8bd1841
test(pathfinder): preserve dependency handling around the loaded check
rparolin 438058d
ci: require manual copy-pr-bot approval
rwgk 63c36ab
fix(pathfinder): detect libraries loaded during discovery
rwgk 2afbe62
test(pathfinder): cover dependency order on library discovery
rwgk f5782cd
fix(pathfinder): keep provenance of a library loaded by an overlappin…
rparolin 9f3fef3
Revert "fix(pathfinder): keep provenance of a library loaded by an ov…
rparolin 3e7f898
test(pathfinder): merge overlapping already-loaded tests and drop a s…
rparolin 6d9a2ea
fix(pathfinder): report an unlistable directory instead of raising
rparolin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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.
This runs before the already-loaded return, so an already-loaded library still searches the disk for each unloaded dependency. If an optional dependency such as nvrtc is not loaded and its search hits a PermissionError from an unreadable wheel directory, the call fails even though cudnn is already loaded. I saw this with mocks earlier (cudnn loaded, nvrtc not loaded, site-packages listing raises PermissionError); I have not re-run it on the current head.
The PR text and the draft release note say an already-loaded library no longer fails on a search error. That holds only when its dependencies are also loaded. Either narrow that claim, or make the listing failure an attachment line so the search ends in DynamicLibNotFoundError and optional-dependency suppression applies. Either way, add a test for an already-loaded cudnn with an unloaded nvrtc and an unreadable wheel directory.
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.
Reproduced on the current head: an already-loaded cudnn failed with
PermissionErrorwhen nvrtc was not loaded and its wheel directory could not be listed.The failure came from the unguarded
os.listdirthat builds the not-found message. Fixed in 6d9a2ea: a listing failure is now aLISTDIR FAILEDline in that message, so the search ends inDynamicLibNotFoundErrorand optional-dependency suppression applies. The same guard covers the lib-dir search on both platforms.Added the test you asked for (loaded cudnn, unloaded nvrtc, unlistable wheel directory), plus one for the lib-dir path on Linux and Windows. With this, the PR text and release note hold as written.