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

Changing Windows_NT -> Windows for enabling TargetPlatformMoniker feature of the sdk for platform specific tfms. #43651

Merged
merged 13 commits into from
Nov 2, 2020

Conversation

Anipik
Copy link
Contributor

@Anipik Anipik commented Oct 20, 2020

Related to #32451 & #43646
Sdk introduced the TargetPlatformMoniker feature to support the platforms in the tfms string. But the tfms cannot have underscore in their name.

@Anipik
Copy link
Contributor Author

Anipik commented Oct 21, 2020

We are changing Windows_NT -> win to use the sdks TargetPlatformMoniker feature. TargetPlatformMoniker does not allow underscore in the tfm string,
I chose win to match with rid used.

The other option could be Windows if we want to avoid abbreviations. @jkotas @stephentoub @terrajobst do you have any preferences here ?

@jkotas
Copy link
Member

jkotas commented Oct 21, 2020

The regular user-facing TargetPlatformMonikers look like Windows,Version=7.0, etc. Is that correct?

I think we should match the public SDK style. The namespace for these is different from the RID namespace and that's by design.

@Anipik
Copy link
Contributor Author

Anipik commented Oct 21, 2020

The regular user-facing TargetPlatformMonikers look like Windows,Version=7.0, etc. Is that correct?

Thats correct.

@Anipik Anipik changed the title [Donot Review][Draft] Changing Windows_NT -> win for enabling TargetPlatformMoniker feature of the sdk for platform specific tfms. Changing Windows_NT -> Windows for enabling TargetPlatformMoniker feature of the sdk for platform specific tfms. Oct 21, 2020
@huoyaoyuan
Copy link
Member

Don't forget newly updated doc using this term in #43557

docs/pr-guide.md Outdated Show resolved Hide resolved
Copy link
Member

@safern safern left a comment

Choose a reason for hiding this comment

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

Will this cause the SDK to add a dependency to WPF/Winforms for tmfs >= net5.0 where tfm-windows is a valid target framework?

@Anipik
Copy link
Contributor Author

Anipik commented Oct 22, 2020

Will this cause the SDK to add a dependency to WPF/Winforms for tmfs >= net5.0 where tfm-windows is a valid target framework?

Currently the sdk does not know about the -windows platform is there way to verify if sdk will add a dependency ?

@ViktorHofer
Copy link
Member

ViktorHofer commented Oct 22, 2020

Are you sure about that? net5.0-windows should already be something that the SDK parses into the windows TargetPlatformMoniker.

net5.0-windows will be used to expose Windows-specific functionality, like Windows Forms and WPF.

from https://devblogs.microsoft.com/dotnet/announcing-net-5-0-preview-8/

@Anipik
Copy link
Contributor Author

Anipik commented Oct 22, 2020

Are you sure about that? net5.0-windows should already be something that the SDK parses into the windows TargetPlatformMoniker.

i was talking about our current way of parsing. After we enabled the new feature it will use the sdk parsing. Currently we parse it our selves.

@Anipik
Copy link
Contributor Author

Anipik commented Oct 22, 2020

@ViktorHofer @safern @ericstj can you please review this one ?

@ViktorHofer
Copy link
Member

i was talking about our current way of parsing. After we enabled the new feature it will use the sdk parsing. Currently we parse it our selves.

Can you please test that scenario before we review/merge this, given that we are planning to depend on that feature (TargetPlatformMoniker) soon?

@Anipik
Copy link
Contributor Author

Anipik commented Oct 22, 2020

Can you please test that scenario before we review/merge this, given that we are planning to depend on that feature (TargetPlatformMoniker) soon?

I verified there are no additional references or changes due to the platform.

@ViktorHofer
Copy link
Member

ViktorHofer commented Oct 22, 2020

I verified there are no additional references or changes due to the platform.

@dsplaisted what are the observable changes when the TargetPlatformMoniker is set to windows?

@jkotas
Copy link
Member

jkotas commented Oct 22, 2020

This is not just about -windows. There are other platform monikers used by dotnet/runtime libraries projects that overlap with the official platform monikers in .NET SDK, for example -Android.

