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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/workflow/building/libraries/freebsd-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ index 81b8c7b..bb26868 100644
@@ -5,6 +5,7 @@
<BuildArguments>$(Platform) $(Configuration) skiptests</BuildArguments>
<BuildArguments Condition="'$(SkipDisablePgo)' != 'true'">$(BuildArguments) -nopgooptimize</BuildArguments>
<BuildArguments Condition="'$(OS)' != 'Windows_NT'">$(BuildArguments) msbuildonunsupportedplatform</BuildArguments>
<BuildArguments Condition="'$(OSGroup)' != 'Windows_NT'">$(BuildArguments) msbuildonunsupportedplatform</BuildArguments>
+ <BuildArguments Condition="'$(TargetOS)' == 'FreeBSD'">$(BuildArguments) -clang6.0</BuildArguments>
<BuildArguments Condition="'$(UseSystemLibraries)' == 'true'">$(BuildArguments) cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE</BuildArguments>
<BuildArguments Condition="$(Platform.Contains('arm'))">$(BuildArguments) skipnuget cross -skiprestore cmakeargs -DFEATURE_GDBJIT=TRUE</BuildArguments>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
XmlInputPaths="@(AsnXml)"
OutputPaths="@(AsnXml -> '$(IntermediateOutputPath)asnxml\%(filename).cs')" />

<Exec Condition="'$(OS)'=='Windows_NT'"
<Exec Condition="'$(OSGroup)'=='Windows_NT'"
IgnoreExitCode="true"
StandardOutputImportance="Low"
Command="$(SystemRoot)\System32\fc.exe /a @(AsnXml -> '$(IntermediateOutputPath)asnxml\%(filename).cs') @(AsnXml -> '%(Identity).cs')">
<Output TaskParameter="ExitCode" ItemName="_AsnXmlDiffCode" />
</Exec>

<!-- TODO: Call diff on Unix -->
<ItemGroup Condition="'$(OS)'!='Windows_NT'">
<ItemGroup Condition="'$(OSGroup)'!='Windows_NT'">
<_AsnXmlDiffCode Include="1" />
</ItemGroup>

Expand Down
10 changes: 5 additions & 5 deletions src/libraries/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -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

</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -168,9 +168,9 @@

<!-- There are no WebAssembly tools, so use the default ones -->
<_buildingInOSX>$([MSBuild]::IsOSPlatform('OSX'))</_buildingInOSX>
<ToolRuntimeRID Condition="'$(RuntimeOS)' == 'webassembly' and '$(OS)' == 'Windows_NT'">win-x64</ToolRuntimeRID>
<ToolRuntimeRID Condition="'$(RuntimeOS)' == 'webassembly' and '$(OS)' != 'Windows_NT' and $(_buildingInOSX)">osx-x64</ToolRuntimeRID>
<ToolRuntimeRID Condition="'$(RuntimeOS)' == 'webassembly' and '$(OS)' != 'Windows_NT' and !$(_buildingInOSX)">linux-x64</ToolRuntimeRID>
<ToolRuntimeRID Condition="'$(RuntimeOS)' == 'webassembly' and '$(OSGroup)' == 'Windows_NT'">win-x64</ToolRuntimeRID>
<ToolRuntimeRID Condition="'$(RuntimeOS)' == 'webassembly' and '$(OSGroup)' != 'Windows_NT' and $(_buildingInOSX)">osx-x64</ToolRuntimeRID>
<ToolRuntimeRID Condition="'$(RuntimeOS)' == 'webassembly' and '$(OSGroup)' != 'Windows_NT' and !$(_buildingInOSX)">linux-x64</ToolRuntimeRID>

<!-- support cross-targeting by choosing a RID to restore when running on a different machine that what we're build for -->
<_portableOS Condition="'$(OSGroup)' == 'Unix' and '$(_runtimeOSFamily)' != 'osx' and '$(_runtimeOSFamily)' != 'FreeBSD' and '$(_runtimeOS)' != 'linux-musl'">linux</_portableOS>
Expand Down Expand Up @@ -222,7 +222,7 @@
<DebugType>portable</DebugType>

<!-- Empty DebugType when building for netfx and in windows so that it is set to full or pdbonly later -->
<DebugType Condition="'$(TargetsNetFx)' == 'true' and '$(OS)' == 'Windows_NT'" />
<DebugType Condition="'$(TargetsNetFx)' == 'true' and '$(OSGroup)' == 'Windows_NT'" />

