Build rid specific pkgs under condition and -s390x (#56906)
authorViktor Hofer <viktor.hofer@microsoft.com>
Thu, 5 Aug 2021 13:21:32 +0000 (15:21 +0200)
committerGitHub <noreply@github.com>
Thu, 5 Aug 2021 13:21:32 +0000 (15:21 +0200)
Build rid specific packages under libraries only when targeting the
primary runtime flavor to avoid duplicate packages being published.

Remove the runtime.native.System.IO.Ports s390x variant as that one
isn't built in official builds and causes the restore of the
meta package runtime.native.System.IO.Ports to fail because of its
missing dependency.

src/libraries/System.IO.Ports/pkg/runtime.linux-s390.runtime.native.System.IO.Ports.proj [deleted file]
src/libraries/libraries-packages.proj

diff --git a/src/libraries/System.IO.Ports/pkg/runtime.linux-s390.runtime.native.System.IO.Ports.proj b/src/libraries/System.IO.Ports/pkg/runtime.linux-s390.runtime.native.System.IO.Ports.proj
deleted file mode 100644 (file)
index 2ae8829..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<Project>
-  <Import Project="runtime.native.System.IO.Ports.props" />
-
-  <PropertyGroup>
-    <!-- TODO: Remove when the package shipped. -->
-    <DisablePackageBaselineValidation>true</DisablePackageBaselineValidation>
-  </PropertyGroup>
-</Project>
\ No newline at end of file
index ebbce83..4232bcf 100644 (file)
   </ItemGroup>
 
   <ItemGroup>
-    <!-- Build the identity package in the allconfigurations build. -->
-    <ProjectReference Include="$(MSBuildThisFileDirectory)*\pkg\runtime.native.*.proj" Condition="'$(BuildAllConfigurations)' == 'true'" />
-    <!-- Build the runtime specific package matching the current RID, outside of an allconfigurations build. -->
-    <ProjectReference Include="$(MSBuildThisFileDirectory)*\pkg\runtime.$(OutputRid).*.proj" Condition="'$(BuildAllConfigurations)' != 'true'" />
+    <!-- During an official build, build the identity package only in the allconfigurations build, otherwise always. -->
+    <ProjectReference Include="$(MSBuildThisFileDirectory)*\pkg\runtime.native.*.proj" Condition="'$(BuildingAnOfficialBuildLeg)' != 'true' or '$(BuildAllConfigurations)' == 'true'" />
+    <!-- During an official Build, build the rid specific package matching the OutputRid only outside of an allconfigurations build and only when targeting the CoreCLR runtime.
+         The limitation on the CoreCLR runtime is entirely artificial but avoids duplicate assets being publish. -->
+    <ProjectReference Include="$(MSBuildThisFileDirectory)*\pkg\runtime.$(OutputRid).*.proj" Condition="'$(BuildingAnOfficialBuildLeg)' != 'true' or
+                                                                                                        ('$(BuildAllConfigurations)' != 'true' and '$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)')" />
   </ItemGroup>
 
   <!-- Need the PackageIndexFile file property from baseline.props -->