From d0032081547744dcca4a57541eaf221832e80893 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Fri, 20 Jun 2025 22:01:06 +0000 Subject: [PATCH 1/5] Don't bundle NativeAOT runtime assets in the ILCompiler package --- .../Microsoft.DotNet.ILCompiler.pkgproj | 40 +------------------ .../pkg/projects/nativeaot-packages.proj | 2 +- 2 files changed, 3 insertions(+), 39 deletions(-) diff --git a/src/installer/pkg/projects/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.pkgproj b/src/installer/pkg/projects/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.pkgproj index bb6d4154b85be1..bf1c08d49f25db 100644 --- a/src/installer/pkg/projects/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.pkgproj +++ b/src/installer/pkg/projects/Microsoft.DotNet.ILCompiler/Microsoft.DotNet.ILCompiler.pkgproj @@ -29,48 +29,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + Condition="'$(PackageTargetRuntime)' != ''"> - - - - - - + @@ -93,5 +58,4 @@ - diff --git a/src/installer/pkg/projects/nativeaot-packages.proj b/src/installer/pkg/projects/nativeaot-packages.proj index 3f69b1ac3118e5..37d894266f25d0 100644 --- a/src/installer/pkg/projects/nativeaot-packages.proj +++ b/src/installer/pkg/projects/nativeaot-packages.proj @@ -5,7 +5,7 @@ - + From df6a1ba1b53532e5b75d7a85b3ee8b307900e030 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Fri, 20 Jun 2025 22:08:39 +0000 Subject: [PATCH 2/5] Remove support for the old package layout from the targets. --- ...soft.DotNet.ILCompiler.SingleEntry.targets | 2 -- .../Microsoft.NETCore.Native.Publish.targets | 4 ++-- .../Microsoft.NETCore.Native.targets | 19 ++----------------- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets index 059d1754c68263..cadae31447333f 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets @@ -68,8 +68,6 @@ @(ResolvedILCompilerPack->'%(PackageDirectory)') @(ResolvedILCompilerPack->'%(PackageDirectory)') @(ResolvedTargetILCompilerPack->'%(PackageDirectory)') - true - $(PublishAotUsingRuntimePack) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets index 656e525ca32eb7..9cda37b474155b 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets @@ -68,8 +68,8 @@ Text="Add a PackageReference for '$(_hostPackageName)' to allow cross-compilation for $(_targetArchitecture)" /> - - + + - + $(IlcHostPackagePath)\tools\ $(RuntimePackagePath)\mibc\ - + @@ -164,15 +158,6 @@ The .NET Foundation licenses this file to you under the MIT license. - - - - - - - - - From 921b5aa6c7342302cc483d2b13a5150049dd9735 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Fri, 20 Jun 2025 16:59:06 -0700 Subject: [PATCH 3/5] Update docs to enable downloading the runtime pack manually during restore (as otherwise the right version number isn't available until after restore). --- docs/workflow/building/coreclr/nativeaot.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/workflow/building/coreclr/nativeaot.md b/docs/workflow/building/coreclr/nativeaot.md index 11d06b89920144..d74dc5d205c719 100644 --- a/docs/workflow/building/coreclr/nativeaot.md +++ b/docs/workflow/building/coreclr/nativeaot.md @@ -34,6 +34,14 @@ Run `build[.cmd|.sh] -c Release` from the repo root to build the NativeAOT toolc * Add the package directory to your `nuget.config` file. For example, add `` * Run `dotnet add package Microsoft.DotNet.ILCompiler -v 10.0.0-dev` to add the local package reference to your project. +* Add the following snippet to your project file, replacing `win-x64` with the target runtime identifier: + +``` + + + +``` + * Run `dotnet publish --packages pkg -r [win-x64|linux-x64|osx-64] -c [Debug|Release]` to publish your project. `--packages pkg` option restores the package into a local directory that is easy to cleanup once you are done. It avoids polluting the global nuget cache with your locally built dev package. ## High Level Overview From 343a90b5c44c367cdda0363ffdb2eda8c5d1fc70 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Tue, 1 Jul 2025 14:12:15 -0700 Subject: [PATCH 4/5] Remove unneeded changes --- docs/workflow/building/coreclr/nativeaot.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/docs/workflow/building/coreclr/nativeaot.md b/docs/workflow/building/coreclr/nativeaot.md index d74dc5d205c719..11d06b89920144 100644 --- a/docs/workflow/building/coreclr/nativeaot.md +++ b/docs/workflow/building/coreclr/nativeaot.md @@ -34,14 +34,6 @@ Run `build[.cmd|.sh] -c Release` from the repo root to build the NativeAOT toolc * Add the package directory to your `nuget.config` file. For example, add `` * Run `dotnet add package Microsoft.DotNet.ILCompiler -v 10.0.0-dev` to add the local package reference to your project. -* Add the following snippet to your project file, replacing `win-x64` with the target runtime identifier: - -``` - - - -``` - * Run `dotnet publish --packages pkg -r [win-x64|linux-x64|osx-64] -c [Debug|Release]` to publish your project. `--packages pkg` option restores the package into a local directory that is easy to cleanup once you are done. It avoids polluting the global nuget cache with your locally built dev package. ## High Level Overview From 1b03f3625b323f9e08de1fae1e07a75bcff7d8ba Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Wed, 16 Jul 2025 13:52:06 -0700 Subject: [PATCH 5/5] Don't pull CoreLib from the native path. Let it get pulled from the AOT SDK path. These are the same in the standard case, but when doing local testing, the AOT SDK path has the right CoreLib, but the Framework Native path has the wrong one. --- .../nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets | 1 - 1 file changed, 1 deletion(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets index e9015b2d6c38a5..a766c69251cbc0 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets @@ -155,7 +155,6 @@ The .NET Foundation licenses this file to you under the MIT license. -