<!-- Workaround for codecov issue https://github.com/tonerdo/coverlet/issues/312 -->
<EnableSourceLink Condition="'$(ContinuousIntegrationBuild)' != 'true' and '$(OfficialBuildId)' == ''">false</EnableSourceLink>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<GeneratorRuntimeConfig>$(MSBuildToolsPath)\MSBuild.runtimeconfig.json</GeneratorRuntimeConfig>
<GeneratorCommand Condition="'$(TargetsNetCoreApp)' == 'true'">"$(TestHostRootPath)$([System.IO.Path]::GetFileName('$(DotNetTool)'))" --fx-version $(ProductVersion)</GeneratorCommand>
<GeneratorCommand Condition="'$(TargetsNetCoreApp)' != 'true'">"$(DotNetTool)"</GeneratorCommand>
<GeneratorCommand Condition="'$(OS)' == 'Windows_NT'">set DOTNET_MULTILEVEL_LOOKUP=0 &amp; $(GeneratorCommand)</GeneratorCommand>
<GeneratorCommand Condition="'$(OS)' != 'Windows_NT'">export DOTNET_MULTILEVEL_LOOKUP=0 &amp;&amp; $(GeneratorCommand)</GeneratorCommand>
<GeneratorCommand Condition="'$(OSGroup)' == 'Windows_NT'">set DOTNET_MULTILEVEL_LOOKUP=0 &amp; $(GeneratorCommand)</GeneratorCommand>
<GeneratorCommand Condition="'$(OSGroup)' != 'Windows_NT'">export DOTNET_MULTILEVEL_LOOKUP=0 &amp;&amp; $(GeneratorCommand)</GeneratorCommand>
</PropertyGroup>
<ItemGroup Condition=" '$(SkipTestsOnPlatform)' != 'true' ">
<Compile Include=".\SGenTests.cs" />
Expand Down
8 changes: 4 additions & 4 deletions src/libraries/Native/build-native.proj
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

<PropertyGroup>
<!-- Hardcode version paths in a global location. -->
<NativeVersionFile Condition="'$(OS)' == 'Windows_NT'">$(ArtifactsObjDir)_version.h</NativeVersionFile>
<NativeVersionFile Condition="'$(OS)' != 'Windows_NT'">$(ArtifactsObjDir)_version.c</NativeVersionFile>
<NativeVersionFile Condition="'$(OSGroup)' == 'Windows_NT'">$(ArtifactsObjDir)_version.h</NativeVersionFile>
<NativeVersionFile Condition="'$(OSGroup)' != 'Windows_NT'">$(ArtifactsObjDir)_version.c</NativeVersionFile>
<_BuildNativeArgs>$(ArchGroup) $(Configuration) outconfig $(BuildTargetFramework)-$(OSGroup)-$(Configuration)-$(ArchGroup)</_BuildNativeArgs>
</PropertyGroup>

<Target Name="BuildNativeUnix"
Condition="'$(OS)' != 'Windows_NT'">
Condition="'$(OSGroup)' != 'Windows_NT'">

<PropertyGroup>
<!--
Expand Down Expand Up @@ -40,7 +40,7 @@

<!-- We don't have any native components when building for netfx. -->
<Target Name="BuildNativeWindows"
Condition="'$(OS)' == 'Windows_NT' and '$(TargetsNetFx)' != 'true'">
Condition="'$(OSGroup)' == 'Windows_NT' and '$(TargetsNetFx)' != 'true'">

<!-- Run script that invokes Cmake to create VS files, and then calls msbuild to compile them -->
<Message Text="&quot;$(MSBuildProjectDirectory)\build-native.cmd&quot; $(_BuildNativeArgs)" Importance="High"/>
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/restore/runtime/runtime.depproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
SkipUnchangedFiles="true"
UseHardlinksIfPossible="$(UseHardlink)" />

<Exec Command="chmod +x $(TestHostRootPath)%(DotnetExe.Filename)%(DotnetExe.Extension)" Condition="'$(OS)' != 'Windows_NT'"/>
<Exec Command="chmod +x $(TestHostRootPath)%(DotnetExe.Filename)%(DotnetExe.Extension)" Condition="'$(OSGroup)' != 'Windows_NT'"/>
</Target>

<Target Name="OverrideRuntimeCoreCLR"
Expand Down