Repository navigation
Filter Install-PSResource library assets by TFM - #2073
Draft
Justin Chung (jshigetomi) wants to merge 1 commit into
Draft
Justin Chung (jshigetomi) wants to merge 1 commit into
Justin Chung (jshigetomi) wants to merge 1 commit into
Conversation
Select the nearest compatible variant per relative lib asset while preserving unique compatible assets across framework folders. Add explicit target merging and focused cross-edition regression coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Summary
This is the TFM-only extraction from #1963 after the combined RID/TFM implementation was reverted by #2070. It adds
-TargetFrameworkand automatic host-framework selection toInstall-PSResourcewithout restoring any RID filtering,RuntimeIdentifierhelpers, or-RuntimeIdentifiersurface.Library filtering now operates per relative asset path rather than choosing one entire
lib/{tfm}directory. When the same asset exists under multiple compatible target frameworks, NuGet's framework reducer selects the nearest compatible variant for the current or explicitly requested target. Unique compatible assets remain installed even when they are spread across multiple TFM folders. This preserves theAz.Accountsshape called out in #2070 (lib/net45,lib/net47, andlib/netstandard2.0) while still removing redundant variants.An explicit
-TargetFrameworkcan also add assets to an already-installed copy of the same version. Merge state is scoped to each parent install work item, and the merge only adds missing files without overwriting existing content.-Reinstallretains full replacement behavior.TFM-specific dependency-group refinement is intentionally deferred in this draft. Dependency parsing remains unchanged, so an explicit target does not silently cause dependency groups to be selected using the current host framework. The empty
dependencyGroupsbehavior fixed after the revert is not reintroduced.Validation:
pwsh -NoLogo -NoProfile -File .\build.ps1 -Buildwith .NET SDK 10.0.402 onPATH.dotnet publish .\src\code\Microsoft.PowerShell.PSResourceGet.csproj --configuration Debug --framework net472 --no-restore --verbosity minimal.Invoke-Pester -Script .\test\InstallPSResourceTests\InstallPSResourceTargetFramework.Tests.ps1(8 passed, 0 failed).Invoke-Pester -Script .\test\InstallPSResourceTests\InstallPSResourceTargetFramework.Tests.ps1(8 passed, 0 failed).Invoke-ScriptAnalyzer -Path .\test\InstallPSResourceTests\InstallPSResourceTargetFramework.Tests.ps1 -Severity Warning,Error(0 findings).PR Context
The original platform-aware install work combined RID and TFM behavior. This standalone draft limits the change to TFM-aware
lib/asset selection and adds a regression fixture shaped like theAz.Accountspackage layout that caused #1963 to be reverted. RID filtering is being handled separately.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.Install-PSResourceMicrosoftDocs/PowerShell-Docs-PSGet#347