Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Platform independent wildcard file include ordering#22393

Merged
weswigham merged 4 commits into
microsoft:mastermicrosoft/TypeScript:masterfrom
weswigham:platform-independent-wildcard-orderingweswigham/TypeScript:platform-independent-wildcard-orderingCopy head branch name to clipboard
Mar 8, 2018
Merged

Platform independent wildcard file include ordering#22393
weswigham merged 4 commits into
microsoft:mastermicrosoft/TypeScript:masterfrom
weswigham:platform-independent-wildcard-orderingweswigham/TypeScript:platform-independent-wildcard-orderingCopy head branch name to clipboard

Conversation

@weswigham

@weswigham weswigham commented Mar 8, 2018

Copy link
Copy Markdown
Member

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.

@mhegazy

mhegazy commented Mar 8, 2018

Copy link
Copy Markdown
Contributor

@rbuckton can you take a look.

Comment thread 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)) {

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Member Author

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).

@weswigham

Copy link
Copy Markdown
Member Author

Updated OP.

@weswigham weswigham merged commit 88ba1ef into microsoft:master Mar 8, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.