-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Platform independent wildcard file include ordering #22393
Platform independent wildcard file include ordering #22393
Conversation
@rbuckton can you take a look. |
src/compiler/commandLineParser.ts
Outdated
} | ||
for (let i = 0; i < validatedIncludeSpecs.length; i++) { | ||
// We search one include spec at a time to ensure we respect include spec ordering | ||
for (const file of host.readDirectory(basePath, supportedExtensions, validatedExcludeSpecs, [validatedIncludeSpecs[i]], /*depth*/ undefined)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
matchFiles
(and therefore readDirectory
) already does this. The issue is that we use the case sensitivity passed to readDirectory to match paths and to sort the results, where it seems we should always use a case-sensitive sort.
matchFiles
was designed to preserve include spec ordering in order to traverse necessary directories in the path only once. This change results in traversing the path multiple times per include spec and is bad for performance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made the simple change to matchFiles
and added a corresponding matchFiles
unittest (as there wasn't one which this change affected).
Updated OP. |
With this change, files are always returned by
matchFiles
as though they had been read in the order a case-sensitive file system usually would have read them in, causing us to process files in the same order on all platforms, provided we actually find the same files on those platforms.The fixes the platform-dependence of the output of the chrome devtools user test. (File processing order determines type id's, which in turn controls union order.