Skip to content

Conversation

@jbedard
Copy link
Member

@jbedard jbedard commented Oct 31, 2025

While run --watch can detect deletions based on how the runfiles manifest changes, deletions of source files requires an actual fs-stat to determine if the file still exists.

Changes are visible to end-users: no

Test plan

  • Covered by existing test cases
  • Manual testing

@jbedard jbedard requested a review from thesayyn October 31, 2025 20:02
@jbedard jbedard merged commit a546754 into main Oct 31, 2025
3 checks passed
@jbedard jbedard deleted the configure--watch-del branch October 31, 2025 21:50
for _, p := range cs.Paths {
changes[p] = si
// Determine if the change is a deletion vs regular change
if _, err := os.Stat(path.Join(cs.Root, p)); err != nil {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this expensive to do in a loop? shouldn't we simply diff prev and current to find what's been deleted?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only the paths in the change set, not the full workspace. We don't actually have the full list of files anywhere in go.

But yes I am worried about it being expensive... did you have any other ideas? I took a quick look but maybe missed something... can watchman tell us these were deletions?

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.

3 participants