GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix 'FixupFileName' to not load resolved assembly during module discovery by daxian-dbw · Pull Request #8634 · PowerShell/PowerShell

Conversation

@daxian-dbw

@daxian-dbw Dongbo Wang (daxian-dbw) commented Jan 12, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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

  • PR has a meaningful title
    • Use the present tense and imperative mood when describing your changes
  • Summarized changes
  • Change is not breaking
  • Make sure all .h, .cpp, .cs, .ps1 and .psm1 files have the correct copyright header
  • This PR is ready to merge and is not Work in Progress.
    • If the PR is work in progress, please add the prefix WIP: or [ WIP ] to the beginning of the title (the WIP bot will keep its status check at Pending while the prefix is present) and remove the prefix when the PR is ready.
  • User-facing changes
    • Not Applicable
    • OR
    • Documentation needed
      • Issue filed:
  • Testing - New and feature
    • N/A or can only be tested interactively
    • OR
    • Make sure you've added a new test if existing tests do not effectively test the code changed
      • Add [feature] to your commit messages if the change is significant or affects feature tests

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

rjmholt reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Dongbo Wang (daxian-dbw) added 4 commits January 11, 2019 16:09
@daxian-dbw
Refactor FixupFileName
d9f8dcf
@daxian-dbw
Fix the 'FixupFileName' method
78ec652
@daxian-dbw
Add test
84fa7a5
@daxian-dbw
Update test
f2741ec
@daxian-dbw
Dongbo Wang (daxian-dbw) requested review from Aditya Patwardhan (adityapatwardhan) and Rob Holt (rjmholt) January 12, 2019 19:44
@daxian-dbw
Dongbo Wang (daxian-dbw) requested a review from Bruce Payette (BrucePay) as a code owner January 12, 2019 19:44
@daxian-dbw
[Feature] Clean up resource strings
4e21340
@daxian-dbw
Dongbo Wang (daxian-dbw) force-pushed the fixupfilename branch from 42e2e36 to 4e21340 Compare January 12, 2019 19:48
@daxian-dbw

Dongbo Wang (daxian-dbw) commented Jan 14, 2019

Copy link
Copy Markdown
Member Author

Steve Lee (@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?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

adityapatwardhan
Aditya Patwardhan (adityapatwardhan) requested changes Jan 14, 2019
View reviewed changes
Comment thread src/System.Management.Automation/engine/CommandDiscovery.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/powershell/Modules/Microsoft.PowerShell.Core/Import-Module.Tests.ps1 Resolved

Uh oh!

There was an error while loading. Please reload this page.

PaulHigin
Paul Higinbotham (PaulHigin) suggested changes Jan 14, 2019
View reviewed changes
Comment thread src/System.Management.Automation/engine/CommandDiscovery.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

adityapatwardhan
Aditya Patwardhan (adityapatwardhan) requested changes Jan 15, 2019
View reviewed changes

@adityapatwardhan Aditya Patwardhan (adityapatwardhan) left a comment

Copy link
Copy Markdown
Member

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.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread test/powershell/Modules/Microsoft.PowerShell.Core/Import-Module.Tests.ps1 Resolved

Uh oh!

There was an error while loading. Please reload this page.

@daxian-dbw

Dongbo Wang (daxian-dbw) commented Jan 15, 2019

Copy link
Copy Markdown
Member Author

Aditya Patwardhan (@adityapatwardhan) Good point. I will add the feature tag.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@daxian-dbw
[Feature] Address feedback
0463a88
@daxian-dbw
Dongbo Wang (daxian-dbw) force-pushed the fixupfilename branch from f9e538a to 0463a88 Compare January 15, 2019 01:26
@daxian-dbw
[Feature] Add back a missed change
84ad685
adityapatwardhan
Aditya Patwardhan (adityapatwardhan) approved these changes Jan 15, 2019
View reviewed changes
@daxian-dbw
[Feature] Update the test to make it more accurate
c311a77
@daxian-dbw
Dongbo Wang (daxian-dbw) force-pushed the fixupfilename branch from 6435a41 to c311a77 Compare January 15, 2019 01:54
@iSazonov

Ilya (iSazonov) commented Jan 15, 2019

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@daxian-dbw

Dongbo Wang (daxian-dbw) commented Jan 15, 2019 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

Ilya (@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.

iSazonov reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@daxian-dbw Dongbo Wang (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
PaulHigin
Paul Higinbotham (PaulHigin) approved these changes Jan 15, 2019
View reviewed changes
Comment thread src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

rjmholt
Rob Holt (rjmholt) reviewed Jan 15, 2019
View reviewed changes
Comment thread src/System.Management.Automation/engine/Modules/ModuleCmdletBase.cs Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/powershell/Modules/Microsoft.PowerShell.Core/Import-Module.Tests.ps1 Resolved

Uh oh!

There was an error while loading. Please reload this page.

@daxian-dbw
[Feature] Address Rob's comment
61eea6a
@daxian-dbw
Dongbo Wang (daxian-dbw) force-pushed the fixupfilename branch from aa6b004 to 61eea6a Compare January 15, 2019 19:14
@daxian-dbw Dongbo Wang (daxian-dbw) assigned Aditya Patwardhan (adityapatwardhan) Jan 15, 2019
@adityapatwardhan
Aditya Patwardhan (adityapatwardhan) merged commit c2dfae8 into PowerShell:master Jan 16, 2019
@daxian-dbw
Dongbo Wang (daxian-dbw) deleted the fixupfilename branch January 16, 2019 02:14
@iSazonov

Ilya (iSazonov) commented Jan 16, 2019

Copy link
Copy Markdown
Collaborator

Dongbo Wang (@daxian-dbw) Great! 👍

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
@daxian-dbw @adityapatwardhan
Fix 'FixupFileName' to not load resolved assembly during module disco…
2ea51b4
…very (PowerShell#8634)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@adityapatwardhan Aditya Patwardhan (adityapatwardhan) adityapatwardhan approved these changes
@BrucePay Bruce Payette (BrucePay) Awaiting requested review from BrucePay
+3 more reviewers
@rjmholt Rob Holt (rjmholt) rjmholt left review comments
@vexx32 Rain Sallow (/u/ta11ow) (vexx32) vexx32 left review comments
@PaulHigin Paul Higinbotham (PaulHigin) PaulHigin approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@adityapatwardhan Aditya Patwardhan (adityapatwardhan)

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@daxian-dbw @iSazonov @rjmholt @adityapatwardhan @PaulHigin @vexx32
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.