Skip to content

[Dont merge] Add ARM64 targets for ANCM #30680

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .azure/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ stages:
-sign
-pack
-noBuildJava
-noBuildNative
/p:DotNetSignType=$(_SignType)
/p:OnlyPackPlatformSpecificPackages=true
$(_BuildArgs)
Expand Down
1,079 changes: 1,077 additions & 2 deletions AspNetCore.sln

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
<MvcTestingTargets>$(MSBuildThisFileDirectory)src\Mvc\Mvc.Testing\src\Microsoft.AspNetCore.Mvc.Testing.targets</MvcTestingTargets>
<_MvcTestingTasksAssembly>$(ArtifactsBinDir)\Microsoft.AspNetCore.Mvc.Testing.Tasks\$(Configuration)\netstandard2.0\Microsoft.AspNetCore.Mvc.Testing.Tasks.dll</_MvcTestingTasksAssembly>
<!-- IIS native projects can only be built on Windows for x86 and x64. -->
<BuildIisNativeProjects Condition=" '$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64') ">true</BuildIisNativeProjects>
<BuildIisNativeProjects Condition=" '$(TargetOsName)' == 'win' AND '$(TargetArchitecture)' != 'ARM' ">true</BuildIisNativeProjects>
<!-- This property is shared by several projects to layout the AspNetCore.App targeting pack for installers -->
<TargetingPackLayoutRoot>$(ArtifactsObjDir)TargetingPack.Layout\$(Configuration)\</TargetingPackLayoutRoot>
<!-- This property is shared by several projects to layout the AspNetCore.App shared framework for installers -->
Expand Down
13 changes: 12 additions & 1 deletion eng/Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
</ItemGroup>
</When>
<Otherwise>
<ItemGroup Condition=" '$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64') ">
<ItemGroup Condition=" '$(BuildInstallers)' == 'true' AND '$(TargetOsName)' == 'win' AND ('$(TargetArchitecture)' == 'x86' OR '$(TargetArchitecture)' == 'x64') ">
<!-- Build the ANCM custom action -->
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=x64" />
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=Win32" />
Expand Down Expand Up @@ -98,6 +98,13 @@
<!-- We don't build the bundle here because we'd have to bundle the x86 installer which gets built in a different leg.
Instead we only provide the ARM64 MSI-->

<!-- Build the ANCM custom action -->
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\CustomAction\aspnetcoreCA.vcxproj" AdditionalProperties="Platform=ARM64" />

<!-- Build the ANCM msis -->
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMIISExpressV2\AncmIISExpressV2.wixproj" AdditionalProperties="Platform=ARM64" />
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\AspNetCoreModule-Setup\ANCMV2\ANCMV2.wixproj" AdditionalProperties="Platform=ARM64" />

<!-- Build the SharedFramework wixlib -->
<ProjectToBuild Include="$(RepoRoot)src\Installers\Windows\SharedFrameworkLib\SharedFrameworkLib.wixproj" AdditionalProperties="Platform=arm64" />
</ItemGroup>
Expand All @@ -114,6 +121,10 @@
<NativeProjects Include="$(RepoRoot)src\**\*.vcxproj" Exclude="@(ProjectToExclude)" AdditionalProperties="Platform=Win32" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetOsName)' == 'win' AND '$(TargetArchitecture)' == 'ARM64' ">
<NativeProjects Include="$(RepoRoot)src\**\*.vcxproj" Exclude="@(ProjectToExclude)" AdditionalProperties="Platform=ARM64" />
</ItemGroup>

<ItemGroup>
<ProjectToBuild Condition=" $(BuildNative) " Include="@(NativeProjects)" Exclude="@(ProjectToExclude)" />
<ProjectToExclude Condition=" !$(BuildNative) " Include="@(NativeProjects)" />
Expand Down
2 changes: 1 addition & 1 deletion eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ if ($BuildNodeJS) { $dotnetBuildArguments += "/p:BuildNodeJS=true" }
# "-Projects ... -NoBuildJava -NoBuildManaged -NoBuildNodeJS". An empty `./build.ps1` command will build both
# managed and native projects.
$performDesktopBuild = ($BuildInstallers -and $Architecture -ne "arm") -or `
($BuildNative -and -not $Architecture.StartsWith("arm", [System.StringComparison]::OrdinalIgnoreCase))
($BuildNative -and -not $Architecture.Equals("arm", [System.StringComparison]::OrdinalIgnoreCase))
$performDotnetBuild = $BuildJava -or $BuildManaged -or $BuildNodeJS -or `
($All -and -not ($NoBuildJava -and $NoBuildManaged -and $NoBuildNodeJS)) -or `
($Projects -and -not ($BuildInstallers -or $specifiedBuildNative))
Expand Down
2 changes: 2 additions & 0 deletions eng/scripts/vs.buildtools.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"Microsoft.VisualStudio.Component.NuGet.BuildTools",
"Microsoft.VisualStudio.Component.VC.ATL",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"Microsoft.VisualStudio.Component.VC.ATL.ARM64",
"Microsoft.VisualStudio.Component.VC.Tools.ARM64",
"Microsoft.VisualStudio.Component.Windows10SDK.17134",
"Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools",
"Microsoft.VisualStudio.Workload.MSBuildTools",
Expand Down
2 changes: 2 additions & 0 deletions eng/scripts/vs.buildtools.preview.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"Microsoft.VisualStudio.Component.NuGet.BuildTools",
"Microsoft.VisualStudio.Component.VC.ATL",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"Microsoft.VisualStudio.Component.VC.ATL.ARM64",
"Microsoft.VisualStudio.Component.VC.Tools.ARM64",
"Microsoft.VisualStudio.Component.Windows10SDK.17134",
"Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools",
"Microsoft.VisualStudio.Workload.MSBuildTools",
Expand Down
2 changes: 2 additions & 0 deletions eng/scripts/vs.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"Microsoft.Net.Component.4.7.2.TargetingPack",
"Microsoft.VisualStudio.Component.VC.ATL",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"Microsoft.VisualStudio.Component.VC.ATL.ARM64",
"Microsoft.VisualStudio.Component.VC.Tools.ARM64",
"Microsoft.VisualStudio.Component.Windows10SDK.17134",
"Microsoft.VisualStudio.Workload.ManagedDesktop",
"Microsoft.VisualStudio.Workload.NativeDesktop",
Expand Down
2 changes: 2 additions & 0 deletions eng/scripts/vs.preview.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
"Microsoft.Net.Component.4.7.2.TargetingPack",
"Microsoft.VisualStudio.Component.VC.ATL",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"Microsoft.VisualStudio.Component.VC.ATL.ARM64",
"Microsoft.VisualStudio.Component.VC.Tools.ARM64",
"Microsoft.VisualStudio.Component.Windows10SDK.17134",
"Microsoft.VisualStudio.Workload.ManagedDesktop",
"Microsoft.VisualStudio.Workload.NativeDesktop",
Expand Down
6 changes: 6 additions & 0 deletions eng/targets/Cpp.Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
<IntDir>$(IntermediateOutputPath)</IntDir>
</PropertyGroup>

<!-- These test projects are skipped because you cannot test native ARM64 projects on a x86/x64 machine. -->
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkotalik You may want to specifically review this and the changes to the Cpp.Common.Targets as well

<PropertyGroup Condition=" '$(Platform)' == 'ARM64' AND '$(TargetArchitecture)' == 'x64' ">
<SkipNativeTest>true</SkipNativeTest>
<TestProjectSkipReason>You cannot test native ARM64 projects on a x86/x64 machine</TestProjectSkipReason>
</PropertyGroup>

<Import Project="MicroBuild.Plugin.props" Condition="'$(MicroBuildSentinelFile)' == ''" />
<Import Project="$(MicroBuildPluginDirectory)\MicroBuild.Plugins.*\**\build\MicroBuild.Plugins.*.props" Condition=" '$(MicroBuildPluginDirectory)' != ''" />

Expand Down
2 changes: 1 addition & 1 deletion eng/targets/Cpp.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<Target Name="Pack" />
<Target Name="Restore" />
<Target Name="ResolveNuGetPackageAssets" />
<Target Name="Test" Condition="'$(IsTestProject)' == 'true'" >
<Target Name="Test" Condition="'$(IsTestProject)' == 'true' AND '$(SkipNativeTest)' != 'true'" >
<Warning Condition="'$(TestProjectSkipReason)' != ''" Text="Skipped $(MSBuildProjectFileName): $(TestProjectSkipReason)" />
<Exec Condition="'$(TestProjectSkipReason)' == ''" Command="&quot;$(TargetPath)&quot;" />
</Target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<SchemaVersion>2.0</SchemaVersion>
<TempPlatform Condition="'$(Platform)' == 'x64'">x64</TempPlatform>
<TempPlatform Condition="'$(Platform)' == 'x86'">Win32</TempPlatform>
<TempPlatform Condition="'$(Platform)' == 'arm64'">ARM64</TempPlatform>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -47,6 +48,7 @@
<ProjectReference Include="..\CustomAction\aspnetcoreCA.vcxproj">
<Name>aspnetcoreCA</Name>
<SetPlatform Condition="'$(Platform)' == 'x86'">Platform=Win32</SetPlatform>
<SetPlatform Condition="'$(Platform)' == 'arm64'">Platform=ARM64</SetPlatform>
<Project>{7c27e72f-54d0-4820-8cfa-5e4be640974b}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
Manufacturer="!(loc.Manufacturer)"
Compressed="yes"
InstallPrivileges="elevated"
InstallerVersion="400"
InstallerVersion="$(var.InstallerVersion)"
Platform="$(var.PlatformValue)" />

<Media Id="1" Cabinet="aspnetcoremodule.cab" EmbedCab="yes" CompressionLevel="high"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<ProjectReference Include="..\CustomAction\aspnetcoreCA.vcxproj">
<Name>aspnetcoreCA</Name>
<SetPlatform Condition="'$(Platform)' == 'x86'">Platform=Win32</SetPlatform>
<SetPlatform Condition="'$(Platform)' == 'arm64'">Platform=ARM64</SetPlatform>
<Project>{7c27e72f-54d0-4820-8cfa-5e4be640974b}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
Manufacturer="!(loc.Manufacturer)"
Compressed="yes"
InstallPrivileges="elevated"
InstallerVersion="400"
InstallerVersion="$(var.InstallerVersion)"
Platform="$(var.PlatformValue)" />

<Media Id="1" Cabinet="aspnetcoremodule.cab" EmbedCab="yes" CompressionLevel="high"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup>
<ANCM-Setup Condition="$(ANCM-Setup) == ''">$(MSBuildThisFileDirectory)..\</ANCM-Setup>
<EnableSourceLink>false</EnableSourceLink>
</PropertyGroup>

<PropertyGroup>
<_IIS-SetupExportsPath>$(ANCM-Setup)IIS-Setup\build\exports.props</_IIS-SetupExportsPath>
</PropertyGroup>

<Import Condition="$(IIS-Setup) == '' AND Exists('$(_IIS-SetupExportsPath)')" Project="$(_IIS-SetupExportsPath)" />

<!-- Build error if submodule dependencies could not be found. -->
<Import Project="..\build\settings.props" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
Expand Down Expand Up @@ -88,4 +92,4 @@
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>
</Project>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reset your preferences so that newlines at the ends of files are left alone. Then fix this and other changed files up. Right now at least, most developers seem to add newlines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack. Will fix.

Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\build\submodule.props" />
<Import Project="..\..\..\build\submodule.props" />
<Import Project="..\..\..\build\settings.props" />

<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
Expand Down Expand Up @@ -71,4 +78,4 @@
<ClInclude Include="precomp.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
<Import Project="..\build\submodule.props" />
<Import Project="..\build\settings.props" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
Expand Down Expand Up @@ -66,4 +74,4 @@
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
<Import Project="..\..\..\build\submodule.props" />
<Import Project="..\..\..\build\settings.props" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
Expand Down Expand Up @@ -116,6 +124,11 @@
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='ARM64'">
<Link>
<AdditionalLibraryDirectories>$(VC_ReferencesPath_ARM64);$(WindowsSDK_LibraryPath)\$(PlatformTarget);$(WIX)sdk\$(WixPlatformToolset)\lib\arm64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='x64'">
<Link>
<AdditionalLibraryDirectories>$(VC_ReferencesPath_x64);$(WindowsSDK_LibraryPath)\$(PlatformTarget);$(WIX)sdk\$(WixPlatformToolset)\lib\x64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
<?define ProgramFilesFolder = ProgramFilesFolder ?>
<?define SystemFolder = SystemFolder ?>
<?define PlatformValue = Intel ?>
<?elseif $(var.Platform) ~= "arm64" ?>
<?define IsWin64 = yes ?>
<?define PlatformArchitecture = ARM64 ?>
<?define ProgramFilesFolder = ProgramFiles64Folder ?>
<?define SystemFolder = System64Folder ?>
<?define PlatformValue = "arm64" ?>
<?endif?>

<!-- Ensure build target properly initialized -->
Expand Down
2 changes: 1 addition & 1 deletion src/Installers/Windows/Wix.targets
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<!-- ARM64 MSIs require the installer version to be at least 500. -->
<!-- See: https://docs.microsoft.com/en-us/windows/win32/msi/64-bit-windows-installer-packages -->
<DefineConstants Condition=" '$(Platform)' == 'arm64' ">$(DefineConstants);InstallerVersion=500</DefineConstants>
<DefineConstants Condition=" '$(Platform)' != 'arm64' ">$(DefineConstants);InstallerVersion=200</DefineConstants>
<DefineConstants Condition=" '$(Platform)' != 'arm64' ">$(DefineConstants);InstallerVersion=400</DefineConstants>

<DefineConstants>$(DefineConstants);MajorVersion=$(AspNetCoreMajorVersion)</DefineConstants>
<DefineConstants>$(DefineConstants);MinorVersion=$(AspNetCoreMinorVersion)</DefineConstants>
Expand Down
Loading