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

Identify inner build in consuming project #2472

Conversation

rainersigwald
Copy link
Member

This is a proposed ProjectReference protocol change and the required new target (+ dependency on NuGet.Frameworks).

This allows solving the double-evaluation-of-ProjectReferences problem by ensuring that a) every referencing project calls into the same cached GetTargetFrameworks-with-no-TF-set evaluation of the reference, and b) single-targeted projects will use the same evaluation for their build.

It is also cacheable, but that's not done here.

Builds on #2458, since that simplified the ProjectReference flow.

In order to avoid batching the
_GetProjectReferenceTargetFrameworkProperties target for each reference,
the ProjectReference protocol can be amended to return an item from
GetTargetFrameworkProperties instead of a semicolon-delimited list of
key-value pairs. This allows a single build request to be sent to the
engine, and allows resolving references in parallel on multiprocess
builds.
The previous commit is a breaking change to the ProjectReference
protocol, requiring a .NET Core SDK change to return the now-expected
structured data rather than the old semicolon-delimited string.

That means, for example, that MSBuild v15.5 couldn't build a solution
containing a full framework project that referenced a .NET Core SDK
2.0.0 project.

To avoid this, reconstruct the new structured data from the old return
value:
* Allow the MSBuild engine to split the returned value on `;` and return
  multiple values.
* Batch over metadata common to those values to reconstruct a single
  item with the complete string return value.
* Parse that string into structured metadata on a single item, as though
  the project had returned a single item with metadata.
* Remove the now-redundant individual-valued items.
* Continue as before with adjusting the reference items based on the
  metadata.
In preparation for describing the changes to return values I'd like to make, I need to document what the old ones were.
Document the more-succinct-but-compatibility-breaking single-item-with-metadata return possibility for GetTargetFrameworkProperties.

======================================================================================
-->
<Target Name="_GetProjectReferenceTargetFrameworkProperties">
Copy link
Member Author

Choose a reason for hiding this comment

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

This is no longer needed if the above multitargeting handling is comprehensive. If we go with the try-the-new-way-and-don't-fail-if-it-doesn't-work approach, it'd serve as the compat fallback.

@rainersigwald rainersigwald force-pushed the get-tf-compatibility-in-consumer branch from 23bdb14 to 09b99b6 Compare August 24, 2017 21:58
@rainersigwald
Copy link
Member Author

Left to do:

  • Figure out if the breaking change is ok (or implement `<MSBuild Dont
  • Figure out TF-compat-oracle story
  • Productize error messages
  • Compat testing on cli
  • Perf

AndyGerlicher added a commit to AndyGerlicher/msbuild that referenced this pull request Sep 21, 2017
Add optional SkipMissingTargets property to the MSBuild task. This
allows for the ability to make changes to our project to project
reference protocol which would be an otherwise breaking change.

Related to dotnet#2472

Closes dotnet#2471
AndyGerlicher added a commit to AndyGerlicher/msbuild that referenced this pull request Sep 27, 2017
Add optional SkipMissingTargets property to the MSBuild task. This
allows for the ability to make changes to our project to project
reference protocol which would be an otherwise breaking change.

Related to dotnet#2472

Closes dotnet#2471
AndyGerlicher added a commit to AndyGerlicher/msbuild that referenced this pull request Sep 27, 2017
Add optional SkipNonexistentTargets property to the MSBuild task. This
allows for the ability to make changes to our project to project
reference protocol which would be an otherwise breaking change.

Related to dotnet#2472

Closes dotnet#2471
@AndyGerlicher
Copy link
Contributor

Closing in favor of #2595

radical pushed a commit to mono/msbuild that referenced this pull request Oct 25, 2017
Add optional SkipNonexistentTargets property to the MSBuild task. This
allows for the ability to make changes to our project to project
reference protocol which would be an otherwise breaking change.

Related to dotnet#2472

Closes dotnet#2471
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants