Skip to content

Handle stale transitive deps after import rename#2727

Merged
plajjan merged 1 commit intomainfrom
uncache-import-rename
Apr 16, 2026
Merged

Handle stale transitive deps after import rename#2727
plajjan merged 1 commit intomainfrom
uncache-import-rename

Conversation

@mzagozen
Copy link
Copy Markdown
Collaborator

Add a test showing incorrect cache invalidation for renamed imports: main.act subclasses base.Base, base.act switches its provider import from oldpkg.ttt to newpkg.ttt, and the rebuild runs without cleaning out/. The cached .ty for main could still reference oldpkg.ttt and fail with a missing type interface error even after base had been rebuilt.

@plajjan the branch also includes a fix that avoids the same problem in sorespo, but I am not 100% how well it fits in with the rest of the ideas in the compiler ... Please check, and if do you come up with a different approach, test by compiling sorespo main (c693ea740a04e212db4cdf8187f6b55bf3732fb9) and stratoweave (11315b242078662715145cedf788742cd6c73183) without clearing the local cache.

@mzagozen mzagozen requested a review from plajjan April 15, 2026 20:43
Add a test showing incorrect cache invalidation for renamed imports: main.act
subclasses base.Base, base.act switches its provider import from oldpkg.ttt to
newpkg.ttt, and the rebuild runs without cleaning out/. The cached .ty for main
could still reference oldpkg.ttt and fail with a missing type interface error
even after base had been rebuilt.
@mzagozen mzagozen force-pushed the uncache-import-rename branch from d617859 to 1063961 Compare April 16, 2026 13:05
@mzagozen mzagozen marked this pull request as ready for review April 16, 2026 13:05
@plajjan
Copy link
Copy Markdown
Contributor

plajjan commented Apr 16, 2026

LGTM.

We treated many errors as hard errors initially because it made it easier for me to write this stuff, so like "invalid cache" is an error but it is of course recoverable. I just missed updating from "throw hard error" to "just forget the cache and rebuild" in a bunch of places. I should audit - might be a few more. Anyway, this is the right fix for these, so merging.

@plajjan plajjan merged commit 56b7856 into main Apr 16, 2026
43 of 44 checks passed
@plajjan plajjan deleted the uncache-import-rename branch April 16, 2026 19:49
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.

2 participants