Repository navigation
Conversation
Fixes meta#9529 Last part of the stack meta#9532, meta#9533, meta#9534 (split from meta#9530). meta#9534 stops the file crawl following a symlink to a directory it reads anyway, but it still follows any other symlink, eg out of the root or out of the directory passed to `flow ls`, and goes round a cycle of them until the OS refuses to resolve the path. With a few packages linked to each other, eg `flow ls packages/a` in a pnpm workspace, that never ends in practice. This stops following a symlink to a directory the crawl passed through to reach it. Every walk now ends, though a dense web of links out of the crawl is still walked once per path through it, which grows quickly with the number of links. Test plan: `symlinks_out_of_root` now also has a cycle out of the root, whose files `main` lists once per lap. The full `flow dev-tools runtests` suite passes (macOS). On react/metro installed with pnpm (react/metro#2110), `flow ls packages/metro-config` hangs on `main`. With this, `flow ls` of each workspace package finishes in under a second, and `flow full-check` gives the same result in the same time.
|
This pull request has been imported. If you are a Meta employee, you can view this in D133227488. (Because this pull request was imported automatically, there will not be any future comments.) |
|
This pull request has been merged in aaec865. |
robhogan
added a commit
to robhogan/flow
that referenced
this pull request
Nov 20, 2026
… the root's parent Follow-up to meta#9534 and meta#9535, which stop the file crawl following a symlink to a directory it reads anyway or to one the walk is already in. - A change to a TypeScript global declaration reinits the server, which crawls again in the same process. The crawl takes real paths from a process-wide canonicalization cache that was never cleared, so a symlink changed since it was cached still resolves to its old target: the new target's files go missing, and paths through the symlink resolve to the old one. This was already the case for symlinks the crawl follows, and meta#9534 extended it to the decision to skip one. An init from scratch now clears the cache before it crawls. - `flow ls` of a directory containing the root, eg `flow ls ..`, treated a symlink under the root to anywhere in that directory as crawled directly, so files outside the root that it lists only through such a symlink went missing. The target now has to be under the root as well. A reinit from saved state still keeps the cached targets. That's unchanged here. Test plan: New `symlink_change_before_reinit` test, which changes a symlink's target before a reinit, and `symlinks_out_of_root` now also lists `..`. Both fail without this change, and the new test also fails with `runtests --saved-state`. The full `flow dev-tools runtests` suite passes (macOS).
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.
Fixes #9529
Last part of the stack #9532, #9533, #9534 (split from #9530).
#9534 stops the file crawl following a symlink to a directory it reads anyway, but it still follows any other symlink, eg out of the root or out of the directory passed to
flow ls, and goes round a cycle of them until the OS refuses to resolve the path. With a few packages linked to each other, egflow ls packages/ain a pnpm workspace, that never ends in practice.This stops following a symlink to a directory the crawl passed through to reach it. Every walk now ends, though a dense web of links out of the crawl is still walked once per path through it, which grows quickly with the number of links.
Test plan:
symlinks_out_of_rootnow also has a cycle out of the root, whose filesmainlists once per lap. The fullflow dev-tools runtestssuite passes (macOS).On react/metro installed with pnpm (react/metro#2110),
flow ls packages/metro-confighangs onmain. With this,flow lsof each workspace package finishes in under a second, andflow full-checkgives the same result in the same time.