Skip to content

Conversation

@Gankra
Copy link
Contributor

@Gankra Gankra commented Nov 12, 2025

Alternative implementation to #21052

@Gankra Gankra added server Related to the LSP server ty Multi-file analysis & type inference labels Nov 12, 2025
@astral-sh-bot
Copy link

astral-sh-bot bot commented Nov 12, 2025

Diagnostic diff on typing conformance tests

No changes detected when running ty on typing conformance tests ✅

@astral-sh-bot
Copy link

astral-sh-bot bot commented Nov 12, 2025

mypy_primer results

Changes were detected when running on open source projects
scikit-build-core (https://github.com/scikit-build/scikit-build-core)
- src/scikit_build_core/build/wheel.py:98:20: error[no-matching-overload] No overload of bound method `__init__` matches arguments
- Found 45 diagnostics
+ Found 44 diagnostics

Memory usage changes were detected when running on open source projects
flake8 (https://github.com/pycqa/flake8)
- TOTAL MEMORY USAGE: ~63MB
+ TOTAL MEMORY USAGE: ~66MB

@Gankra
Copy link
Contributor Author

Gankra commented Nov 12, 2025

I'm claiming this is erroneous based on the fact that this canonicalize appears from seemingly nowhere in this commit:

ddd4bab

And removing it seems to fix the homebrew crasher without breaking anything else. I otherwise have no good intuition about it.

cc @BurntSushi

@Gankra
Copy link
Contributor Author

Gankra commented Nov 12, 2025

(diagnostic change is the flake that's going around... memory usage change might be Why burntsushi made this change)

@Gankra Gankra marked this pull request as ready for review November 12, 2025 14:35
@Gankra Gankra marked this pull request as draft November 12, 2025 14:36
Copy link
Member

@MichaReiser MichaReiser left a 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:

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

@Gankra
Copy link
Contributor Author

Gankra commented Nov 12, 2025

Do we have any reasonable way to test this..?

@MichaReiser
Copy link
Member

You could add a CLI test. We also have some file watching tests exercising symlinks.

fn symlink_target_outside_watched_paths() -> anyhow::Result<()> {

@Gankra Gankra marked this pull request as ready for review November 12, 2025 19:43
@Gankra
Copy link
Contributor Author

Gankra commented Nov 12, 2025

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.

@Gankra Gankra merged commit 3d4b055 into main Nov 12, 2025
41 checks passed
@Gankra Gankra deleted the gankra/symlink2 branch November 12, 2025 20:47
@BurntSushi
Copy link
Member

Thanks! I don't remember why I added this. I'm usually pretty skeptical of canonicalize.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

server Related to the LSP server ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants