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

Allow trimming out incompatible ProjectReferences #8459

Merged
merged 7 commits into from
Feb 12, 2022

Conversation

ViktorHofer
Copy link
Member

@ViktorHofer ViktorHofer commented Feb 11, 2022

Filtering out incompatible inner builds in traversal builds happens in outer builds via hooking onto the DispatchToInnerBuild target. This works well when the project multi-targets and actually has an outer-build but which isn't true for single target framework projects. Instead during traversal builds (i.e. which are orchestrated by the ref.proj, src.proj and tests.proj projects in dotnet/runtime), filter via the ResolveP2PReferences target.

Also removing the RawTargetFrameworks attribute on ProjectReferences as it isn't required anymore as the TargetFrameworks attribute contains everything needed for the best target framework selection.

Today filtering out incompatible inner builds happens in outer builds via hooking the DispatchToInnerBuild target. This works well when your project multi-targets and actually has an outer-build but for single target framework projects filtering isn't possible that way. Instead for traversal builds filter via the ResolveP2PReferences target.

Also removing the RawTargetFrameworks attribute on ProjectReferences as it isn't required anymore as the TargetFrameworks attribute contains everything needed for the best target framework selection.
@ViktorHofer
Copy link
Member Author

Just noticed that I forgot to actually request reviews :D @safern @ericstj could you please take a look? This is required to avoid building incompatible projects which don't multi-target, i.e. with BuildTargetFramework=net48 projects like System.Runtime.csproj would otherwise build in that vertical as there is no outer build anymore which filters out the incompatible inner builds.

ericstj
ericstj previously approved these changes Feb 11, 2022
Copy link
Member

@ericstj ericstj left a comment

Choose a reason for hiding this comment

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

I had just a nit on the naming. Where will you set this property? I don't expect us to set this in any of our library projects, just in the traversal projects, right?

@ViktorHofer
Copy link
Member Author

Where will you set this property? I don't expect us to set this in any of our library projects, just in the traversal projects, right?

Correct, this will just be set in the traversal projects (today those are called ref.proj, src.proj and tests.proj).

@ViktorHofer
Copy link
Member Author

@ericstj for some reason your approval was dismissed. Can you please re-approve?

@ViktorHofer ViktorHofer enabled auto-merge (squash) February 11, 2022 21:05
@ViktorHofer ViktorHofer merged commit ff6cc4e into main Feb 12, 2022
@safern safern deleted the ViktorHofer-patch-1 branch February 12, 2022 01:55
Copy link
Member

@ericstj ericstj left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants