Skip to content

Commit 33d20ad

Browse files
[release/7.0] source-build: support building aspnetcore using non-portable runtime packages. (#44978)
- source-build: support building aspnetcore using non-portable runtime packages. - Currently source-build performs 'runtime-portable' build that produces 'linux-{arch}' packages that are used when building ASP.NET Core. - With this change, we can use the non-portable packages that are produced by the source-build 'runtime' build, and eliminate the 'runtime-portable' build. - Invert PortableBuild checks. - Revert name change. Co-authored-by: Tom Deseyn <[email protected]>
1 parent eee5a7b commit 33d20ad

File tree

7 files changed

+20
-4
lines changed

7 files changed

+20
-4
lines changed

Directory.Build.props

+2
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@
174174
freebsd-x64
175175
</SupportedRuntimeIdentifiers>
176176

177+
<SupportedRuntimeIdentifiers Condition=" '$(PortableBuild)' == 'false' ">$(SupportedRuntimeIdentifiers);$(TargetRuntimeIdentifier)</SupportedRuntimeIdentifiers>
178+
177179
<!-- Playwright provides binaries for Windows (x86 and x64), macOS (x64) and Linux (x64, non musl). We can't use it on other architectures. -->
178180
<IsPlaywrightAvailable Condition="'$(TargetOsName)' == 'linux-musl' OR ('$(TargetArchitecture)' != 'x86' AND '$(TargetArchitecture)' != 'x64')">false</IsPlaywrightAvailable>
179181
<IsPlaywrightAvailable Condition="'$(IsPlaywrightAvailable)' == ''">true</IsPlaywrightAvailable>

eng/Common.props

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<TargetOsName Condition=" '$(TargetOsName)' == '' AND $([MSBuild]::IsOSPlatform('FreeBSD'))">freebsd</TargetOsName>
77
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>
88
<TargetRuntimeIdentifier Condition="'$(TargetRuntimeIdentifier)' == ''">$(TargetOsName)-$(TargetArchitecture)</TargetRuntimeIdentifier>
9+
<PortableBuild Condition="'$(PortableBuild)' == ''">true</PortableBuild>
10+
<DefaultAppHostRuntimeIdentifier Condition=" '$(PortableBuild)' == 'false' ">$(TargetRuntimeIdentifier)</DefaultAppHostRuntimeIdentifier>
911
</PropertyGroup>
1012

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

eng/Dependencies.props

+2
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ and are generated based on the last package release.
106106
<LatestPackageReference Include="Microsoft.NETCore.App.Runtime.linux-musl-arm" />
107107
<LatestPackageReference Include="Microsoft.NETCore.App.Runtime.linux-musl-arm64" />
108108
<LatestPackageReference Include="Microsoft.NETCore.App.Runtime.freebsd-x64" />
109+
<LatestPackageReference Include="Microsoft.NETCore.App.Runtime.$(TargetRuntimeIdentifier)" Condition=" '$(PortableBuild)' == 'false' " />
109110

110111
<!-- Crossgen2 compiler -->
111112
<LatestPackageReference Include="Microsoft.NETCore.App.Crossgen2.osx-x64" />
@@ -121,6 +122,7 @@ and are generated based on the last package release.
121122
<LatestPackageReference Include="Microsoft.NETCore.App.Crossgen2.win-arm" />
122123
<LatestPackageReference Include="Microsoft.NETCore.App.Crossgen2.win-arm64" />
123124
<LatestPackageReference Include="Microsoft.NETCore.App.Crossgen2.freebsd-x64" />
125+
<LatestPackageReference Include="Microsoft.NETCore.App.Crossgen2.$(TargetRuntimeIdentifier)" Condition=" '$(PortableBuild)' == 'false' " />
124126
</ItemGroup>
125127

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

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

+9
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,27 @@
5656
<DefaultRuntimeFrameworkVersion Condition=" ('$(IsServicingBuild)' != 'true' OR '$(NETCoreSdkVersion)' == '7.0.100-rtm.22478.12') AND
5757
'%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' AND
5858
'$(TargetLatestDotNetRuntime)' != 'false' ">${MicrosoftNETCoreAppRuntimeVersion}</DefaultRuntimeFrameworkVersion>
59+
<RuntimePackRuntimeIdentifiers Condition=" '$(PortableBuild)' == 'false' ">$(TargetRuntimeIdentifier)</RuntimePackRuntimeIdentifiers>
5960
</KnownFrameworkReference>
6061

6162
<KnownAppHostPack Update="Microsoft.NETCore.App">
6263
<AppHostPackVersion
6364
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRuntimeVersion}</AppHostPackVersion>
65+
<AppHostRuntimeIdentifiers Condition=" '$(PortableBuild)' == 'false' ">$(TargetRuntimeIdentifier)</AppHostRuntimeIdentifiers>
6466
</KnownAppHostPack>
6567