@ViktorHofer
Copy link
Member

Right but AFAIK those aren't yet implemented and observable?

@dsplaisted
Copy link
Member

Right now using -windows in the TargetFramework doesn't add any references. It will default to Windows 7.0. If you specify UseWindowsFormsorUseWPF, you will get a reference to the Microsoft.WindowsDesktop.Appshared framework. And if you specify a 10.0 version of Windows, you will get aMicrosoft.Windows.SDK.NET.Ref` targeting pack reference which will provide the CSWinRT projections of the Windows WinRT APIs.

Android and iOS aren't supported currently by the SDK, and you'll get errors if you try to target them unless you set some properties (TargetPlatformSupported and TargetPlatformVersionSupported).

@ViktorHofer
Copy link
Member

ViktorHofer commented Oct 22, 2020

Thanks Daniel.

@ericstj what are your thoughts on this? Sounds like we would need to remove additional references if they would come via TargetPlatformMoniker.

@ericstj
Copy link
Member

ericstj commented Oct 22, 2020

@ericstj what are your thoughts on this? Sounds like we would need to remove additional references if they would come via TargetPlatformMoniker.

It doesn't seem all that different to me than the fact that we need to remove all references that come from the SDK since we build those things. I would hope that anything that might be implicitly referenced in is also disable-able.

@ViktorHofer
Copy link
Member

@dsplaisted if I understood correctly, the Microsoft.WindowsDesktop.App shared framework won't come into play as long as we don't set UseWindowsForms or UseWPF. Is it possible to disable the implicit Microsoft.Windows.SDK.NET.Ref targeting pack?

I would hope that anything that might be implicitly referenced in is also disable-able.

@dsplaisted can we make sure that anything that is referenced based on the TargetPlatformMoniker can be disabled?

@dsplaisted
Copy link
Member

Generally you can disable these by setting DisableImplicitFrameworkReferences to true. If there's one that's not covered with a flag, we can probably always add a flag if you need to, or it's MSBuild so you can generally work around it anyway.

@ViktorHofer
Copy link
Member

Thanks for the input Daniel and Eric.

Copy link
Member

@ViktorHofer ViktorHofer left a comment

Choose a reason for hiding this comment

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

LGTM in general but I didn't review fully. We might want to wait until 11/2 (November's infra rollout) before merging.

@ViktorHofer
Copy link
Member

I found one usage of TargetOS Windows_NT in Arcade that needs to be updated: https://github.com/dotnet/arcade/blob/cc7b7d1ee1d070cb3ccc2ffd6f4061850ddd232a/src/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk/src/build/Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk.targets#L43.

@ViktorHofer
Copy link
Member

ViktorHofer commented Oct 28, 2020

@Anipik what's the status of this PR? Asking as you didn't add it to the November rollout issue.

@Anipik
Copy link
Contributor Author

Anipik commented Oct 28, 2020

@Anipik what's the status of this PR? Asking as you didn't add it to the November rollout issue.

its ready for merging. i wasnt aware of how we do the rollouts. i added the pr to the issue

@ViktorHofer
Copy link
Member

i added the pr to the issue

Thanks, I will send out the rollout notice to the team today.

@@ -16,7 +16,7 @@ Below is a list of all the various options we pivot the project builds on:

- **Target Frameworks:** .NETFramework, .NETStandard, .NETCoreApp
- **Platform Runtimes:** .NETFramework (aka CLR/Desktop), CoreCLR, Mono
- **OS:** Windows_NT, Linux, OSX, FreeBSD, AnyOS
- **OS:** windows, Linux, OSX, FreeBSD, AnyOS

Choose a reason for hiding this comment

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

Why make Windows be lowercase but the rest capitalized? Is the plan to make the rest lowercase too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes the plan is to make them similar to sdk targetPlatform strings

@ViktorHofer
Copy link
Member

ViktorHofer commented Nov 3, 2020

@Anipik as discussed last week, can you please make sure that issues are filed/refcounted for the CI failures?

// EDIT: Ah I see you did but didn't link them here. If you don't mind please link them back in failing PRs so that we know if folks followed up on issues. Thanks

@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants