From ef826ada85f416d42e21517052f94ae1c3e8f44d Mon Sep 17 00:00:00 2001 From: Nigusu Yenework Date: Sat, 18 Apr 2026 17:14:55 -0700 Subject: [PATCH 1/4] Add AOT publisj test job --- eng/pipelines/pr.yml | 17 +++++++ .../NuGet.AotCompatibility.Test.csproj | 44 +++++++++++++++++++ test/NuGet.AotCompatibility.Test/Program.cs | 8 ++++ 3 files changed, 69 insertions(+) create mode 100644 test/NuGet.AotCompatibility.Test/NuGet.AotCompatibility.Test.csproj create mode 100644 test/NuGet.AotCompatibility.Test/Program.cs diff --git a/eng/pipelines/pr.yml b/eng/pipelines/pr.yml index a770527c6a1..046d9f55e8a 100644 --- a/eng/pipelines/pr.yml +++ b/eng/pipelines/pr.yml @@ -284,3 +284,20 @@ stages: displayName: Log Environment Variables - script: dotnet format whitespace --verify-no-changes NuGet.sln displayName: Run dotnet format whitespace + +- stage: + displayName: AOT Compatibility + dependsOn: [] + jobs: + - job: + displayName: AOT Publish Smoke Test (win-x64) + timeoutInMinutes: 20 + pool: + vmImage: windows-latest + steps: + - task: PowerShell@2 + displayName: Run configure.ps1 + inputs: + filePath: configure.ps1 + - script: dotnet publish test/NuGet.AotCompatibility.Test/NuGet.AotCompatibility.Test.csproj -r win-x64 -c Release + displayName: AOT publish NuGet libraries diff --git a/test/NuGet.AotCompatibility.Test/NuGet.AotCompatibility.Test.csproj b/test/NuGet.AotCompatibility.Test/NuGet.AotCompatibility.Test.csproj new file mode 100644 index 00000000000..ae255a1ec93 --- /dev/null +++ b/test/NuGet.AotCompatibility.Test/NuGet.AotCompatibility.Test.csproj @@ -0,0 +1,44 @@ + + + Exe + $(LatestNETCoreTargetFramework) + true + true + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/NuGet.AotCompatibility.Test/Program.cs b/test/NuGet.AotCompatibility.Test/Program.cs new file mode 100644 index 00000000000..27fdc5cecc6 --- /dev/null +++ b/test/NuGet.AotCompatibility.Test/Program.cs @@ -0,0 +1,8 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +// AOT compatibility smoke test entry point. +// All NuGet assemblies with IsAotCompatible=true are referenced via ProjectReference +// and rooted via TrimmerRootAssembly so the ILC compiler analyzes their full public +// surface. A successful publish with IlcTreatWarningsAsErrors=true confirms AOT +// compatibility. No application logic is needed here. From ba0ac10c37c44090dee4ba93de954134b12fcf46 Mon Sep 17 00:00:00 2001 From: Nigusu Yenework Date: Sat, 18 Apr 2026 17:28:41 -0700 Subject: [PATCH 2/4] Map IlCompiler --- NuGet.Config | 1 + 1 file changed, 1 insertion(+) diff --git a/NuGet.Config b/NuGet.Config index 00d231892f6..67d95731311 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -17,6 +17,7 @@ + From 7b72586fc51dafd870faa27488b7c192771482e2 Mon Sep 17 00:00:00 2001 From: Nigusu Yenework Date: Sat, 18 Apr 2026 22:03:31 -0700 Subject: [PATCH 3/4] cleanup --- .../NuGet.AotCompatibility.Test.csproj | 1 - test/NuGet.AotCompatibility.Test/Program.cs | 8 -------- 2 files changed, 9 deletions(-) delete mode 100644 test/NuGet.AotCompatibility.Test/Program.cs diff --git a/test/NuGet.AotCompatibility.Test/NuGet.AotCompatibility.Test.csproj b/test/NuGet.AotCompatibility.Test/NuGet.AotCompatibility.Test.csproj index ae255a1ec93..da1359b6c8a 100644 --- a/test/NuGet.AotCompatibility.Test/NuGet.AotCompatibility.Test.csproj +++ b/test/NuGet.AotCompatibility.Test/NuGet.AotCompatibility.Test.csproj @@ -1,6 +1,5 @@ - Exe $(LatestNETCoreTargetFramework) true true diff --git a/test/NuGet.AotCompatibility.Test/Program.cs b/test/NuGet.AotCompatibility.Test/Program.cs deleted file mode 100644 index 27fdc5cecc6..00000000000 --- a/test/NuGet.AotCompatibility.Test/Program.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -// AOT compatibility smoke test entry point. -// All NuGet assemblies with IsAotCompatible=true are referenced via ProjectReference -// and rooted via TrimmerRootAssembly so the ILC compiler analyzes their full public -// surface. A successful publish with IlcTreatWarningsAsErrors=true confirms AOT -// compatibility. No application logic is needed here. From 5c8b5b7858a9b4c376ac28f77aedad2266a6f876 Mon Sep 17 00:00:00 2001 From: Nigusu Yenework Date: Mon, 20 Apr 2026 09:42:47 -0700 Subject: [PATCH 4/4] cleanup --- .../NuGet.AotCompatibility.Test.csproj | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/NuGet.AotCompatibility.Test/NuGet.AotCompatibility.Test.csproj b/test/NuGet.AotCompatibility.Test/NuGet.AotCompatibility.Test.csproj index da1359b6c8a..0ea50273b41 100644 --- a/test/NuGet.AotCompatibility.Test/NuGet.AotCompatibility.Test.csproj +++ b/test/NuGet.AotCompatibility.Test/NuGet.AotCompatibility.Test.csproj @@ -22,10 +22,7 @@ - +