Skip to content

Commit

Permalink
Port Desktop DLL to ARM64EC (#13320)
Browse files Browse the repository at this point in the history
* Add ARM64EC Platform

* Add property sheets

* Add packages.lock.json

* Upgrade WinSDK version for C/C++ projects
Older SDK versions do not contain softintrin.h
See http://www.emulators.com/docs/abc_arm64ec_explained.htm

* Do not build Integration Test projects for ARM64EC

* Make V8Platform x64 for ARM64EC

* Override HermesPlatform for ARM64EC

* Override WinAppSDK platforms for ARM64EC

* Exclude OpenSSL on Desktop DLL for ARM64EC

* Override WinAppSDK _MrtCoreRuntimeIdentifier

* Update packages.lock.json

* Add explicit LIB dependencies for ARM64EC

* Skip React.Windows.IntegrationTests on ARM64EC

* Change files

* Simplify condition for WindowsAppSDKOverrides

* Switch from ARM64 to ARM64EC in Desktop CI

* Update prepare-build-env.yml

* Enable ARM64EC on PullRequest env

* Remove OpenSSL from Desktop LIB and DLL

* /t:Vars - Log SolutionName
  • Loading branch information
JunielKatarn authored Jun 10, 2024
1 parent 53fe43a commit 5a2f8d9
Show file tree
Hide file tree
Showing 32 changed files with 303 additions and 122 deletions.
2 changes: 1 addition & 1 deletion .ado/config/PoliCheckExclusions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ NOTE: Use ALL CAPS for excluded terms below else it will silently ignore them. A
<PoliCheckExclusions>
<!-- Each of these exclusions is a folder name -if \[name]\exists in the file path, it will be skipped -->
<Exclusion Type="FolderPathFull">
.GIT|ARM|ARM64|BUILD|DIST|GENERATED FILES|NODE_MODULES|OUTPUT|TARGET|X64|X86|PATCHES|LIB-COMMONJS
.GIT|ARM|ARM64|ARM64EC|BUILD|DIST|GENERATED FILES|NODE_MODULES|OUTPUT|TARGET|X64|X86|PATCHES|LIB-COMMONJS
</Exclusion>
<!-- Each of these exclusions is a folder name -if any folder or file starts with "\[name]", it will be skipped -->
<Exclusion Type="FolderPathStart">
Expand Down
18 changes: 12 additions & 6 deletions .ado/jobs/desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ parameters:
BuildConfiguration: Debug
BuildPlatform: x86
UseFabric: false
- Name: ARM64ECDebug
BuildConfiguration: Debug
BuildPlatform: ARM64EC
- Name: ARM64ECRelease
BuildConfiguration: Release
BuildPlatform: ARM64EC
- Name: X64DebugFabric
BuildConfiguration: Debug
BuildPlatform: x64
Expand All @@ -51,12 +57,12 @@ parameters:
- Name: X86Release
BuildConfiguration: Release
BuildPlatform: x86
- Name: Arm64Debug
- Name: ARM64ECDebug
BuildConfiguration: Debug
BuildPlatform: ARM64
- Name: Arm64Release
BuildPlatform: ARM64EC
- Name: ARM64ECRelease
BuildConfiguration: Release
BuildPlatform: ARM64
BuildPlatform: ARM64EC
- Name: X64DebugFabric
BuildConfiguration: Debug
BuildPlatform: x64
Expand Down Expand Up @@ -170,7 +176,7 @@ jobs:

- template: ../templates/discover-google-test-adapter.yml

- ${{ if ne(matrix.BuildPlatform, 'ARM64') }}:
- ${{ if ne(matrix.BuildPlatform, 'ARM64EC') }}:
- task: VSTest@2
displayName: Run Desktop Unit Tests
timeoutInMinutes: 5 # Set smaller timeout , due to hangs
Expand All @@ -192,7 +198,7 @@ jobs:
failOnMinTestsNotRun: true

# Suspected debug assert in TestRunner hanging tests randomly. Run only on Release for now.
- ${{ if and(eq(matrix.BuildConfiguration, 'Release'), ne(variables['Desktop.IntegrationTests.SkipRNTester'], true), ne(matrix.BuildPlatform, 'ARM64')) }}:
- ${{ if and(eq(matrix.BuildConfiguration, 'Release'), ne(variables['Desktop.IntegrationTests.SkipRNTester'], true), ne(matrix.BuildPlatform, 'ARM64EC')) }}:
- task: PowerShell@2
displayName: Set up test servers
inputs:
Expand Down
14 changes: 7 additions & 7 deletions .ado/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ parameters:
BuildConfiguration: Release
BuildPlatform: x86
UseFabric: false
- Name: ARM64Debug
- Name: ARM64ECDebug
BuildConfiguration: Debug
BuildPlatform: ARM64
BuildPlatform: ARM64EC
UseFabric: false
- Name: ARM64Release
- Name: ARM64ECRelease
BuildConfiguration: Release
BuildPlatform: ARM64
BuildPlatform: ARM64EC
UseFabric: false
- Name: X64DebugFabric
BuildConfiguration: Debug
Expand Down Expand Up @@ -184,7 +184,7 @@ extends:
persistCredentials: false # We're going to use rnbot's git creds to publish

- powershell: gci env:/BUILD_*
displayName: Show build information
displayName: Show build information

- template: .ado/templates/prepare-js-env.yml@self

Expand Down Expand Up @@ -444,7 +444,7 @@ extends:
- platform: x86
configuration: Release
- platform: ARM64
configuration: Release
configuration: Release
- platform: x64
configuration: Debug
- platform: x86
Expand All @@ -470,7 +470,7 @@ extends:
- platform: x86
configuration: Release
- platform: ARM64
configuration: Release
configuration: Release
- platform: x64
configuration: Debug
- platform: x86
Expand Down
1 change: 1 addition & 0 deletions .ado/templates/prepare-build-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ parameters:
# - x86
# - x64
# - ARM64
# - ARM64EC
- name: configuration
type: string
# Publish still using runtime matrix
Expand Down
1 change: 1 addition & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
PlatformToolset;
SolutionPath;
SolutionDir;
SolutionName;
IntDir;
OutDir;
TargetDir;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Port Desktop DLL to ARM64EC",
"packageName": "react-native-windows",
"email": "[email protected]",
"dependentChangeType": "patch"
}
8 changes: 8 additions & 0 deletions vnext/Common/Common.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,18 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(ReactNativeWindowsDir)PropertySheets\React.Cpp.props" />
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64EC">
<Configuration>Debug</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64EC">
<Configuration>Release</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
Expand Down
8 changes: 8 additions & 0 deletions vnext/Desktop.ABITests/React.Windows.Desktop.ABITests.vcxproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64EC">
<Configuration>Debug</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64EC">
<Configuration>Release</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
Expand Down
21 changes: 20 additions & 1 deletion vnext/Desktop.DLL/React.Windows.Desktop.DLL.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64EC">
<Configuration>Debug</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
Expand All @@ -13,6 +17,10 @@
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64EC">
<Configuration>Release</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
Expand Down Expand Up @@ -98,6 +106,12 @@
WindowsApp_downlevel.lib;
%(AdditionalDependencies)
</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Platform)' == 'ARM64EC'">
%(AdditionalDependencies);
Bcrypt.lib;
Chakrart.lib;
Pathcch.lib
</AdditionalDependencies>
<DelayLoadDLLs>Chakra.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link>
<Link Condition="'$(UseFabric)' == 'true'">
Expand All @@ -115,6 +129,11 @@
<ModuleDefinitionFile>react-native-win32.x64.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Platform)'=='ARM64EC'">
<Link>
<ModuleDefinitionFile>react-native-win32.x64.def</ModuleDefinitionFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="('$(Platform)'=='Win32' OR '$(Platform)'=='x86')">
<Link>
<ModuleDefinitionFile>react-native-win32.x86.def</ModuleDefinitionFile>
Expand Down Expand Up @@ -169,4 +188,4 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Target Name="GetTargetFileName" Returns="$(OutDir)$(TargetName).dll" />
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64EC">
<Configuration>Debug</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64EC">
<Configuration>Release</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
Expand Down Expand Up @@ -159,4 +167,4 @@
</CppWinRTDynamicProjectWinMDReferences>
</ItemGroup>
</Target>
</Project>
</Project>
8 changes: 8 additions & 0 deletions vnext/Desktop.Test.DLL/React.Windows.Desktop.Test.DLL.vcxproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64EC">
<Configuration>Debug</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64EC">
<Configuration>Release</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@
<EnableWinRtLeanAndMean>false</EnableWinRtLeanAndMean>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64EC">
<Configuration>Debug</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64EC">
<Configuration>Release</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
Expand Down
10 changes: 9 additions & 1 deletion vnext/Desktop/React.Windows.Desktop.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64EC">
<Configuration>Debug</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
Expand All @@ -13,6 +17,10 @@
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64EC">
<Configuration>Release</Configuration>
<Platform>ARM64EC</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
Expand Down Expand Up @@ -300,4 +308,4 @@
<_CppWinRTOriginalRootNamespace />
</PropertyGroup>
</Target>
</Project>
</Project>
Loading

0 comments on commit 5a2f8d9

Please sign in to comment.