-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
removing $(OS) uses from the libraries #32673
Conversation
@Anipik can you please share the motivation for doing this? Can you share your discussion with Eric? |
Earlier we didnt have a good way in msbuild to get the os we are running on. so we started using this shell property to get that. We currently have 2 properties i.e. OSGroup and OS representing the same thing in our libraries subset. We can calculate the OSGroup without the need of the OS. We are already doing it for non-windows OSES https://github.com/dotnet/runtime/pull/32673/files#diff-d3bedba39ce6da3e37ca0db83d7ef035R30 cc @ericstj |
@@ -29,7 +29,7 @@ | |||
<DefaultOSGroup Condition="'$(DefaultOSGroup)' == '' and $([MSBuild]::IsOSPlatform('FREEBSD'))">FreeBSD</DefaultOSGroup> | |||
<DefaultOSGroup Condition="'$(DefaultOSGroup)' == '' and $([MSBuild]::IsOSPlatform('NETBSD'))">NetBSD</DefaultOSGroup> | |||
<DefaultOSGroup Condition="'$(DefaultOSGroup)' == '' and $([MSBuild]::IsOSUnixLike())">Linux</DefaultOSGroup> | |||
<DefaultOSGroup Condition="'$(DefaultOSGroup)' == ''">$(OS)</DefaultOSGroup> | |||
<DefaultOSGroup Condition="'$(DefaultOSGroup)' == '' and $([MSBuild]::IsOSPlatform('WINDOWS'))">Windows_NT</DefaultOSGroup> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not keep the $(OS)
fallback here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you doing this to switch to the RID layout and not using $(OS)
at all anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that's the final goal
Thanks, that makes sense. Two questions:
|
No I am not changing the OS -> OSGroup as OSGroup is defined by runtime repo. However, I will remove OSGroup from the codeAnalysis part.
I can do that as part of this PR |
I think you misunderstood me. I was asking if you remove the OSGroup usages not the OS ones. It seems that OSGroup conditions should be replaceable with the MSBuild IsOSPlatofmr functions. |
yes we can do that in arcade. |
Created dotnet/arcade#4907 to track this. |
@ViktorHofer BuildOS is causing some troubles. I am debugging it and we can make that change in the another pr. @ViktorHofer @ericstj can you review this one ? |
Keep an eye on the rolling build when merging. Since this changes an entry-point property it's possible it has some differences between official/CI. |
sure I will keep an eye on those. |
Working towards #32451