next.js
bf55fd78 - Fix nondeterministic usages of turbo-tasks `read_dir()` (#102229)

Commit
1 day ago
Fix nondeterministic usages of turbo-tasks `read_dir()` (#102229) ### What? Make metadata selection, Pages Router discovery, static asset listings, and dependency tracing independent of filesystem enumeration order. ### Why? Directory reads return entries in an unspecified order. This can change which competing file is selected and leak nondeterministic ordering into task results and intermediate cells. ### How? Sort full filenames before processing metadata, pages, static assets, and native bindings. Sort automatically discovered @types names within each directory while preserving ancestor traversal order and explicit configuration order. ### Verification - `cargo check --offline -p next-core -p turbopack-dev-server` passed. - `pnpm exec ast-grep test --filter '^read-dir-determinism-comment$'` passed all 32 cases. - Focused Rust formatting and ast-grep scans passed. - Runtime/integration tests were not run; native bindings were not rebuilt. <!-- NEXT_JS_LLM -->
Author
Parents
Loading