Skip to content

Update static graph spec#4242

Merged
cdmihai merged 10 commits intodotnet:masterfrom
cdmihai:updateDocs
Mar 21, 2019
Merged

Update static graph spec#4242
cdmihai merged 10 commits intodotnet:masterfrom
cdmihai:updateDocs

Conversation

@cdmihai
Copy link
Copy Markdown
Contributor

@cdmihai cdmihai commented Mar 15, 2019

With the details from #4218 and caching.

@cdmihai
Copy link
Copy Markdown
Contributor Author

cdmihai commented Mar 19, 2019

Copy link
Copy Markdown
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.

mostly LGTM but I'm not sure I understand the code changes: are they integral to the doc change, or just more convenient to bundle?

Comment thread documentation/specs/static-graph.md Outdated
Comment thread documentation/specs/static-graph.md Outdated
<!-- how it works: outer builds and inner builds -->
Crosstargeting is implemented by having a project reference itself multiple times, once for each combination of crosstargeting global properties. This leads to multiple evaluations of the same project, with different global properties. These evaluations can be classified in two groups
1. Multiple inner builds. Each inner build is evaluated with one set of crosstargeting global properties (e.g. the `TargetFramework=net472` inner build, or the `TargetFramework=netcoreapp2.2` inner build).
2. One outer build. This evaluation does not have any crosstargeting global properties set. It can be viewed as a proxy for the inner builds. Other projects query the outer build in order to learn the set of valid crosstargeting global properties (the set of valid inner builds). When the outer build is also the root of the project to project graph, the outer build multicasts the entry target (i.e. `Build`, `Clean`, etc) to all inner builds.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it a problem that this "multicast" isn't very accurate today, and basically only works for Build and Clean?

Copy link
Copy Markdown
Contributor Author

@cdmihai cdmihai Mar 19, 2019

Choose a reason for hiding this comment

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

Not really, as Build, Clean are known graph wide operation for the SDK, and its multicasting code knows about both of them. Other SDKs that would want to implement their own multitargeting scheme, would have their own separate graph wide operations and their separate multicasting machinery. Unless the intent is that Microsoft.Common.Crosstargeting.targets should be used by all potentially crosstargeting SDKs. So I'd say to ignore this issue until the next crosstargeting SDK comes along and we have to actually decide on common infrastructure. Or until we hit real world usages :)

Comment thread documentation/specs/static-graph.md Outdated
Comment thread documentation/specs/static-graph.md Outdated
- Project classification:
- *Outer build*, when `$($(InnerBuildProperty))` is empty AND `$($(InnerBuildPropertyValues))` is not empty.
- *Dependent inner build*, when both `$($(InnerBuildProperty))` and `$($(InnerBuildPropertyValues))` are non empty. These are inner builds that were generated from an outer build.
- *Standalone inner build*, when `$($(InnerBuildProperty))` is not empty and `$($(InnerBuildPropertyValues))` is empty. These are inner builds that were not generated from an outer build.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't understand the distinction from the next case. Don't we always fill in TargetFramework, with a default if necessary? How would this arise?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

TargetFramework is not filled in for legacy csprojes:
image

So then with these non crosstargeting projects, SDKs can allow a mix of crosstargeting and non crosstargeting projects. If the need arises, we can add extra settings on how these are interpreted, like whether the SDK allows non crosstargeting projects or not.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess the larger question is: is there really a strong distinction between a single-targeted SDK-style project and a legacy csproj?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For the current SDK not really, but the code needs to reason about each type of project, so every project needs a type :) It seemed somehow wrong to classify these non-participating projects as standalone inner builds, so I added this extra one. Let me know if you feel strongly about removing it.

Comment thread documentation/specs/static-graph.md
Comment thread documentation/specs/static-graph.md Outdated
Comment thread documentation/specs/static-graph.md Outdated
Comment thread src/Build.UnitTests/Graph/ResultCacheBasedBuilds_Tests.cs Outdated
Comment thread src/Build/BackEnd/BuildManager/CacheSerialization.cs
@cdmihai
Copy link
Copy Markdown
Contributor Author

cdmihai commented Mar 19, 2019

mostly LGTM but I'm not sure I understand the code changes: are they integral to the doc change, or just more convenient to bundle?

Realized that the spec made an assertion for which no unit test existed, so decided to add the unit test. While adding the test, I need to expose extra stuff, and while exposing extra stuff I realized I can do a nice refactoring to decouple some stuff out of BuildManager.

rainersigwald and others added 6 commits March 19, 2019 15:14
Co-Authored-By: cdmihai <micodoba@microsoft.com>
Co-Authored-By: cdmihai <micodoba@microsoft.com>
Co-Authored-By: cdmihai <micodoba@microsoft.com>
Co-Authored-By: cdmihai <micodoba@microsoft.com>
@cdmihai cdmihai merged commit a7ec071 into dotnet:master Mar 21, 2019
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.

2 participants