[core/itg/graph] Fix invalidation error not propagated#155
Open
sywhang wants to merge 4 commits into
Open
Conversation
xytan0056
reviewed
Jul 7, 2026
| target, ok := g.OptimizedTargets[targetID] | ||
| if !ok || target.Hash == nil { | ||
| if !ok { | ||
| return fmt.Errorf("target %d not found", targetID) |
Contributor
There was a problem hiding this comment.
this is intentional.
if the target doesn't exist (such as external rule targets naturally doesn't exits in OptimizedTargets). There's nothing to invalidate in ITG graph.
what's actually erroring out is removeTarget below.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In invalidateHashRecursively we never return an error even though the function signature supports returning an error and its callsites check for errors.
When the target is not found or if the target's hash is nil, it silently swallows and continues the loop. Skipping that causes us to actually skip all of its rdeps too.
This shouldn't be the case - we should return the error when it's not found at all. If the Hash is nil, then we check if it's already in our visited set (
invalidated) instead of just silently skipping over it.