Commit 4f6132b
authored
š fix: stop symlink resolution at stdlib landmark and framework builds (#87)
The resolution added in #84 follows every symlink hop of the executable.
pypa/virtualenv CI caught two unwanted consequences on its
`brew@3.12`/`brew@3.13` jobs: Homebrew's `/opt/homebrew/bin/python3.12`
resolves through the version-pinned `Cellar/python@3.12/<version>`
directory, so the recorded `home` breaks on `brew upgrade` and the base
site-packages shows up in created environments under a `Cellar` alias
that no longer matches the interpreter's own reported paths. š Stable
distro aliases such as Debian's `/usr/bin/python3` were also rewritten
to the versioned binary for no benefit.
Real `getpath` only follows the executable symlink while the stdlib
landmark is missing beside it, so the walk now stops as soon as
`<dir>/../lib(64)/pythonX.Y/os.py` is reachable, and macOS framework
builds skip resolution entirely since they self-locate through the real
binary via `dyld` at runtime. The pypa/virtualenv#3157 scenario, a
symlink in a directory with no installation around it, keeps resolving
to the real interpreter exactly as before, verified against both a
python-build-standalone interpreter and a Homebrew one where created
environments now match the pre-#84 layout byte for byte.
Fixes #86.1 parent 95e6470 commit 4f6132b
3 files changed
Lines changed: 47 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
| 235 | + | |
235 | 236 | | |
236 | 237 | | |
237 | 238 | | |
238 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
239 | 244 | | |
240 | 245 | | |
241 | 246 | | |
242 | 247 | | |
| 248 | + | |
| 249 | + | |
243 | 250 | | |
244 | 251 | | |
245 | 252 | | |
| |||
248 | 255 | | |
249 | 256 | | |
250 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
251 | 265 | | |
252 | 266 | | |
253 | 267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
191 | 216 | | |
192 | 217 | | |
193 | 218 | | |
| |||
196 | 221 | | |
197 | 222 | | |
198 | 223 | | |
199 | | - | |
| 224 | + | |
200 | 225 | | |
201 | 226 | | |
202 | 227 | | |
| |||
0 commit comments