Skip to content

Commit f292130

Browse files
lewinggithub-actions
authored andcommitted
Revert "Clean up AOT publish process (#73416)"
This reverts commit 06339dc.
1 parent 080f708 commit f292130

File tree

6 files changed

+27
-23
lines changed

6 files changed

+27
-23
lines changed

eng/testing/tests.singlefile.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070

7171
</PropertyGroup>
7272

73-
<Import Project="$(CoreCLRBuildIntegrationDir)Microsoft.DotNet.ILCompiler.SingleEntry.targets" Condition="'$(TestNativeAot)' == 'true'" />
73+
<Import Project="$(CoreCLRBuildIntegrationDir)Microsoft.DotNet.ILCompiler.targets" Condition="'$(TestNativeAot)' == 'true'" />
7474

7575
<ItemGroup Condition="'$(TestNativeAot)' == 'true'">
7676
<RdXmlFile Include="$(MSBuildThisFileDirectory)default.rd.xml" />

src/coreclr/nativeaot/BuildIntegration/BuildFrameworkNativeObjects.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<DebugSymbols Condition="'$(DebugSymbols)' == ''">true</DebugSymbols>
1111
</PropertyGroup>
1212

13-
<Import Project="$(MSBuildThisFileDirectory)\Microsoft.DotNet.ILCompiler.SingleEntry.targets" Condition="'$(IlcCalledViaPackage)' == 'true'" />
13+
<Import Project="$(MSBuildThisFileDirectory)\Microsoft.DotNet.ILCompiler.targets" Condition="'$(IlcCalledViaPackage)' == 'true'" />
1414
<Import Project="Microsoft.NETCore.Native.targets" Condition="'$(IlcCalledViaPackage)' == ''" />
1515

1616
<Target Name="BuildAllFrameworkLibraries"

src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.props

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ Copyright (c) .NET Foundation. All rights reserved.
1010
***********************************************************************************************
1111
-->
1212
<Project>
13+
1314
<PropertyGroup>
14-
<!-- Set the publishAot property to true if not set-->
15-
<PublishAot Condition="'$(PublishAot)' == ''">true</PublishAot>
1615
<!-- N.B. The ILCompilerTargetsPath is used as a sentinel to indicate a version of this file has already been imported. It will also be the path
1716
used to import the targets later in the SDK. -->
18-
<ILCompilerTargetsPath>$(MSBuildThisFileDirectory)Microsoft.DotNet.ILCompiler.SingleEntry.targets</ILCompilerTargetsPath>
17+
<ILCompilerTargetsPath>$(MSBuildThisFileDirectory)Microsoft.DotNet.ILCompiler.targets</ILCompilerTargetsPath>
1918
</PropertyGroup>
2019
</Project>

src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets renamed to src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.targets

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22

33
<PropertyGroup Condition="'$(RuntimeIdentifier)' != ''">
4+
45
<!-- Define the name of the runtime specific compiler package to import -->
56
<OSIdentifier Condition="$(RuntimeIdentifier.StartsWith('win'))">win</OSIdentifier>
67
<OSIdentifier Condition="$(RuntimeIdentifier.StartsWith('osx'))">osx</OSIdentifier>
@@ -25,34 +26,38 @@
2526

2627
<IlcHostArch Condition="'$(IlcHostArch)' == ''">$(OSHostArch)</IlcHostArch>
2728
<IlcHostPackageName>runtime.$(OSIdentifier)-$(IlcHostArch).Microsoft.DotNet.ILCompiler</IlcHostPackageName>
28-
2929
<IlcCalledViaPackage>true</IlcCalledViaPackage>
30+
3031
</PropertyGroup>
3132

3233
<PropertyGroup>
34+
3335
<!-- If the NativeAOT toolchain is being consumed via package, runtime-specific properties must be set before compilation can proceed -->
3436
<ImportRuntimeIlcPackageTargetDependsOn>RunResolvePackageDependencies</ImportRuntimeIlcPackageTargetDependsOn>
3537
<IlcSetupPropertiesDependsOn>ImportRuntimeIlcPackageTarget</IlcSetupPropertiesDependsOn>
3638
<IlcDynamicBuildPropertyDependencies>SetupProperties</IlcDynamicBuildPropertyDependencies>
37-
</PropertyGroup>
3839

39-
<ItemGroup>
40-
<!-- If called via package instead of the SDK, update the runtime package version to match the build package -->
41-
<_PackageReferenceExceptILCompiler Include="@(PackageReference)" Exclude="Microsoft.DotNet.ILCompiler" />
42-
<_ILCompilerPackageReference Include="@(PackageReference)" Exclude="@(_PackageReferenceExceptILCompiler)" />
43-
<KnownILCompilerPack Update="Microsoft.DotNet.ILCompiler" Condition="@(_ILCompilerPackageReference->'%(Identity)')=='Microsoft.DotNet.ILCompiler'">
44-
<ILCompilerPackVersion>@(_ILCompilerPackageReference->'%(Version)')</ILCompilerPackVersion>
45-
</KnownILCompilerPack>
46-
</ItemGroup>
40+
</PropertyGroup>
4741

