From ec9a3f1e871eee69c1291cfa0d10154bb4aedebf Mon Sep 17 00:00:00 2001 From: Tom Deseyn Date: Tue, 28 May 2024 10:44:02 +0200 Subject: [PATCH] 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..Microsoft.DotNet.ILCompiler extracted under 'packs'. - Microsoft.DotNet.ILCompiler and Microsoft.NET.ILLink.Tasks as NuGet packages under 'library-packs'. --- .../targets/GenerateLayout.targets | 16 ++++++++++++++++ .../ProcessFrameworkReferences.cs | 15 ++++++++++----- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/Installer/redist-installer/targets/GenerateLayout.targets b/src/Installer/redist-installer/targets/GenerateLayout.targets index 7db3fa0ace2c..2aca602dd42d 100644 --- a/src/Installer/redist-installer/targets/GenerateLayout.targets +++ b/src/Installer/redist-installer/targets/GenerateLayout.targets @@ -202,6 +202,17 @@ packs/%(PackageName)/%(PackageVersion) + + runtime.$(SharedFrameworkRid).Microsoft.DotNet.ILCompiler + $(MicrosoftNETCoreAppRuntimePackageVersion) + $(TargetFramework) + packs/%(PackageName)/%(PackageVersion) + + + + + + $(NetRuntimeRootUrl) @@ -460,6 +471,11 @@ SkipUnchangedFiles="true" /> + + dotnet-toolset-internal diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs index b491a450b531..81278881ebd2 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ProcessFrameworkReferences.cs @@ -788,17 +788,22 @@ private ToolPackSupport AddToolPack( var runtimePackName = packNamePattern.Replace("**RID**", hostRuntimeIdentifier); - if (EnableRuntimePackDownload) + var runtimePackItem = new TaskItem(runtimePackName); + runtimePackItem.SetMetadata(MetadataKeys.NuGetPackageId, runtimePackName); + runtimePackItem.SetMetadata(MetadataKeys.NuGetPackageVersion, packVersion); + + string runtimePackPath = GetPackPath(runtimePackName, packVersion); + if (runtimePackPath != null) + { + runtimePackItem.SetMetadata(MetadataKeys.PackageDirectory, runtimePackPath); + } + else if (EnableRuntimePackDownload) { // We need to download the runtime pack runtimePackToDownload = new TaskItem(runtimePackName); runtimePackToDownload.SetMetadata(MetadataKeys.Version, packVersion); } - var runtimePackItem = new TaskItem(runtimePackName); - runtimePackItem.SetMetadata(MetadataKeys.NuGetPackageId, runtimePackName); - runtimePackItem.SetMetadata(MetadataKeys.NuGetPackageVersion, packVersion); - switch (toolPackType) { case ToolPackType.Crossgen2: