Skip to content

Avoid searching unnecessary dirs for shared libs #1801

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
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

timmoon10
Copy link
Collaborator

Description

#1788 changed the .so import logic to search multiple paths since the different build paths (editable builds, source builds, Pip wheels) might put the .sos in different places. However, the current implementation is slow since it traverses the entire directory (including .git). This PR fixes the search logic to only look at required paths.

I've also modified the search logic to prioritize the imported TE module. If I manually set PYTHONPATH to point to my local install and it has everything it needs, why should we care at all about whatever is installed in the site-packages dir? I don't think this should affect correctness with the different build paths, but pinging @ksivaman.

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Changes

  • Only look in search dirs when importing .sos.
  • Only look for .sos in site-packages dir if not found in imported module.

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@timmoon10 timmoon10 requested a review from ksivaman May 20, 2025 00:46
@timmoon10 timmoon10 added the bug Something isn't working label May 20, 2025
@timmoon10
Copy link
Collaborator Author

/te-ci

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant