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

removing $(OS) uses from the libraries #32673

Merged
merged 1 commit into from
Feb 24, 2020
Merged

removing $(OS) uses from the libraries #32673

merged 1 commit into from
Feb 24, 2020

Conversation

Anipik
Copy link
Contributor

@Anipik Anipik commented Feb 21, 2020

Working towards #32451

@Anipik Anipik changed the title removing $(OS) using from the libraries removing $(OS) uses from the libraries Feb 21, 2020
@ViktorHofer
Copy link
Member

@Anipik can you please share the motivation for doing this? Can you share your discussion with Eric?

@Anipik
Copy link
Contributor Author

Anipik commented Feb 21, 2020

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>
Copy link
Member

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?

Copy link
Member

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?

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 that's the final goal

@ViktorHofer
Copy link
Member

Thanks, that makes sense. Two questions:

  • Are you going to replace the OSGroup usages in dotnet/arcade with ([MSBuild]::IsOSPlatform('X'))? We should not leak that custom property into Arcade.
  • We should really rename the OSGroup property name. It still confuses me, BuildOS would really have been a better choice.

@Anipik
Copy link
Contributor Author

Anipik commented Feb 21, 2020

Are you going to replace the OSGroup usages in dotnet/arcade with ([MSBuild]::IsOSPlatform('X'))? We should not leak that custom property into Arcade.

No I am not changing the OS -> OSGroup as OSGroup is defined by runtime repo. However, I will remove OSGroup from the codeAnalysis part.

We should really rename the OSGroup property name. It still confuses me, BuildOS would really have been a better choice.

I can do that as part of this PR

@ViktorHofer
Copy link
Member

No I am not changing the OS -> OSGroup as OSGroup is defined by runtime repo.

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.

@Anipik
Copy link
Contributor Author

Anipik commented Feb 21, 2020

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.

@ViktorHofer
Copy link
Member

yes we can do that in arcade.

Created dotnet/arcade#4907 to track this.

@Anipik
Copy link
Contributor Author

Anipik commented Feb 24, 2020

@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 ?

@Anipik Anipik merged commit 6a33d96 into dotnet:master Feb 24, 2020
@ericstj
Copy link
Member

ericstj commented Feb 24, 2020

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.

@Anipik
Copy link
Contributor Author

Anipik commented Feb 24, 2020

sure I will keep an eye on those.

@Anipik Anipik deleted the OS branch February 24, 2020 23:36
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants