Don't run crossgen in VMR cross-arch builds

This commit is contained in:
Jackson Schuster 2023-11-22 09:49:17 -08:00
parent 81624ebbf5
commit 3a3be75448
2 changed files with 7 additions and 7 deletions

View file

@ -2,9 +2,9 @@
<!-- Crossgen is currently not supported on the s390x, ppc64le architecture as using mono instead of CoreCLR. <!-- Crossgen is currently not supported on the s390x, ppc64le architecture as using mono instead of CoreCLR.
Neither crossgen2 nor mono is supported on the loongarch64 architecture at present. --> Neither crossgen2 nor mono is supported on the loongarch64 architecture at present. -->
<Target Name="CrossgenLayout" <Target Name="CrossgenLayout"
Condition="'$(DISABLE_CROSSGEN)' == '' AND '$(Architecture)' != 's390x' AND '$(Architecture)' != 'ppc64le' AND '$(Architecture)' != 'loongarch64' AND '$(PackInstaller)' == 'true'" Condition="'$(DISABLE_CROSSGEN)' == '' AND '$(Architecture)' != 's390x' AND '$(Architecture)' != 'ppc64le' AND '$(Architecture)' != 'loongarch64' AND '$(PackInstaller)' == 'true' AND !('$(CROSSBUILD)' == 'true' AND '$(DotnetBuildVertical)' == 'true')"
DependsOnTargets="SetSdkBrandingInfo"> DependsOnTargets="SetSdkBrandingInfo">
<PropertyGroup> <PropertyGroup>
<RuntimeNETCoreAppPackageName>microsoft.netcore.app.runtime.$(SharedFrameworkRid)</RuntimeNETCoreAppPackageName> <RuntimeNETCoreAppPackageName>microsoft.netcore.app.runtime.$(SharedFrameworkRid)</RuntimeNETCoreAppPackageName>
<RuntimeNETCrossgenPackageName>microsoft.netcore.app.crossgen2.$(Crossgen2Rid)</RuntimeNETCrossgenPackageName> <RuntimeNETCrossgenPackageName>microsoft.netcore.app.crossgen2.$(Crossgen2Rid)</RuntimeNETCrossgenPackageName>
@ -59,7 +59,7 @@
<FSharpFiles Include="@(FSharpFilesRuntimes);@(FSharpFilesRoot)" /> <FSharpFiles Include="@(FSharpFilesRuntimes);@(FSharpFilesRoot)" />
<RazorToolFiles Include="$(SdkOutputDirectory)Sdks\Microsoft.NET.Sdk.Razor\tools\**\*" /> <RazorToolFiles Include="$(SdkOutputDirectory)Sdks\Microsoft.NET.Sdk.Razor\tools\**\*" />
<RemainingFiles Include="$(SdkOutputDirectory)**\*" Exclude="$(SdkOutputDirectory)FSharp\FSharp.Build.dll;@(RoslynFiles);@(FSharpFiles)" /> <RemainingFiles Include="$(SdkOutputDirectory)**\*" Exclude="$(SdkOutputDirectory)FSharp\FSharp.Build.dll;@(RoslynFiles);@(FSharpFiles)" />
<!-- Removing Full CLR built TestHost assemblies from getting Crossgen as it is throwing error, and they need to stay their original architecture. --> <!-- Removing Full CLR built TestHost assemblies from getting Crossgen as it is throwing error, and they need to stay their original architecture. -->
@ -130,7 +130,7 @@
<!-- FSharp.Build.dll causes the FSharp folder to be included. Remove it, as we don't want other FSharp dlls being included in the crossgen. --> <!-- FSharp.Build.dll causes the FSharp folder to be included. Remove it, as we don't want other FSharp dlls being included in the crossgen. -->
<RemainingFolders Remove="$(PublishDir)FSharp\**\*" /> <RemainingFolders Remove="$(PublishDir)FSharp\**\*" />
<!-- RemainingFolders should be ordered so that dependencies are first looked up in the leaf folders. <!-- RemainingFolders should be ordered so that dependencies are first looked up in the leaf folders.
Currently it is not ordered and crossgen is picking the wrong dlls when resolving dependencies: https://github.com/dotnet/core-sdk/pull/6774 Currently it is not ordered and crossgen is picking the wrong dlls when resolving dependencies: https://github.com/dotnet/core-sdk/pull/6774
As a partial solution, we remove the root folder from the list and put it back to the end. As a partial solution, we remove the root folder from the list and put it back to the end.
Remove the following 2 lines when resolving this issue: https://github.com/dotnet/core-sdk/issues/6877 --> Remove the following 2 lines when resolving this issue: https://github.com/dotnet/core-sdk/issues/6877 -->
@ -186,7 +186,7 @@
ReadyToRun="True" ReadyToRun="True"
CreateSymbols="$(CreateCrossgenSymbols)" CreateSymbols="$(CreateCrossgenSymbols)"
PlatformAssemblyPaths="@(RemainingFolders);$(SharedFrameworkNameVersionPath)" /> PlatformAssemblyPaths="@(RemainingFolders);$(SharedFrameworkNameVersionPath)" />
<Crossgen <Crossgen
SourceAssembly="%(RazorToolTargets.FullPath)" SourceAssembly="%(RazorToolTargets.FullPath)"
DestinationPath="%(RazorToolTargets.FullPath)" DestinationPath="%(RazorToolTargets.FullPath)"

View file

@ -38,7 +38,7 @@
<CoreSetupRid Condition="'$(CoreSetupRid)' == ''">$(HostRid)</CoreSetupRid> <CoreSetupRid Condition="'$(CoreSetupRid)' == ''">$(HostRid)</CoreSetupRid>
<CoreSetupRid Condition=" ('$(OSName)' == 'win' or '$(OSName)' == 'osx' or '$(OSName)' == 'freebsd') and '$(DotNetBuildFromSource)' != 'true' ">$(OSName)-$(Architecture)</CoreSetupRid> <CoreSetupRid Condition=" ('$(OSName)' == 'win' or '$(OSName)' == 'osx' or '$(OSName)' == 'freebsd') and '$(DotNetBuildFromSource)' != 'true' ">$(OSName)-$(Architecture)</CoreSetupRid>
<CoreSetupRid Condition="'$(DotNetBuildVertical)' != 'true' and $(HostRid.StartsWith('mariner.2.0'))">$(HostRid.Replace('mariner.2.0', 'cm.2'))</CoreSetupRid> <CoreSetupRid Condition="'$(DotNetBuildVertical)' != 'true' and $(CoreSetupRid.StartsWith('mariner.2.0'))">$(HostRid.Replace('mariner.2.0', 'cm.2'))</CoreSetupRid>
<!-- only the runtime OSX .pkgs have a `-internal` suffix --> <!-- only the runtime OSX .pkgs have a `-internal` suffix -->
<InstallerStartSuffix Condition="$([MSBuild]::IsOSPlatform('OSX'))">-internal</InstallerStartSuffix> <InstallerStartSuffix Condition="$([MSBuild]::IsOSPlatform('OSX'))">-internal</InstallerStartSuffix>
@ -509,7 +509,7 @@
<WriteLinesToFile File="$(RedistLayoutPath)metadata/workloads/$(CliProductBandVersion)00/userlocal" <WriteLinesToFile File="$(RedistLayoutPath)metadata/workloads/$(CliProductBandVersion)00/userlocal"
Overwrite="true" /> Overwrite="true" />
</Target> </Target>
<Target Name="LayoutAppHostTemplate" DependsOnTargets="RunResolvePackageDependencies"> <Target Name="LayoutAppHostTemplate" DependsOnTargets="RunResolvePackageDependencies">