Platform independent wildcard file include ordering#22393
Merged
weswigham merged 4 commits intomicrosoft:masterfrom Mar 8, 2018
Merged
Platform independent wildcard file include ordering#22393weswigham merged 4 commits intomicrosoft:masterfrom
weswigham merged 4 commits intomicrosoft:masterfrom
Conversation
mhegazy
approved these changes
Mar 8, 2018
Contributor
|
@rbuckton can you take a look. |
rbuckton
suggested changes
Mar 8, 2018
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)) { |
Contributor
There was a problem hiding this comment.
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.
Member
Author
There was a problem hiding this comment.
I've made the simple change to matchFiles and added a corresponding matchFiles unittest (as there wasn't one which this change affected).
Member
Author
|
Updated OP. |
rbuckton
approved these changes
Mar 8, 2018
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
With this change, files are always returned by
matchFilesas 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.