Skip to content

Fix 'FixupFileName' to not load resolved assembly during module discovery#8634

Merged
adityapatwardhan merged 9 commits intoPowerShell:masterfrom
daxian-dbw:fixupfilename
Jan 16, 2019
Merged

Fix 'FixupFileName' to not load resolved assembly during module discovery#8634
adityapatwardhan merged 9 commits intoPowerShell:masterfrom
daxian-dbw:fixupfilename

Conversation

@daxian-dbw
Copy link
Member

@daxian-dbw daxian-dbw commented Jan 12, 2019

PR Summary

Changes are as follows:

  • Fix FixupFileName to not load an assembly in module analysis if the assembly path has been resolved. This way, the module analysis via Get-Module -ListAvailable wouldn't load the module assemblies unexpectedly.
  • Update the RequiredAssemblies processing to not add the same assembly to the ToProcess list twice, so that we can avoid loading the same assembly twice.
  • Remove unneeded #if !CoreCLR section about CLR version and .NET framework version.

PR Context

PR Checklist

@daxian-dbw
Copy link
Member Author

@SteveL-MSFT The -UseFuzzyMatch test failed again because ping.exe cannot be found. It failed in the daily build too. Can you please take a look?

Copy link
Member

@adityapatwardhan adityapatwardhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also can you add the [Feature] flag to run all tests?

@daxian-dbw
Copy link
Member Author

@adityapatwardhan Good point. I will add the feature tag.

@iSazonov
Copy link
Collaborator

I expect that the PR increase performance but we haven't CL-Performance label.

@daxian-dbw
Copy link
Member Author

daxian-dbw commented Jan 15, 2019

@iSazonov Changes in this PR could improve the module analysis perf for binary modules in general, because we now avoid the loading. But for the warm startup where the analysis cache has already been created, there's likely no difference.

The change to RequiredAssemblies avoid a redundant call to ExecutionContext.LoadAssembly. It should improve the perf in general, but again won't be much because it was loading an already loaded assembly.

This PR is mainly to fix the wrong behavior and also make FixupFileName easier to understand, and thus I think it's more of a CL-general.

@daxian-dbw daxian-dbw added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Jan 15, 2019
@adityapatwardhan adityapatwardhan merged commit c2dfae8 into PowerShell:master Jan 16, 2019
@daxian-dbw daxian-dbw deleted the fixupfilename branch January 16, 2019 02:14
@iSazonov
Copy link
Collaborator

@daxian-dbw Great! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants