-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Publish crossgen as AOT if supported by the target platform #65948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
1c237a9
b3435c2
800b2d3
2509e2f
6a1c6ff
bdc0042
b4b7721
593dc27
449fbf4
c3b6fba
e210695
69ae018
a52f4ca
3fe8a1d
4c3f31a
07c2f6c
f2f45e6
35fa89a
5a8df96
497836e
9897beb
acb5fd5
9290f87
94c4545
349dccc
6333ee4
a8e28d0
4445b93
ff7c339
b897d68
1e111f5
8553fee
d8eeb9e
f682eae
202eee4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,7 @@ | |
| <CoreCLRCrossTargetComponentDirName Condition="'$(TargetArchitecture)' == 'arm' and '$(BuildArchitecture)' != 'arm' and '$(TargetsWindows)' == 'true'">x86</CoreCLRCrossTargetComponentDirName> | ||
| <CoreCLRCrossTargetComponentDirName Condition="'$(TargetArchitecture)' == 'arm' and '$(BuildArchitecture)' != 'arm' and '$(TargetsLinux)' == 'true'">x64</CoreCLRCrossTargetComponentDirName> | ||
| <CoreCLRCrossTargetComponentDirName Condition="'$(TargetArchitecture)' == 'armel' and '$(BuildArchitecture)' != 'armel' and '$(TargetsLinux)' == 'true'">x64</CoreCLRCrossTargetComponentDirName> | ||
| <SingleFileHostSourcePath>$(CoreCLRArtifactsPath)/corehost/singlefilehost$(ExeSuffix)</SingleFileHostSourcePath> | ||
| </PropertyGroup> | ||
|
|
||
| <Target Name="ResolveRuntimeFilesFromLocalBuild"> | ||
|
|
@@ -223,4 +224,18 @@ | |
| <PropertyGroup> | ||
| <BundledRuntimeIdentifierGraphFile>$(RuntimeIdGraphDefinitionFile)</BundledRuntimeIdentifierGraphFile> | ||
| </PropertyGroup> | ||
|
|
||
| <Target Name="RewriteRuntimePackDir" | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not thrilled with this approach -- I think we should move to a mechanism to have a "well-known" runtime pack that can be used and preferred over all others. This might require new SDK functionality, I'm not sure. Also, I'll have to update crossgen to build for net7.0 in that case. Not a big deal since we have a public preview out, but it's an interesting problem for net8.0, where we will have a net8.0 runtime pack, but no bootstrap SDK that would contain 8.0.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jkoritzinsky would appreciate your feedback on this in particular
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Honestly, this approach (re-pointing to the live runtime pack for the current RID) looks fine to me. Personally, I'd prefer that we require consuming projects to manually hook this target, especially since it's only used in once place. When we start work on .NET 8, this should still be handleable without much issue as our work to update framework references . Maybe we should refactor this into another |
||
| Condition="'$(RunningPublish)' == 'true'" | ||
| DependsOnTargets="ResolveRuntimeFilesFromLocalBuild" | ||
| BeforeTargets="ResolveRuntimePackAssets"> | ||
| <ItemGroup> | ||
| <!-- Remove AspNetCore runtime pack since we don't build it locally --> | ||
| <ResolvedRuntimePack Remove="Microsoft.AspNetCore.App.Runtime.$(RuntimeIdentifier)" /> | ||
|
|
||
| <ResolvedRuntimePack Update="Microsoft.NETCore.App.Runtime.$(RuntimeIdentifier)"> | ||
| <PackageDirectory>$(MicrosoftNetCoreAppRuntimePackDir)</PackageDirectory> | ||
| </ResolvedRuntimePack> | ||
| </ItemGroup> | ||
| </Target> | ||
| </Project> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,10 +17,10 @@ | |
| <IsNativeAotProject Condition="$(MSBuildProjectDirectory.Contains('nativeaot'))">true</IsNativeAotProject> | ||
| <BaseIntermediateOutputPath Condition="'$(IsNativeAotProject)' != 'true'">$([MSBuild]::NormalizeDirectory('$(ArtifactsObjDir)', 'coreclr', '$(MSBuildProjectName)'))</BaseIntermediateOutputPath> | ||
| <BaseIntermediateOutputPath Condition="'$(IsNativeAotProject)' == 'true'">$([MSBuild]::NormalizeDirectory('$(ArtifactsObjDir)', 'coreclr', 'nativeaot', '$(MSBuildProjectName)'))</BaseIntermediateOutputPath> | ||
| <IntermediateOutputPath Condition="'$(PlatformName)' == 'AnyCPU'">$(BaseIntermediateOutputPath)$(Configuration)\</IntermediateOutputPath> | ||
| <IntermediateOutputPath Condition="'$(PlatformName)' != 'AnyCPU'">$(BaseIntermediateOutputPath)$(PlatformName)\$(Configuration)\</IntermediateOutputPath> | ||
| <IntermediateOutputPath Condition="'$(PlatformName)' == 'AnyCPU'">$(BaseIntermediateOutputPath)$(RuntimeConfiguration)\</IntermediateOutputPath> | ||
|
||
| <IntermediateOutputPath Condition="'$(PlatformName)' != 'AnyCPU'">$(BaseIntermediateOutputPath)$(PlatformName)\$(RuntimeConfiguration)\</IntermediateOutputPath> | ||
| <ProjectDir>$(MSBuildThisFileDirectory)</ProjectDir> | ||
| <RuntimeBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'coreclr', '$(TargetOS).$(TargetArchitecture).$(Configuration)'))</RuntimeBinDir> | ||
| <RuntimeBinDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsBinDir)', 'coreclr', '$(TargetOS).$(TargetArchitecture).$(RuntimeConfiguration)'))</RuntimeBinDir> | ||
|
|
||
| <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> | ||
| <SignAssembly Condition="'$(UsingMicrosoftNETSdk)' != 'true'">false</SignAssembly> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| <!-- Building this project publishes a self-contained copy of crossgen2. --> | ||
| <Project> | ||
| <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" /> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputPath>$(RuntimeBinDir)crossgen2</OutputPath> | ||
| <RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">$(Crossgen2PackageRID)</RuntimeIdentifier> | ||
| <RunningPublish>true</RunningPublish> | ||
| <!-- Trimming is not currently working, but set the appropriate feature flags for NativeAOT --> | ||
| <PublishTrimmed Condition="'$(NativeAotSupported)' == 'true'">true</PublishTrimmed> | ||
| <NativeAotSupported>false</NativeAotSupported> | ||
| </PropertyGroup> | ||
|
|
||
| <Import Project="crossgen2.props" /> | ||
| <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" /> | ||
|
|
||
| <PropertyGroup Condition="'$(NativeAotSupported)' != 'true'"> | ||
| <PublishReadyToRun>true</PublishReadyToRun> | ||
| <!-- Disable crossgen on NetBSD, illumos and Solaris for now. This can be revisited when we have full support. --> | ||
| <PublishReadyToRun Condition="'$(TargetOS)'=='NetBSD' Or '$(TargetOS)'=='illumos' Or '$(TargetOS)'=='Solaris'">false</PublishReadyToRun> | ||
| <!-- Disable crossgen on FreeBSD when cross building from Linux. --> | ||
| <PublishReadyToRun Condition="'$(TargetOS)'=='FreeBSD' and '$(CrossBuild)'=='true'">false</PublishReadyToRun> | ||
| <PublishReadyToRunComposite>true</PublishReadyToRunComposite> | ||
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup Condition="'$(NativeAotSupported)' == 'true'"> | ||
| <IlcToolsPath>$(CoreCLRILCompilerDir)</IlcToolsPath> | ||
| <IlcToolsPath Condition="'$(TargetArchitecture)' != '$(BuildArchitecture)'">$(CoreCLRCrossILCompilerDir)</IlcToolsPath> | ||
| <CppCompilerAndLinker Condition="'$(TargetArchitecture)' != '$(BuildArchitecture)' and '$(HostOS)' != 'windows'">clang-9</CppCompilerAndLinker> | ||
| <SysRoot Condition="'$(TargetArchitecture)' != '$(BuildArchitecture)' and '$(HostOS)' != 'windows'">$(ROOTFS_DIR)</SysRoot> | ||
| <IlcBuildTasksPath>$(CoreCLRILCompilerDir)netstandard/ILCompiler.Build.Tasks.dll</IlcBuildTasksPath> | ||
| <IlcSdkPath>$(CoreCLRAotSdkDir)</IlcSdkPath> | ||
| <IlcFrameworkPath>$(MicrosoftNetCoreAppRuntimePackRidLibTfmDir)</IlcFrameworkPath> | ||
| <TrimmerSingleWarn>false</TrimmerSingleWarn> | ||
|
|
||
| <!-- Forced by ILLink targets; we should fix the SDK --> | ||
| <SelfContained>true</SelfContained> | ||
| </PropertyGroup> | ||
|
|
||
| <Import Project="../../../../installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets" /> | ||
|
|
||
| <Import Project="$(CoreCLRBuildIntegrationDir)Microsoft.DotNet.ILCompiler.targets" Condition="'$(NativeAotSupported)' == 'true'" /> | ||
|
|
||
| </Project> |
Uh oh!
There was an error while loading. Please reload this page.