-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[ty] remove erroneous canonicalize #21405
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
Conversation
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
|
|
I'm claiming this is erroneous based on the fact that this canonicalize appears from seemingly nowhere in this commit: And removing it seems to fix the homebrew crasher without breaking anything else. I otherwise have no good intuition about it. cc @BurntSushi |
|
(diagnostic change is the flake that's going around... memory usage change might be Why burntsushi made this change) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the canonicalize here looks correct to me. If it's needed for correctness (for whatever reason), than it should be moved here instead:
ruff/crates/ty_python_semantic/src/module_resolver/resolver.rs
Lines 289 to 292 in 376571e
| for path in site_packages_paths { | |
| tracing::debug!("Adding site-packages search path `{path}`"); | |
| site_packages.push(SearchPath::site_packages(system, path.clone())?); | |
| } |
But I'm inclined to just ship this as is
|
Do we have any reasonable way to test this..? |
|
You could add a CLI test. We also have some file watching tests exercising symlinks. ruff/crates/ty/tests/file_watching.rs Line 1395 in 376571e
|
|
Awesome thank you micha! That was frustratingly hard to get the right minimal conditions for the thing to reproduce in tests but I got it working, and this fix indeed fixes it. |
|
Thanks! I don't remember why I added this. I'm usually pretty skeptical of |
Alternative implementation to #21052