Skip to content

Commit aadccee

Browse files
Don't bundle NativeAOT runtime assets in the ILCompiler package (#116882)
Co-authored-by: Alexander Köplinger <[email protected]>
1 parent d4914da commit aadccee

File tree

5 files changed

+7
-61
lines changed

5 files changed

+7
-61
lines changed

src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@
6868
<IlcHostPackagePath Condition="'@(ResolvedILCompilerPack)' == '$(_hostPackageName)'">@(ResolvedILCompilerPack->'%(PackageDirectory)')</IlcHostPackagePath>
6969
<RuntimePackagePath Condition="'@(ResolvedTargetILCompilerPack)' == ''">@(ResolvedILCompilerPack->'%(PackageDirectory)')</RuntimePackagePath>
7070
<RuntimePackagePath Condition="'@(ResolvedTargetILCompilerPack)' != ''">@(ResolvedTargetILCompilerPack->'%(PackageDirectory)')</RuntimePackagePath>
71-
<IlcUseNativeAOTRuntimePackLayout Condition="'@(ResolvedTargetILCompilerPack)' == '$(_targetRuntimePackName)'">true</IlcUseNativeAOTRuntimePackLayout>
72-
<IlcUseNativeAOTRuntimePackLayout Condition="'$(IlcUseNativeAOTRuntimePackLayout)' == ''">$(PublishAotUsingRuntimePack)</IlcUseNativeAOTRuntimePackLayout>
7371
</PropertyGroup>
7472

7573
</Target>

src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
Text="Add a PackageReference for '$(_hostPackageName)' to allow cross-compilation for $(_targetArchitecture)" />
6969

7070
<!-- NativeAOT runtime pack assemblies need to be defined to avoid the default CoreCLR implementations being set as compiler inputs -->
71-
<Error Condition="'@(PrivateSdkAssemblies)' == '' and '$(IlcUseNativeAOTRuntimePackLayout)' != 'true'" Text="The PrivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" />
72-
<Error Condition="'@(FrameworkAssemblies)' == '' and '$(IlcUseNativeAOTRuntimePackLayout)' != 'true'" Text="The FrameworkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" />
71+
<Error Condition="'@(PrivateSdkAssemblies)' == ''" Text="The PrivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" />
72+
<Error Condition="'@(FrameworkAssemblies)' == ''" Text="The FrameworkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative" />
7373

7474
<ComputeManagedAssembliesToCompileToNative
7575
Assemblies="@(_ResolvedCopyLocalPublishAssets)"

src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ The .NET Foundation licenses this file to you under the MIT license.
132132
<_NETCoreAppFrameworkReference Include="@(ResolvedFrameworkReference)" Condition="'%(ResolvedFrameworkReference.RuntimePackName)' == 'Microsoft.NETCore.App.Runtime.NativeAOT.$(RuntimeIdentifier)'" />
133133
</ItemGroup>
134134

135-
<PropertyGroup Condition="'$(IlcUseNativeAOTRuntimePackLayout)' == 'true'">
135+
<PropertyGroup>
136136
<!--
137137
If we're actually using the runtime pack from the ResolvedFrameworkReference, pull the path from there.
138138
Otherwise pull it from the RuntimePackagePath.
@@ -144,37 +144,21 @@ The .NET Foundation licenses this file to you under the MIT license.
144144
<IlcSdkPath Condition="'$(IlcSdkPath)' == ''">$(IlcFrameworkNativePath)</IlcSdkPath>
145145
</PropertyGroup>
146146

147-
<PropertyGroup Condition="'$(IlcUseNativeAOTRuntimePackLayout)' != 'true'">
148-
<IlcFrameworkPath Condition="'$(IlcFrameworkPath)' == ''">$(RuntimePackagePath)\framework\</IlcFrameworkPath>
149-
<IlcFrameworkNativePath Condition="'$(IlcFrameworkNativePath)' == ''">$(RuntimePackagePath)\framework\</IlcFrameworkNativePath>
150-
<IlcSdkPath Condition="'$(IlcSdkPath)' == ''">$(RuntimePackagePath)\sdk\</IlcSdkPath>
151-
</PropertyGroup>
152-
153147
<PropertyGroup>
154148
<!-- Define paths used in build targets to point to the runtime-specific ILCompiler implementation -->
155149
<IlcToolsPath Condition="'$(IlcToolsPath)' == ''">$(IlcHostPackagePath)\tools\</IlcToolsPath>
156150
<IlcMibcPath Condition="'$(IlcMibcPath)' == ''">$(RuntimePackagePath)\mibc\</IlcMibcPath>
157151
</PropertyGroup>
158152

159-
<ItemGroup Condition="'$(IlcUseNativeAOTRuntimePackLayout)' == 'true'">
153+
<ItemGroup>
160154
<PrivateSdkAssemblies Include="$(IlcSdkPath)*.dll"/>
161155
<FrameworkAssemblies Include="@(RuntimePackAsset)" Condition="'$(PublishAotUsingRuntimePack)' == 'true' and '%(Extension)' == '.dll'" />
162156
<!-- When we aren't pulling in runtime pack assets, make sure we manually grab the assets that the SDK would select from within the package. -->
163157
<FrameworkAssemblies Include="$(IlcFrameworkPath)**/*.dll" Condition="'$(PublishAotUsingRuntimePack)' != 'true'" />
164-
<FrameworkAssemblies Include="$(IlcFrameworkNativePath)*.dll" Exclude="$(IlcFrameworkNativePath)*.Native.dll;$(IlcFrameworkNativePath)msquic.dll" Condition="'$(PublishAotUsingRuntimePack)' != 'true'" />
165158
<DefaultFrameworkAssemblies Include="@(FrameworkAssemblies)" />
166159
<DefaultFrameworkAssemblies Include="@(PrivateSdkAssemblies)" Exclude="@(DefaultFrameworkAssemblies)" />
167160
</ItemGroup>
168161