4842
<!-- Locate the runtime package according to the current target runtime -->
49-
<Target Name="ImportRuntimeIlcPackageTarget" Condition="'$(BuildingFrameworkLibrary)' != 'true' and '$(PublishAot)' == 'true' and $(IlcCalledViaPackage) == 'true'" DependsOnTargets="$(ImportRuntimeIlcPackageTargetDependsOn)" BeforeTargets="Publish">
50-
<Error Condition="'@(ResolvedILCompilerPack)' == ''" Text="The ResolvedILCompilerPack ItemGroup is required for target ImportRuntimeIlcPackageTarget" />
43+
<Target Name="ImportRuntimeIlcPackageTarget" Condition="'$(BuildingFrameworkLibrary)' != 'true' AND $(IlcCalledViaPackage) == 'true'" DependsOnTargets="$(ImportRuntimeIlcPackageTargetDependsOn)" BeforeTargets="Publish">
44+
<!-- This targets file is imported by the SDK when the AotRuntimePackageLoadedViaSDK property is set. SDK resolves runtime package paths differently-->
45+
<Error Condition="'@(ResolvedILCompilerPack)' == '' AND '$(AotRuntimePackageLoadedViaSDK)' == 'true'" Text="The ResolvedILCompilerPack ItemGroup is required for target ImportRuntimeIlcPackageTarget" />
46+
<!-- NativeAOT runtime pack assemblies need to be defined to avoid the default CoreCLR implementations being set as compiler inputs -->
47+
<Error Condition="'@(PackageDefinitions)' == '' AND '$(AotRuntimePackageLoadedViaSDK)' != 'true'" Text="The PackageDefinitions ItemGroup is required for target ImportRuntimeIlcPackageTarget" />
48+
49+
50+
<!-- This targets file is imported by the SDK when the AotRuntimePackageLoadedViaSDK property is set. Use the SDK runtime package resolve property to set down stream properties -->
51+
<PropertyGroup Condition="'$(AotRuntimePackageLoadedViaSDK)' == 'true'">
52+
<RuntimePackagePath>@(ResolvedILCompilerPack->'%(PackageDirectory)')</RuntimePackagePath>
53+
<IlcHostPackagePath>@(ResolvedILCompilerPack->'%(PackageDirectory)')</IlcHostPackagePath>
54+
<IlcPath>>@(ResolvedILCompilerPack->'%(PackageDirectory)')</IlcPath>
55+
</PropertyGroup>
5156

52-
<PropertyGroup>
53-
<IlcHostPackagePath Condition="'@(ResolvedILCompilerPack)' == '$(IlcHostPackageName)'">@(ResolvedILCompilerPack->'%(PackageDirectory)')</IlcHostPackagePath>
54-
<RuntimePackagePath Condition="'@(ResolvedTargetILCompilerPack)' == '$(RuntimeIlcPackageName)'">@(ResolvedTargetILCompilerPack->'%(PackageDirectory)')</RuntimePackagePath>
55-
<RuntimePackagePath Condition="'@(ResolvedTargetILCompilerPack)' == ''">@(ResolvedILCompilerPack->'%(PackageDirectory)')</RuntimePackagePath>
57+
<!-- Use the non-SDK runtime package resolve property to set down stream properties if there is an explicit reference in the project -->
58+
<PropertyGroup Condition="'$(AotRuntimePackageLoadedViaSDK)' != 'true'">
59+
<RuntimePackagePath Condition="'%(PackageDefinitions.Name)' == '$(RuntimeIlcPackageName)'">%(PackageDefinitions.ResolvedPath)</RuntimePackagePath>
60+
<IlcHostPackagePath Condition="'%(PackageDefinitions.Name)' == '$(IlcHostPackageName)'">%(PackageDefinitions.ResolvedPath)</IlcHostPackagePath>
5661
</PropertyGroup>
5762

5863
</Target>

src/coreclr/tools/aot/crossgen2/crossgen2.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
</PropertyGroup>
4343

4444
<Import Project="$(R2ROverridePath)" Condition="'$(R2ROverridePath)' != ''" />
45-
<Import Project="$(CoreCLRBuildIntegrationDir)Microsoft.DotNet.ILCompiler.SingleEntry.targets"
45+
<Import Project="$(CoreCLRBuildIntegrationDir)Microsoft.DotNet.ILCompiler.targets"
4646
Condition="'$(NativeAotSupported)' == 'true' and '$(RunningPublish)' == 'true'" />
4747

4848
<Target Name="RewriteRuntimePackDir"

src/libraries/tests.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@
424424

425425
<!-- https://github.com/dotnet/runtime/issues/72908 -->
426426
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.Reflection.MetadataLoadContext\tests\System.Reflection.MetadataLoadContext.Tests.csproj" />
427-
427+
428428
<!-- Test needs to copy .so file: https://github.com/dotnet/runtime/issues/72987 -->
429429
<ProjectExclusions Include="$(MSBuildThisFileDirectory)System.IO.Ports\tests\System.IO.Ports.Tests.csproj"
430430
Condition="'$(TargetOS)' != 'windows'" />

0 commit comments

Comments
 (0)