-
Notifications
You must be signed in to change notification settings - Fork 81
-
Notifications
You must be signed in to change notification settings - Fork 81
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
[Traversal] Support Platforms
as a First Class Concept
#380
Comments
I believe a dirs.proj should invoke each referenced project, for all its supported platforms. Unlike any other P2P where the originator presumably already has a Platform set, which is used in negotiation, a dirs.proj is responsible to build "everything", so when no Platform/SetPlatform metadata is set on the P2P in a dirs.proj, it should just build every platform supported by that project. |
Do you mean the dirs.proj itself will set the Platforms property, or that it will support reading this property from referenced projects in order to invoke them? I think setting Platforms on dirs.proj would be weird, because it has no output. FWIW I think some of our dirs.proj in the VS repo have platform subsets defined in properties, but I think this is just a relic and that dirs.proj should build whatever projects they reference, all platforms by default. Any variation on this them like limiting platforms built to subsets could be optional additional properties or metadata set in the dirs.proj. |
@AArnott so basically like this? dirs.proj <Project Sdk="Microsoft.Build.Traversal">
<ItemGroup>
<ProjectReference Include="a/a.csproj" />
<ProjectReference Include="b/b.csproj" />
</ItemGroup>
</Project> Basic Execution Diagram
|
Yes, although the global property set on a.csproj would be |
is there documentation or somewhere i can read up on? To my knowledge |
It does seem to me that RID is more descriptive and perhaps less problematic than Platform. Nevertheless Platform is a very well established concept in msbuild projects and what we need to work with first. RIDs can and I believe do tend to follow Platform's lead. For example a Debug|x86 setting for Config|Platform can end up setting the RID to win-x86. Now, if you also had linux-x86 as a rid, you'd have to create a new project platform for that (or more likely, a new debug_linux config) and set the RID based on that yourself. But in VS at least, config|platform are the only dimensions we get to switch around on. Maybe one day RID will be an option or replace Platform, but until then, we need platform support. |
Got it - thought NearestTargetFramework was wild - little did i know. Back to the feature request - when you list a project that references a library project that is not listed in the dirs.proj. Would you expect that Library to be also queried and matrix build for all platforms available or just the ones referenced in the |
MSBuild projects cannot be influenced by external projects except via P2P. So when a project references a library project, the way its P2P behaves cannot vary based on the presence of a dirs.proj. A dirs.proj has no platform, and is generally used to build a whole set of projects just to make sure they build, which leads me to suggest that they should build everything (all platforms) in each project. |
@benvillalobos Traversal projects are just a project that has ProjectReference items for build scheduling while the traversal project itself doesn't emit any output. How does a C# project-to-project reference work in MSBuild today with Platforms? Traversal projects should just tell MSBuild that a dependent project needs to be built and the .NET SDK should schedule the inner builds for each target framework and platform right? |
For each target framework yes the SDK does this today. But platforms do not all get inner-builds for them. The intersection of the two is perhaps interesting though. Because if/when that feature request is ever delivered, dirs.proj might implicitly have the behavior of building all platforms for a referenced project by default. But as the feature request is unlikely to be fulfilled in the foreseeable future, and the requested behavior in this issue can be done more cheaply and with far less concern for backward compatibility, it makes sense IMO to do this. |
See the first example of dotnet/msbuild#7760 (comment), TraversalPlusP2PToVcxproj.zip.
The ask: The Traversal SDK should support
Platforms
as a first class concept, and attempt to build allProjectReference
items based on what's found inPlatforms
.Questions:
dirs.proj
's typically don't have a "preferred platform" (correct me if I'm wrong), so I'm not sure how we would "just know" what to build a project as.cc @AArnott
The text was updated successfully, but these errors were encountered: