Skip to content

Commit 3998f4a

Browse files
authored
Build ilasm/ildasm packages for the host machine (#111512)
1 parent 112fa51 commit 3998f4a

9 files changed

+40
-8
lines changed

Directory.Build.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
<PropertyGroup>
5858
<!-- Define properties that depend on the host SDK RID here. -->
5959
<BuildHostTools Condition="'$(DotNetBuildOrchestrator)' == 'true' and '$(OutputRID)' != '$(NETCoreSdkRuntimeIdentifier)'">true</BuildHostTools>
60+
<BuildHostILTools Condition="'$(BuildHostTools)' == 'true' and $([MSBuild]::IsOsPlatform(Windows))">true</BuildHostILTools>
6061
</PropertyGroup>
6162

6263
<!-- The Default behavior in VS is to show files for the first target framework in TargetFrameworks property.

eng/Publishing.props

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@
1212
Mark assets as Vertical visibility when building in the VMR
1313
-->
1414
<ItemGroup Condition="'$(DotNetBuildOrchestrator)' == 'true'">
15+
<Artifact Condition="'$(OutputRID)' != '$(NETCoreSdkRuntimeIdentifier)'"
16+
Update="$(ArtifactsPackagesDir)**\runtime.$(NETCoreSdkRuntimeIdentifier).Microsoft.NETCore.ILAsm.*.nupkg"
17+
Visibility="Vertical"
18+
IsShipping="false" />
19+
<Artifact Condition="'$(OutputRID)' != '$(NETCoreSdkRuntimeIdentifier)'"
20+
Update="$(ArtifactsPackagesDir)**\runtime.$(NETCoreSdkRuntimeIdentifier).Microsoft.NETCore.ILDAsm.*.nupkg"
21+
Visibility="Vertical"
22+
IsShipping="false" />
1523
<Artifact Condition="'$(RuntimeFlavor)' != 'Mono' and '$(OutputRID)' != '$(NETCoreSdkRuntimeIdentifier)'"
1624
Update="$(ArtifactsPackagesDir)**\Microsoft.NETCore.App.Crossgen2.$(NETCoreSdkRuntimeIdentifier).*.nupkg"
1725
Visibility="Vertical"

eng/Subsets.props

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,12 +306,24 @@
306306
<!--
307307
Build the CoreCLR cross tools when we're doing a cross build and either we're building any CoreCLR native tools for platforms CoreCLR fully supports or when someone explicitly requests them.
308308
The cross tools are used as part of the build process with the downloaded build tools, so we need to build them for the host architecture and build them as unsanitized binaries.
309+
Additionally, in a vertical orchestrated build, we need to produce an ilasm and ildasm for use by upstack repositories.
310+
However, these repositories only build on Windows, so we can limit this to only execute on Windows to avoid additional infrastructure work when not necessary.
309311
-->
310-
<ItemGroup Condition="(('$(ClrRuntimeBuildSubsets)' != '' and ('$(PrimaryRuntimeFlavor)' == 'CoreCLR' or '$(TargetsMobile)' == 'true')) or $(_subset.Contains('+clr.crossarchtools+'))) and ('$(CrossBuild)' == 'true' or '$(BuildArchitecture)' != '$(TargetArchitecture)' or '$(EnableNativeSanitizers)' != '')">
312+
<PropertyGroup>
313+
<_BuildAnyCrossArch Condition="'$(CrossBuild)' == 'true' or '$(BuildArchitecture)' != '$(TargetArchitecture)' or '$(EnableNativeSanitizers)' != ''">true</_BuildAnyCrossArch>
314+
<_BuildCrossComponents Condition="$(_subset.Contains('+clr.crossarchtools+'))">true</_BuildCrossComponents>
315+
<_BuildCrossComponents Condition="'$(ClrRuntimeBuildSubsets)' != '' and ('$(PrimaryRuntimeFlavor)' == 'CoreCLR' or '$(TargetsMobile)' == 'true')">true</_BuildCrossComponents>
316+
</PropertyGroup>
317+
318+
<ItemGroup>
319+
<_CrossToolSubset Condition="'$(_BuildCrossComponents)' == 'true'" Include="ClrCrossComponentsSubset=true" />
320+
<_CrossToolSubset Condition="'$(BuildHostILTools)' == 'true'" Include="ClrILToolsSubset=true" />
321+
</ItemGroup>
322+
323+
<ItemGroup Condition="'$(_BuildAnyCrossArch)' == 'true' and '@(_CrossToolSubset)' != ''">
311324
<ProjectToBuild
312325
Include="$(CoreClrProjectRoot)runtime.proj"
313-
AdditionalProperties="%(AdditionalProperties);
314-
ClrCrossComponentsSubset=true;
326+
AdditionalProperties="%(AdditionalProperties);@(_CrossToolSubset);
315327
HostArchitecture=$(BuildArchitecture);
316328
HostCrossOS=$(HostOS);
317329
PgoInstrument=false;

src/coreclr/.nuget/Microsoft.NETCore.ILAsm/Microsoft.NETCore.ILAsm.pkgproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<NativeBinary Include="$(RuntimeBinDir)ilasm$(ExeSuffix)" />
14+
<NativeBinary Condition="'$(PackCrossComponent)' != 'true'" Include="$(RuntimeBinDir)ilasm$(ExeSuffix)" />
15+
<NativeBinary Condition="'$(PackCrossComponent)' == 'true'" Include="$(RuntimeBinDir)$(BuildArchitecture)/ilasm$(ExeSuffix)" />
1516
</ItemGroup>
1617

1718
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />

src/coreclr/.nuget/Microsoft.NETCore.ILAsm/Microsoft.NETCore.ILAsm.proj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<Project Sdk="Microsoft.Build.Traversal">
2+
<PropertyGroup>
3+
<IsILToolPackage>true</IsILToolPackage>
4+
</PropertyGroup>
25
<ItemGroup>
36
<!-- identity project, runtime specific projects are included by props above -->
47
<Project Include="$(MSBuildProjectName).pkgproj" />

src/coreclr/.nuget/Microsoft.NETCore.ILDAsm/Microsoft.NETCore.ILDAsm.pkgproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
</PropertyGroup>
1212

1313
<ItemGroup>
14-
<NativeBinary Include="$(RuntimeBinDir)ildasm$(ExeSuffix)" />
14+
<NativeBinary Condition="'$(PackCrossComponent)' != 'true'" Include="$(RuntimeBinDir)ildasm$(ExeSuffix)" />
15+
<NativeBinary Condition="'$(PackCrossComponent)' == 'true'" Include="$(RuntimeBinDir)$(BuildArchitecture)/ildasm$(ExeSuffix)" />
1516
</ItemGroup>
1617

1718
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />

src/coreclr/.nuget/Microsoft.NETCore.ILDAsm/Microsoft.NETCore.ILDAsm.proj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<Project Sdk="Microsoft.Build.Traversal">
2+
<PropertyGroup>
3+
<IsILToolPackage>true</IsILToolPackage>
4+
</PropertyGroup>
25
<ItemGroup>
36
<!-- identity project, runtime specific projects are included by props above -->
47
<Project Include="$(MSBuildProjectName).pkgproj" />

src/coreclr/.nuget/builds.targets

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
<ItemGroup Condition="'$(BuildIdentityPackage)' == 'true'">
1818
<_projectsToBuild Include="@(Project)" Condition="'%(Project.PackageTargetRuntime)' == ''" />
1919
</ItemGroup>
20+
<ItemGroup Condition="'$(BuildHostILTools)' == 'true' and '$(IsILToolPackage)' == 'true'">
21+
<_projectsToBuild Include="@(Project)" Condition="'%(Project.PackageTargetRuntime)' == '$(NETCoreSdkRuntimeIdentifier)'" AdditionalProperties="%(Project.AdditionalProperties);PackCrossComponent=true" />
22+
</ItemGroup>
2023

2124
<ItemGroup>
2225
<ProjectReference Include="@(_projectsToBuild)" />

src/coreclr/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ endif()
7575
# Include libraries native shims
7676
#-------------------------------
7777
if(NOT CLR_CROSS_COMPONENTS_BUILD)
78-
set(STATIC_LIBS_ONLY 1)
79-
add_subdirectory(${CLR_SRC_NATIVE_DIR}/libs libs-native)
80-
endif(NOT CLR_CROSS_COMPONENTS_BUILD)
78+
set(STATIC_LIBS_ONLY 1)
79+
add_subdirectory(${CLR_SRC_NATIVE_DIR}/libs libs-native)
80+
endif()
8181

8282
#-----------------------------------------
8383
# Add Projects

0 commit comments

Comments
 (0)