fix(pathfinder): remove dead/misleading error handling in platform loaders#2239
Open
aryanputta wants to merge 1 commit into
Open
fix(pathfinder): remove dead/misleading error handling in platform loaders#2239aryanputta wants to merge 1 commit into
aryanputta wants to merge 1 commit into
Conversation
…aders
Two dead error-handling paths in the dynamic-lib platform loaders:
- load_dl_linux.load_with_system_search guarded abs_path with
'if abs_path is None: raise RuntimeError("No expected symbol ...")'.
abs_path_for_dynamic_library never returns None (it returns a resolved
path or raises OSError), so the branch is unreachable and its message is
factually wrong (it concerns dlinfo path resolution, not symbols). Drop
the dead branch and let the descriptive OSError surface, matching the
deterministic-loader policy of not masking discovery/load failures.
- load_dl_windows.add_dll_directory had 'if not result: pass', a no-op; the
PATH update below already runs unconditionally. Remove the dead branch and
clarify the comment on why PATH is updated regardless.
No behavior change: both removed branches were unreachable or no-ops.
Signed-off-by: Aryan <aryansputta@gmail.com>
Contributor
Contributor
Author
|
Note for triage: I can't set labels/milestones as an external contributor. Intended metadata for |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Removes two dead error-handling paths in the dynamic-lib platform loaders. Both are unreachable / no-ops today; the Linux one additionally carries a factually wrong message that would mislead anyone debugging a load failure. This aligns with the
cuda_pathfinderpolicy of not masking why discovery/loading failed.Details
load_dl_linux.load_with_system_searchguarded the resolved path with:abs_path_for_dynamic_librarynever returnsNone- it returns a resolved path (os.path.join(l_origin, basename)) or raisesOSErrorfromdlinfo. So the branch is unreachable, and its message is wrong: it talks about a missing symbol when the only real failure mode is dlinfo path resolution. Dropped the dead branch so the descriptiveOSErrorsurfaces directly, and updated the docstringRaises:accordingly.load_dl_windows.add_dll_directoryhad:The
if not result: passis a no-op - the PATH update below already runs unconditionally. Removed the dead branch and clarified why PATH is updated regardless.Behavior
No behavior change: both removed branches were unreachable or no-ops.
Testing
ruff checkandruff format --check(v0.15.9, repo-pinned) pass on both changed files.