169-
<ItemGroup Condition="'$(IlcUseNativeAOTRuntimePackLayout)' != 'true'">
170-
<PrivateSdkAssemblies Include="$(IlcSdkPath)*.dll"/>
171-
<!-- Exclude unmanaged dlls -->
172-
<FrameworkAssemblies Include="$(IlcFrameworkPath)*.dll" Exclude="$(IlcFrameworkPath)*.Native.dll;$(IlcFrameworkPath)msquic.dll" />
173-
174-
<DefaultFrameworkAssemblies Include="@(PrivateSdkAssemblies)" />
175-
<DefaultFrameworkAssemblies Include="@(FrameworkAssemblies)" />
176-
</ItemGroup>
177-
178162
<ItemGroup>
179163
<MibcFile Include="$(IlcMibcPath)*.mibc" Condition="'$(IlcPgoOptimize)' == 'true'" />
180164
</ItemGroup>

src/installer/pkg/projects/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.pkgproj

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -29,48 +29,13 @@
2929
</ItemGroup>
3030
</Target>
3131

32-
<Target Name="GetHostIlcCompilerFiles"
33-
DependsOnTargets="ResolveLibrariesFromLocalBuild"
34-
BeforeTargets="GetPackageFiles"
35-
Condition="'$(PackHostILCompiler)' == 'true' and '$(PackageTargetRuntime)' != ''">
36-
37-
<ItemGroup>
38-
<File Include="$(CoreCLRCrossILCompilerDir)*" TargetPath="tools" />
39-
</ItemGroup>
40-
41-
<ItemGroup Condition="'$(TargetOS)' == 'linux'">
42-
<File Include="$(SharedNativeRoot)libs\System.Globalization.Native\*" TargetPath="native/src/libs/System.Globalization.Native"/>
43-
<File Include="$(SharedNativeRoot)libs\System.Security.Cryptography.Native\*" TargetPath="native/src/libs/System.Security.Cryptography.Native"/>
44-
<File Include="$(SharedNativeRoot)libs\build-local.sh" TargetPath="native/src/libs/build-local.sh"/>
45-
<File Include="$(SharedNativeRoot)minipal\*" TargetPath="native/src/minipal"/>
46-
<File Include="$(SharedNativeRoot)libs\Common\*" TargetPath="native/src/libs/Common"/>
47-
</ItemGroup>
48-
49-
<!-- exclude native symbols from ilc package (they are included in symbols package) -->
50-
<ItemGroup>
51-
<!-- on windows, remove the pdbs only from tools directory (both managed and native) -->
52-
<LibPackageExcludes Include="tools\%2A%2A\%2A.pdb"/>
53-
54-
<LibPackageExcludes Include="%2A%2A\%2A.dbg"/>
55-
<LibPackageExcludes Include="%2A%2A\%2A.debug"/>
56-
<LibPackageExcludes Include="%2A%2A\%2A.dSYM"/>
57-
<LibPackageExcludes Include="%2A%2A\%2A.dwarf"/>
58-
</ItemGroup>
59-
60-
</Target>
61-
6232
<Target Name="GetIlcCompilerFiles"
6333
DependsOnTargets="ResolveLibrariesFromLocalBuild"
6434
BeforeTargets="GetPackageFiles"
65-
Condition="'$(PackHostILCompiler)' != 'true' and '$(PackageTargetRuntime)' != ''">
35+
Condition="'$(PackageTargetRuntime)' != ''">
6636

6737
<ItemGroup>
68-
<!-- Include all libraries (managed, static, etc.), but exclude native shared libraries (those with LibSuffix) -->
69-
<File Include="@(LibrariesRuntimeFiles)" TargetPath="framework" Condition="'%(LibrariesRuntimeFiles.IsNative)' != 'true' or '%(LibrariesRuntimeFiles.Extension)' != '$(LibSuffix)'" />
70-
71-
<File Include="$(CoreCLRILCompilerDir)*" TargetPath="tools" />
72-
<File Include="$(CoreCLRAotSdkDir)*" TargetPath="sdk" />
73-
<File Include="$(MibcOptimizationDataDir)/$(TargetOS)/$(TargetArchitecture)/**/*.mibc" TargetPath="mibc" />
38+
<File Include="$(CoreCLRCrossILCompilerDir)*" TargetPath="tools" />
7439
</ItemGroup>
7540

7641
<ItemGroup Condition="'$(TargetOS)' == 'linux'">
@@ -93,5 +58,4 @@
9358
</ItemGroup>
9459

9560
</Target>
96-
9761
</Project>

src/installer/pkg/projects/nativeaot-packages.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<Project Include="Microsoft.DotNet.ILCompiler\Microsoft.DotNet.ILCompiler.pkgproj" />
66
<ProjectReference Include="@(Project)" />
77
<ProjectReference Include="@(Project)" AdditionalProperties="PackageTargetRuntime=$(TargetRid)" />
8-
<ProjectReference Condition="'$(BuildHostTools)' == 'true'" Include="@(Project)" AdditionalProperties="PackageTargetRuntime=$(NETCoreSdkRuntimeIdentifier);PackHostILCompiler=true" />
8+
<ProjectReference Condition="'$(BuildHostTools)' == 'true'" Include="@(Project)" AdditionalProperties="PackageTargetRuntime=$(NETCoreSdkRuntimeIdentifier)" />
99
</ItemGroup>
1010

1111
<Import Sdk="Microsoft.Build.Traversal" Project="Sdk.targets" />

0 commit comments

Comments
 (0)