Skip to content

Commit f9d0d6b

Browse files
authored
Enable portable cross-arch source-building to unknown architectures. (#54031)
The repository supports building for unknown rids to enable building for non-portable rids. This build configuration is under the '$(PortableBuild)' == 'false' condition. This changes those conditions to '$(DotNetBuildSourceOnly)' == 'true' to enable building a portable configuration for an unknown portable rid. This configuration is used when cross-building for an architecture that is not yet known to the SDK, like linux-ppc64le or linux-s390x.
1 parent b61a936 commit f9d0d6b

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
<!-- This defines the list of RIDs supported by the ASP.NET Core shared framework.
165165
The list is a semicolon separated list of RIDs. Whitespace may not be added to the property. -->
166166
<SupportedRuntimeIdentifiers>win-x64;win-x86;win-arm;win-arm64;osx-x64;osx-arm64;linux-musl-x64;linux-musl-arm;linux-musl-arm64;linux-x64;linux-arm;linux-arm64;freebsd-x64</SupportedRuntimeIdentifiers>
167-
<SupportedRuntimeIdentifiers Condition=" '$(PortableBuild)' == 'false' ">$(SupportedRuntimeIdentifiers);$(TargetRuntimeIdentifier)</SupportedRuntimeIdentifiers>
167+
<SupportedRuntimeIdentifiers Condition=" '$(DotNetBuildSourceOnly)' == 'true' ">$(SupportedRuntimeIdentifiers);$(TargetRuntimeIdentifier)</SupportedRuntimeIdentifiers>
168168

169169
<!-- Playwright provides binaries for Windows (x86 and x64), macOS (x64) and Linux (x64, non musl). We can't use it on other architectures. -->
170170
<IsPlaywrightAvailable Condition="'$(TargetOsName)' == 'linux-musl' OR ('$(TargetArchitecture)' != 'x86' AND '$(TargetArchitecture)' != 'x64')">false</IsPlaywrightAvailable>

eng/Common.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>
88
<TargetRuntimeIdentifier Condition="'$(TargetRuntimeIdentifier)' == ''">$(TargetOsName)-$(TargetArchitecture)</TargetRuntimeIdentifier>
99
<PortableBuild Condition="'$(PortableBuild)' == ''">true</PortableBuild>
10-
<DefaultAppHostRuntimeIdentifier Condition=" '$(PortableBuild)' == 'false' ">$(TargetRuntimeIdentifier)</DefaultAppHostRuntimeIdentifier>
10+
<DefaultAppHostRuntimeIdentifier Condition=" '$(DotNetBuildSourceOnly)' == 'true' ">$(TargetRuntimeIdentifier)</DefaultAppHostRuntimeIdentifier>
1111
</PropertyGroup>
1212

1313
<PropertyGroup Condition=" '$(BuildAllProjects)' == 'true' ">

eng/Dependencies.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ and are generated based on the last package release.
114114
<LatestPackageReference Include="Microsoft.NETCore.App.Runtime.linux-musl-arm64" />
115115
<LatestPackageReference Include="Microsoft.NETCore.App.Runtime.freebsd-x64" />
116116
<LatestPackageReference Include="Microsoft.NETCore.App.Runtime.freebsd-arm64" />
117-
<LatestPackageReference Include="Microsoft.NETCore.App.Runtime.$(TargetRuntimeIdentifier)" Condition=" '$(PortableBuild)' == 'false' " />
117+
<LatestPackageReference Include="Microsoft.NETCore.App.Runtime.$(TargetRuntimeIdentifier)" Condition=" '$(DotNetBuildSourceOnly)' == 'true' " />
118118

119119
<!-- Crossgen2 compiler -->
120120
<LatestPackageReference Include="Microsoft.NETCore.App.Crossgen2.osx-x64" />
@@ -131,7 +131,7 @@ and are generated based on the last package release.
131131
<LatestPackageReference Include="Microsoft.NETCore.App.Crossgen2.win-arm64" />
132132
<LatestPackageReference Include="Microsoft.NETCore.App.Crossgen2.freebsd-x64" />
133133
<LatestPackageReference Include="Microsoft.NETCore.App.Crossgen2.freebsd-arm64" />
134-
<LatestPackageReference Include="Microsoft.NETCore.App.Crossgen2.$(TargetRuntimeIdentifier)" Condition=" '$(PortableBuild)' == 'false' " />
134+
<LatestPackageReference Include="Microsoft.NETCore.App.Crossgen2.$(TargetRuntimeIdentifier)" Condition=" '$(DotNetBuildSourceOnly)' == 'true' " />
135135
</ItemGroup>
136136

137137
<ItemGroup Label=".NET team dependencies (Non-source-build)" Condition="'$(DotNetBuildFromSource)' != 'true'">

eng/testing/linker/SupportFiles/Directory.Build.targets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,19 @@
4949
-->
5050
<DefaultRuntimeFrameworkVersion Condition=" '$(IsServicingBuild)' != 'true' AND
5151
'%(TargetFramework)' == '$(TargetFramework)'">$(MicrosoftNETCoreAppRuntimeVersion)</DefaultRuntimeFrameworkVersion>
52-
<RuntimePackRuntimeIdentifiers Condition=" '$(PortableBuild)' == 'false' ">$(TargetRuntimeIdentifier)</RuntimePackRuntimeIdentifiers>
52+
<RuntimePackRuntimeIdentifiers Condition=" '$(DotNetBuildSourceOnly)' == 'true' ">$(TargetRuntimeIdentifier)</RuntimePackRuntimeIdentifiers>
5353
</KnownFrameworkReference>
5454

5555
<KnownAppHostPack Update="Microsoft.NETCore.App">
5656
<AppHostPackVersion
5757
Condition=" '%(TargetFramework)' == '$(TargetFramework)' ">$(MicrosoftNETCoreAppRuntimeVersion)</AppHostPackVersion>
58-
<AppHostRuntimeIdentifiers Condition=" '$(PortableBuild)' == 'false' ">$(TargetRuntimeIdentifier)</AppHostRuntimeIdentifiers>
58+
<AppHostRuntimeIdentifiers Condition=" '$(DotNetBuildSourceOnly)' == 'true' ">$(TargetRuntimeIdentifier)</AppHostRuntimeIdentifiers>
5959
</KnownAppHostPack>
6060

6161
<KnownRuntimePack Update="Microsoft.NETCore.App">
6262
<LatestRuntimeFrameworkVersion
6363
Condition=" '%(TargetFramework)' == '$(TargetFramework)' ">$(MicrosoftNETCoreAppRuntimeVersion)</LatestRuntimeFrameworkVersion>
64-
<AppHostRuntimeIdentifiers Condition=" '$(PortableBuild)' == 'false' ">$(TargetRuntimeIdentifier)</AppHostRuntimeIdentifiers>
64+
<AppHostRuntimeIdentifiers Condition=" '$(DotNetBuildSourceOnly)' == 'true' ">$(TargetRuntimeIdentifier)</AppHostRuntimeIdentifiers>
6565
</KnownRuntimePack>
6666

6767
</ItemGroup>

eng/tools/GenerateFiles/Directory.Build.targets.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,27 +75,27 @@
7575
<DefaultRuntimeFrameworkVersion Condition=" '$(IsServicingBuild)' != 'true' AND
7676
'%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' AND
7777
'$(TargetLatestDotNetRuntime)' != 'false' ">${MicrosoftNETCoreAppRuntimeVersion}</DefaultRuntimeFrameworkVersion>
78-
<RuntimePackRuntimeIdentifiers Condition=" '$(PortableBuild)' == 'false' ">$(TargetRuntimeIdentifier)</RuntimePackRuntimeIdentifiers>
78+
<RuntimePackRuntimeIdentifiers Condition=" '$(DotNetBuildSourceOnly)' == 'true' ">$(TargetRuntimeIdentifier)</RuntimePackRuntimeIdentifiers>
7979
</KnownFrameworkReference>
8080

8181
<KnownAppHostPack Update="Microsoft.NETCore.App">
8282
<AppHostPackVersion
8383
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRuntimeVersion}</AppHostPackVersion>
84-
<AppHostRuntimeIdentifiers Condition=" '$(PortableBuild)' == 'false' ">$(TargetRuntimeIdentifier)</AppHostRuntimeIdentifiers>
84+
<AppHostRuntimeIdentifiers Condition=" '$(DotNetBuildSourceOnly)' == 'true' ">$(TargetRuntimeIdentifier)</AppHostRuntimeIdentifiers>
8585
</KnownAppHostPack>
8686

