Skip to content

Commit e912b02

Browse files
Tighten up host package sizes
Only pack ILC (without its 60MB PDB) into host packages. Only pack the target libraries into target packages. Reduces the size of the host package from ~64MB to ~13MB.
1 parent 8395429 commit e912b02

File tree

1 file changed

+26
-34
lines changed

1 file changed

+26
-34
lines changed

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

Lines changed: 26 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,56 +2,48 @@
22

33
<PropertyGroup>
44
<GeneratePackage>true</GeneratePackage>
5-
<IncludeSymbolsInPackage>true</IncludeSymbolsInPackage>
65
<PackageDescription>Provides a native AOT compiler and runtime for .NET</PackageDescription>
7-
</PropertyGroup>
86

9-
<PropertyGroup>
10-
<!-- For now, send symbols package into a dummy directory to avoid conflicts with dotnet/runtime and
11-
to avoid issues with objwriter not having the rigth ELF version resource -->
12-
<SymbolPackageOutputPath>$([MSBuild]::NormalizeDirectory('$(ArtifactsPackagesDir)', 'Ignored'))</SymbolPackageOutputPath>
7+
<BuildingIlcHostPackage Condition="'$(TargetsWasm)' != 'true'">true</BuildingIlcHostPackage>
138
</PropertyGroup>
149

1510
<Target Name="GetIlcCompilerFiles"
1611
DependsOnTargets="ResolveLibrariesFromLocalBuild"
1712
BeforeTargets="GetPackageFiles">
1813

19-
<ItemGroup Condition="'$(PackageTargetRuntime)' != ''">
20-
<File Include="@(LibrariesRuntimeFiles)">
21-
<TargetPath>framework/%(LibrariesRuntimeFiles.NativeSubDirectory)</TargetPath>
22-
</File>
23-
<File Include="$(CoreCLRILCompilerDir)*">
24-
<TargetPath>tools</TargetPath>
25-
</File>
26-
<File Include="$(CoreCLRAotSdkDir)*">
27-
<TargetPath>sdk</TargetPath>
28-
</File>
14+
<ItemGroup Condition="'$(PackageTargetRuntime)' == ''">
15+
<File Include="$(CoreCLRBuildIntegrationDir)*" TargetPath="build" />
16+
<File Include="$(CoreCLRILCompilerDir)netstandard\*" TargetPath="tools/netstandard" />
17+
18+
<!-- TODO-LLVM-Upstream: https://github.com/dotnet/runtimelab/issues/2576 -->
19+
<File Include="$(ArtifactsBinDir)Microsoft.Interop.SourceGeneration\$(Configuration)\netstandard2.0\*" TargetPath="analyzers/dotnet/cs" />
20+
<File Include="$(ArtifactsBinDir)JSImportGenerator\$(Configuration)\netstandard2.0\*" TargetPath="analyzers/dotnet/cs" />
21+
</ItemGroup>
22+
23+
<ItemGroup Condition="'$(PackageTargetRuntime)' != '' and '$(BuildingIlcHostPackage)' == 'true'">
24+
<File Include="$(CoreCLRILCompilerDir)*" TargetPath="tools" />
25+
</ItemGroup>
26+
27+
<ItemGroup Condition="'$(PackageTargetRuntime)' != '' and '$(BuildingIlcHostPackage)' != 'true'">
28+
<File Include="@(LibrariesRuntimeFiles)" TargetPath="framework/%(LibrariesRuntimeFiles.NativeSubDirectory)" />
29+
<File Include="$(CoreCLRAotSdkDir)*" TargetPath="sdk" />
30+
<File Include="$(MibcOptimizationDataDir)/$(TargetOS)/$(TargetArchitecture)/**/*.mibc" TargetPath="mibc" />
31+
2932
<DotnetJsCoreCLRAotSdkExtension Include="ts;js;map;json" />
3033
<File Include="$(CoreCLRAotSdkDir)dotnetjs/*.%(DotnetJsCoreCLRAotSdkExtension.Identity)" TargetPath="sdk/dotnetjs" />
3134
<File Include="$(CoreCLRAotSdkDir)dotnetjs/src/*.%(DotnetJsCoreCLRAotSdkExtension.Identity)" TargetPath="sdk/dotnetjs/src" />
3235
<File Include="$(CoreCLRAotSdkDir)dotnetjs/src/es6/*.%(DotnetJsCoreCLRAotSdkExtension.Identity)" TargetPath="sdk/dotnetjs/src/es6" />
33-
<File Include="$(MibcOptimizationDataDir)/$(TargetOS)/$(TargetArchitecture)/**/*.mibc">
34-
<TargetPath>mibc</TargetPath>
35-
</File>
3636
</ItemGroup>
3737

38+
<!-- exclude native symbols from ilc package (they are included in symbols package) -->
3839
<ItemGroup>
39-
<File Include="$(CoreCLRBuildIntegrationDir)*">
40-
<TargetPath>build</TargetPath>
41-
</File>
42-
<File Include="$(CoreCLRILCompilerDir)netstandard\*">
43-
<TargetPath>tools/netstandard</TargetPath>
44-
</File>
45-
</ItemGroup>
40+
<!-- on windows, remove the pdbs only from tools directory (both managed and native) -->
41+
<LibPackageExcludes Include="tools\%2A%2A\%2A.pdb"/>
4642

47-
<!-- TODO-LLVM-Upstream: https://github.com/dotnet/runtimelab/issues/2576 -->
48-
<ItemGroup Condition="'$(PackageTargetRuntime)' == ''">
49-
<File Include="$(ArtifactsBinDir)Microsoft.Interop.SourceGeneration\$(Configuration)\netstandard2.0\*">
50-
<TargetPath>analyzers/dotnet/cs</TargetPath>
51-
</File>
52-
<File Include="$(ArtifactsBinDir)JSImportGenerator\$(Configuration)\netstandard2.0\*">
53-
<TargetPath>analyzers/dotnet/cs</TargetPath>
54-
</File>
43+
<LibPackageExcludes Include="%2A%2A\%2A.dbg"/>
44+
<LibPackageExcludes Include="%2A%2A\%2A.debug"/>
45+
<LibPackageExcludes Include="%2A%2A\%2A.dSYM"/>
46+
<LibPackageExcludes Include="%2A%2A\%2A.dwarf"/>
5547
</ItemGroup>
5648
</Target>
5749

0 commit comments

Comments
 (0)