Skip to content

Conversation

@karthiknadig
Copy link
Member

For 187

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request enhances symlink handling in the create_unknown_env function to improve Windows compatibility, specifically for tools like Scoop that use shim executables. The change combines symlinks from the ResolvedPythonEnv (which includes the original executable and resolved paths from spawning Python) with additional symlinks discovered by scanning the bin directory.

Changes:

  • Modified create_unknown_env to merge symlinks from ResolvedPythonEnv with those found by find_symlinks
  • Added deduplication and sorting of the combined symlinks to ensure consistency
Comments suppressed due to low confidence (1)

crates/pet/src/locators.rs:179

  • The contains check on line 175 performs a linear search through the vector for each symlink, resulting in O(n²) complexity when merging large lists. Consider using a HashSet for deduplication or using extend followed by sorting and dedup() for better performance.
    if let Some(additional_symlinks) = find_symlinks(&resolved_env.executable) {
        for symlink in additional_symlinks {
            if !symlinks.contains(&symlink) {
                symlinks.push(symlink);
            }
        }
    }

@karthiknadig karthiknadig enabled auto-merge (squash) January 17, 2026 05:52
@karthiknadig karthiknadig merged commit 4b67cdd into main Jan 17, 2026
25 checks passed
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