Skip to content

Conversation

@mmitche
Copy link
Member

@mmitche mmitche commented Dec 9, 2022

This PR is a design to help repos enable targeting of desired TFMs, and to enable trimming away of unwanted TFMs based on the consumer of a build.

To double check:

This PR is a design to help repos enable targeting of desired TFMs, and to enable trimming away of unwanted TFMs based on the consumer of a build.
@mmitche mmitche force-pushed the trimming-and-targeting branch from eb23ae9 to 72005a4 Compare December 9, 2022 20:21
@mmitche mmitche changed the title Trimming and Targeting Design Unified Build: Trimming and Targeting Design Dec 12, 2022
@mmitche
Copy link
Member Author

mmitche commented Jan 4, 2023

@rainersigwald Gentle ping now that we're back in the new year.

@rainersigwald rainersigwald requested a review from baronfel January 4, 2023 19:59
Copy link
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

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

Adding this functionality to MSBuild is ok with me, I think. If it's a screaming success in Arcade we might consider promoting the filtering to the SDK.

@baronfel holler if you really don't like the new property function :)

<_OriginalTargetFrameworks Condition="'$(TargetFramework)' != ''">$(TargetFramework)</_OriginalTargetFrameworks>
<_FilteredTargetFrameworks Condition="'$(NoTargetFrameworkFiltering)' != 'true' and '$(DotNetTargetFrameworkFilter)' != ''">$([MSBuild]::Unescape($([MSBuild]::IntersectTargetFrameworks('$(_OriginalTargetFrameworks)', '$(DotNetTargetFrameworkFilter)'))))</_FilteredTargetFrameworks>
<TargetFrameworks Condition="'$(NoTargetFrameworkFiltering)' != 'true' and '$(_FilteredTargetFrameworks.Contains(';'))'">$(_FilteredTargetFrameworks)</TargetFrameworks>
<TargetFramework Condition="'$(NoTargetFrameworkFiltering)' != 'true' and '!$(_FilteredTargetFrameworks.Contains(';'))'">$(_FilteredTargetFrameworks)</TargetFramework>
Copy link
Member

Choose a reason for hiding this comment

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

Talked to @mmitche offline--I don't think this part will work but making the project always multitargeted (sometimes with a list of one) shouldn't have an serious cost even if it's not theoretically optimal.

@baronfel
Copy link
Member

@rainersigwald and I chatted briefly about it - the mechanism of set-intersection seems useful enough, I just wished that we had a better syntax for it. no objections from my end to the new primitive function, though.

@mmitche mmitche merged commit 1806d58 into dotnet:main Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants