Repository navigation
Conversation
`make_next_files` filters each file it finds with `no_subdir_path_filter`, or with `subdir_path_filter` when the crawl is limited to a subdirectory. The latter repeats `path_is_in_crawl_scope` inline, plus a `starts_with(subdir)` check. This moves the subdirectory check into `path_is_in_crawl_scope` and replaces both filters with one `crawl_path_filter`, so there's a single definition of which files the crawl reports. The fix for meta#9529 needs to ask the crawl's scope the same question about a symlink's target. Test plan: The conditions and their order are unchanged. `tests/ls` covers full, subdirectory, `[include]` and `--all` crawls, and the full `flow dev-tools runtests` suite passes (macOS).
|
This pull request has been imported. If you are a Meta employee, you can view this in D132631202. (Because this pull request was imported automatically, there will not be any future comments.) |
|
This pull request has been merged in b4aaa29. |
This was referenced Nov 18, 2026
meta-codesync Bot
pushed a commit
that referenced
this pull request
Nov 19, 2026
Summary: 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, 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. Pull Request resolved: #9535 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. Reviewed By: SamChou19815 Differential Revision: D133227488 fbshipit-source-id: 889fee75094aed805ff360dbd21939cbe8cf465b
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.
make_next_filesfilters each file it finds withno_subdir_path_filter, or withsubdir_path_filterwhen the crawl is limited to a subdirectory. The latter repeatspath_is_in_crawl_scopeinline, plus astarts_with(subdir)check.This moves the subdirectory check into
path_is_in_crawl_scopeand replaces both filters with onecrawl_path_filter. It's the base of the stack fixing #9529, where the crawl never finishes on pnpm workspaces. The fix stops following a symlink when the crawl reads its target anyway, and decides that with this same scope check rather than a copy of it:robhogan@94f7d3d
Test plan:
The conditions and their order are unchanged.
tests/lscovers full, subdirectory,[include]and--allcrawls, and the fullflow dev-tools runtestssuite passes (macOS).