8787
<KnownRuntimePack Update="Microsoft.NETCore.App">
8888
<LatestRuntimeFrameworkVersion
8989
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRuntimeVersion}</LatestRuntimeFrameworkVersion>
90-
<AppHostRuntimeIdentifiers Condition=" '$(PortableBuild)' == 'false' ">$(TargetRuntimeIdentifier)</AppHostRuntimeIdentifiers>
90+
<AppHostRuntimeIdentifiers Condition=" '$(DotNetBuildSourceOnly)' == 'true' ">$(TargetRuntimeIdentifier)</AppHostRuntimeIdentifiers>
9191
</KnownRuntimePack>
9292

9393
<KnownWebAssemblySdkPack Update="Microsoft.NET.Sdk.WebAssembly.Pack">
9494
<WebAssemblySdkPackVersion
9595
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRuntimeVersion}</WebAssemblySdkPackVersion>
9696
</KnownWebAssemblySdkPack>
9797

98-
<KnownCrossgen2Pack Update="Microsoft.NETCore.App.Crossgen2" Condition=" '$(PortableBuild)' == 'false' ">
98+
<KnownCrossgen2Pack Update="Microsoft.NETCore.App.Crossgen2" Condition=" '$(DotNetBuildSourceOnly)' == 'true' ">
9999
<Crossgen2PackVersion
100100
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRuntimeVersion}</Crossgen2PackVersion>
101101
<Crossgen2RuntimeIdentifiers>$(TargetRuntimeIdentifier)</Crossgen2RuntimeIdentifiers>

src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
106106
-->
107107
<BuildOsName>$(TargetOsName)</BuildOsName>
108108
<BuildOsName Condition="'$(TargetOsName)' == 'linux-musl' and '$(TargetArchitecture)' != 'x64'">linux</BuildOsName>
109-
<BuildOsName Condition=" '$(PortableBuild)' == 'false' ">$(TargetRuntimeIdentifier.Substring(0,$(TargetRuntimeIdentifier.IndexOf('-'))))</BuildOsName>
109+
<BuildOsName Condition=" '$(DotNetBuildSourceOnly)' == 'true' ">$(TargetRuntimeIdentifier.Substring(0,$(TargetRuntimeIdentifier.IndexOf('-'))))</BuildOsName>
110110
<Crossgen2BuildArchitecture Condition=" '$(BuildOsName)' == 'win' ">x64</Crossgen2BuildArchitecture>
111111
<Crossgen2BuildArchitecture Condition=" '$(Crossgen2BuildArchitecture)' == '' ">$(BuildArchitecture)</Crossgen2BuildArchitecture>
112112
<Crossgen2PackageRootVariableName>PkgMicrosoft_NETCore_App_Crossgen2_$(BuildOsName.Replace('.', '_'))-$(Crossgen2BuildArchitecture)</Crossgen2PackageRootVariableName>

0 commit comments

Comments
 (0)