Skip to content

Commit ec9a3f1

Browse files
committed
source-build: bundle NativeAOT libraries with the SDK.
This includes the libraries that are needed for source-built NativeAOT with the source-built SDK: - runtime.<rid>.Microsoft.DotNet.ILCompiler extracted under 'packs'. - Microsoft.DotNet.ILCompiler and Microsoft.NET.ILLink.Tasks as NuGet packages under 'library-packs'.
1 parent dad1976 commit ec9a3f1

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

src/Installer/redist-installer/targets/GenerateLayout.targets

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,17 @@
202202
<RelativeLayoutPath>packs/%(PackageName)/%(PackageVersion)</RelativeLayoutPath>
203203
</BundledLayoutPackage>
204204

205+
<BundledLayoutPackage Include="MicrosoftDotNetILCompilerPackNupkg" Condition="'$(BundleNativeAotCompiler)' == 'true'">
206+
<PackageName>runtime.$(SharedFrameworkRid).Microsoft.DotNet.ILCompiler</PackageName>
207+
<PackageVersion>$(MicrosoftNETCoreAppRuntimePackageVersion)</PackageVersion>
208+
<TargetFramework>$(TargetFramework)</TargetFramework>
209+
<RelativeLayoutPath>packs/%(PackageName)/%(PackageVersion)</RelativeLayoutPath>
210+
</BundledLayoutPackage>
211+
212+
<BundledLayoutLibraryPackage Include="$(SourceBuiltShippingPackagesDir)/../runtime/Microsoft.DotNet.ILCompiler.$(MicrosoftNETCoreAppRuntimePackageVersion).nupkg" Condition="'$(BundleNativeAotCompiler)' == 'true'" />
213+
214+
<BundledLayoutLibraryPackage Include="$(SourceBuiltShippingPackagesDir)/../runtime/Microsoft.NET.ILLink.Tasks.$(MicrosoftNETILLinkTasksPackageVersion).nupkg" Condition="'$(BundleNativeAotCompiler)' == 'true'" />
215+
205216
<BundledInstallerComponent Include="DownloadedRuntimeDepsInstallerFile"
206217
Condition="('$(IsDebianBaseDistro)' == 'true' OR '$(IsRPMBasedDistro)' == 'true') And '$(SkipBuildingInstallers)' != 'true' And '$(InstallerExtension)' != '' And !$(Architecture.StartsWith('arm'))">
207218
<BaseUrl>$(NetRuntimeRootUrl)</BaseUrl>
@@ -460,6 +471,11 @@
460471
SkipUnchangedFiles="true"
461472
/>
462473

474+
<Copy SourceFiles="@(BundledLayoutLibraryPackage)"
475+
DestinationFolder="$(RedistLayoutPath)/library-packs"
476+
SkipUnchangedFiles="true"
477+
/>
478+
463479
<!-- From Version.targets in SDK redist -->
464480
<PropertyGroup>
465481
<ArtifactNameSdk>dotnet-toolset-internal</ArtifactNameSdk>

src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -788,17 +788,22 @@ private ToolPackSupport AddToolPack(
788788

789789
var runtimePackName = packNamePattern.Replace("**RID**", hostRuntimeIdentifier);
790790

791-
if (EnableRuntimePackDownload)
791+
var runtimePackItem = new TaskItem(runtimePackName);
792+
runtimePackItem.SetMetadata(MetadataKeys.NuGetPackageId, runtimePackName);
793+
runtimePackItem.SetMetadata(MetadataKeys.NuGetPackageVersion, packVersion);
794+
795+
string runtimePackPath = GetPackPath(runtimePackName, packVersion);
796+
if (runtimePackPath != null)
797+
{
798+
runtimePackItem.SetMetadata(MetadataKeys.PackageDirectory, runtimePackPath);
799+
}
800+
else if (EnableRuntimePackDownload)
792801
{
793802
// We need to download the runtime pack
794803
runtimePackToDownload = new TaskItem(runtimePackName);
795804
runtimePackToDownload.SetMetadata(MetadataKeys.Version, packVersion);
796805
}
797806

798-
var runtimePackItem = new TaskItem(runtimePackName);
799-
runtimePackItem.SetMetadata(MetadataKeys.NuGetPackageId, runtimePackName);
800-
runtimePackItem.SetMetadata(MetadataKeys.NuGetPackageVersion, packVersion);
801-
802807
switch (toolPackType)
803808
{
804809
case ToolPackType.Crossgen2:

0 commit comments

Comments
 (0)