Fix env duplication on merged-usr systems - #200
Conversation
|
Elvis Pranskevichus (@elprans) |
Don Jayamanne (@DonJayamanne), the Technically, symlinked Python prefixes aren't real distinct installations (which is the point of this PR), but if it's important to return an uncanonicalized executable path for some reason, we can narrow the scope of this change to just canonicalize |
|
Don Jayamanne (@DonJayamanne), any feedback on the above? I've modified the tests to pass. |
On modern (merged-usr) Linux systems, `/bin`, `/sbin` and `/usr/sbin` are symlinks to `/usr/bin`. There is no point in reporting the same Python installation four times, so canonicalize search paths before searching. Before: Breakdown for finding Environments: ----------------------------------- GlobalVirtualEnvs : 17.412201ms Locators : 225.284494ms Path : 433.162905ms Workspaces : 2.161556ms Environments (41): ------------------ GlobalPaths : 14 LinuxGlobal : 16 VirtualEnvWrapper : 11 After: Breakdown for finding Environments: ----------------------------------- GlobalVirtualEnvs : 16.595382ms Locators : 223.759511ms Path : 313.276036ms Workspaces : 1.418024ms Environments (21): ------------------ GlobalPaths : 2 LinuxGlobal : 8 VirtualEnvWrapper : 11
2b593f1 to
875799b
Compare
15a9e5c
into
microsoft:main
On modern (merged-usr) Linux systems,
/bin,/sbinand/usr/sbinare symlinks to
/usr/bin. There is no point in reporting the samePython installation four times, so canonicalize search paths before
searching.
Before:
After: