Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Fix runtime package build for -allconfigurations build on Linux #34346

Closed
wants to merge 2 commits into from
Closed
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 pkg/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
We'll add a RID for the current platform even if it isn't in the officially supported set -->
<ItemGroup Condition="'@(OfficialBuildRID)' != ''">
<BuildRID Include="@(OfficialBuildRID)" Exclude="$(PackageRID)"/>
<BuildRID Include="$(PackageRID)">
<BuildRID Include="$(PackageRID)" Condition="'$(BuildsEvenIfRIDNotOfficiallySupported)' == 'true'">
Copy link
Member Author

Choose a reason for hiding this comment

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

I think the win10 uapaot leg fails because I didn't account for the Exclude="$(PackageRID)" on the first item. This second item isn't only for unofficial RIDs, it also adds official RIDs back in if the Exclude got rid of it. Looking into this.

Copy link
Member Author

Choose a reason for hiding this comment

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

That might be a problem, but the logic in pkg/dir.traversal.targets looks like a bigger problem:

%(Project.PackageTargetRuntime)$(PackageTargetRuntimeSuffixWithDash)' == '$(PackageRID)'

Since PackageTargetRuntimeSuffixWithDash is (I think) set based on the current configuration, rather than Project's target, this makes the win10-x64-aot configuration/PackageRID match up with the win10-x64 Project and not the win10-x64-aot Project. I believe this causes a mismatch resulting in the errors this change is hitting:

pkg\frameworkPackage.targets(61,5): error : IncludeLibFiles was specified but no file props were found in 'C:\git\source-build\src\corefx\artifacts\bin\pkg\uap\lib'

My scenario on Linux only happened to work because I never wanted an aot RID. Working on a better fix.

<Platform Condition="'$(ArchGroup)' == 'x64'">amd64</Platform>
<Platform Condition="'$(ArchGroup)' != 'x64'">$(ArchGroup)</Platform>
</BuildRID>
Expand Down
3 changes: 3 additions & 0 deletions pkg/Microsoft.Private.CoreFx.NETCoreApp/netcoreapp.rids.props
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@
<Platform>wasm</Platform>
</OfficialBuildRID>
</ItemGroup>
<PropertyGroup>
<BuildsEvenIfRIDNotOfficiallySupported>true</BuildsEvenIfRIDNotOfficiallySupported>
</PropertyGroup>
</Project>
10 changes: 9 additions & 1 deletion pkg/dir.traversal.targets
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,19 @@

<!-- When @(BuildRID) is set, filter the set of projects down to only those applicable to $(PackageRID) -->
<Target Name="FilterProjectsPackageRID" Condition="'@(BuildRID)' != ''">
<!--
Include the runtime suffix ('-aot') when matching up package target runtimes with PackageRID.
This makes sure /p:PackageRID=linux-x64 only matches linux-x64, not linux-x64-aot.
-->
<PropertyGroup Condition="'$(PackageTargetRuntimeSuffix)' != ''">
<PackageTargetRuntimeSuffixWithDash>-$(PackageTargetRuntimeSuffix)</PackageTargetRuntimeSuffixWithDash>
</PropertyGroup>

<ItemGroup>
<!-- Build identity package, when SkipBuildIdentityPackage is not set -->
<_projectsToBuild Include="@(Project)" Condition="'%(Project.PackageTargetRuntime)' == '' AND '$(SkipBuildIdentityPackage)' != 'true'" />
<!-- Build packages for current RID, when SkipBuildRuntimePackage is not set -->
<_projectsToBuild Include="@(Project)" Condition="'%(Project.PackageTargetRuntime)' == '$(PackageRID)' AND '$(SkipBuildRuntimePackage)' != 'true'" />
<_projectsToBuild Include="@(Project)" Condition="'%(Project.PackageTargetRuntime)$(PackageTargetRuntimeSuffixWithDash)' == '$(PackageRID)' AND '$(SkipBuildRuntimePackage)' != 'true'" />
</ItemGroup>

<ItemGroup>
Expand Down