Skip to content
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

Merged

Conversation

weswigham
Copy link
Member

@weswigham weswigham commented Mar 8, 2018

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
Copy link
Contributor

mhegazy commented Mar 8, 2018

@rbuckton can you take a look.

}
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
Member

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