6668
<KnownRuntimePack Update="Microsoft.NETCore.App">
6769
<LatestRuntimeFrameworkVersion
6870
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRuntimeVersion}</LatestRuntimeFrameworkVersion>
71+
<AppHostRuntimeIdentifiers Condition=" '$(PortableBuild)' == 'false' ">$(TargetRuntimeIdentifier)</AppHostRuntimeIdentifiers>
6972
</KnownRuntimePack>
7073

74+
<KnownCrossgen2Pack Update="Microsoft.NETCore.App.Crossgen2" Condition=" '$(PortableBuild)' == 'false' ">
75+
<Crossgen2PackVersion
76+
Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRuntimeVersion}</Crossgen2PackVersion>
77+
<Crossgen2RuntimeIdentifiers>$(TargetRuntimeIdentifier)</Crossgen2RuntimeIdentifiers>
78+
</KnownCrossgen2Pack>
79+
7180
<!-- Use the just-built ASP.NET Core shared framework if available except when building product code in servicing. -->
7281
<KnownFrameworkReference Update="Microsoft.AspNetCore.App" Condition=" $(UpdateAspNetCoreKnownFramework) ">
7382
<LatestRuntimeFrameworkVersion

src/Components/benchmarkapps/Wasm.Performance/Driver/Wasm.Performance.Driver.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<!-- WebDriver is not strong-named, so this test project cannot be strong named either. -->
99
<SignAssembly>false</SignAssembly>
1010
<IsTestAssetProject>true</IsTestAssetProject>
11-
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
11+
<RuntimeIdentifier Condition=" '$(DotNetBuildFromSource)' != 'true' ">linux-x64</RuntimeIdentifier>
1212
<Nullable>annotations</Nullable>
1313
</PropertyGroup>
1414

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
9595
<Crossgen2ToolFileName Condition=" '$(TargetOsName)' == 'win' ">$(Crossgen2ToolFileName).exe</Crossgen2ToolFileName>
9696

9797
<!-- E.g. "PkgMicrosoft_NETCore_App_Runtime_win-x64" (set in obj/Microsoft.AspNetCore.App.Runtime.csproj.nuget.g.props). -->
98-
<RuntimePackageRootVariableName>PkgMicrosoft_NETCore_App_Runtime_$(RuntimeIdentifier)</RuntimePackageRootVariableName>
98+
<RuntimePackageRootVariableName>PkgMicrosoft_NETCore_App_Runtime_$(RuntimeIdentifier.Replace('.', '_'))</RuntimePackageRootVariableName>
9999

100100
<!--
101101
Determine the crossgen2 package path property name. Special case linux-musl-arm and linux-musl-arm64 because they
@@ -104,9 +104,10 @@ This package is an internal implementation of the .NET Core SDK and is not meant
104104
-->
105105
<BuildOsName>$(TargetOsName)</BuildOsName>
106106
<BuildOsName Condition="'$(TargetOsName)' == 'linux-musl' and '$(TargetArchitecture)'!='x64'">linux</BuildOsName>
107+
<BuildOsName Condition=" '$(PortableBuild)' == 'false' ">$(TargetRuntimeIdentifier.Substring(0,$(TargetRuntimeIdentifier.IndexOf('-'))))</BuildOsName>
107108
<Crossgen2BuildArchitecture Condition=" '$(BuildOsName)' == 'win' ">x64</Crossgen2BuildArchitecture>
108109
<Crossgen2BuildArchitecture Condition=" '$(Crossgen2BuildArchitecture)' == '' ">$(BuildArchitecture)</Crossgen2BuildArchitecture>
109-
<Crossgen2PackageRootVariableName>PkgMicrosoft_NETCore_App_Crossgen2_$(BuildOsName)-$(Crossgen2BuildArchitecture)</Crossgen2PackageRootVariableName>
110+
<Crossgen2PackageRootVariableName>PkgMicrosoft_NETCore_App_Crossgen2_$(BuildOsName.Replace('.', '_'))-$(Crossgen2BuildArchitecture)</Crossgen2PackageRootVariableName>
110111

111112
<AssetTargetFallback>$(AssetTargetFallback);native,Version=0.0</AssetTargetFallback>
112113

src/Tools/Directory.Build.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project>
22
<PropertyGroup Condition=" '$(PackAsTool)' == 'true' ">
33
<!-- Microsoft tool packages are required to target both x64 and x86. -->
4-
<PackAsToolShimRuntimeIdentifiers Condition=" '$(IsShippingPackage)' == 'true' ">win-x64;win-x86</PackAsToolShimRuntimeIdentifiers>
4+
<PackAsToolShimRuntimeIdentifiers Condition=" '$(IsShippingPackage)' == 'true' AND '$(DotNetBuildFromSource)' != 'true' ">win-x64;win-x86</PackAsToolShimRuntimeIdentifiers>
55
<!-- None of the tool projects are project reference providers. -->
66
<IsProjectReferenceProvider>false</IsProjectReferenceProvider>
77
<!--

0 commit comments

Comments
 (0)