Skip to content

Commit

Permalink
[0.74] Port Desktop DLL to ARM64EC (#13334)
Browse files Browse the repository at this point in the history
* Port Desktop DLL to ARM64EC (#13320)

* Upgrade WinSDK version for C/C++ projects

* 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

* Add explicit LIB dependencies for ARM64EC

* Skip React.Windows.IntegrationTests on ARM64EC

* Remove OpenSSL from Desktop LIB and DLL

* /t:Vars - Log SolutionName

* Update Desktop NUSPEC to use ARM64EC (#13335)

* Add ARM64EC strip slices
  • Loading branch information
JunielKatarn authored Jul 19, 2024
1 parent 7d828ea commit 696f0bb
Show file tree
Hide file tree
Showing 35 changed files with 401 additions and 173 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
20 changes: 10 additions & 10 deletions .ado/jobs/desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,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 @@ -61,12 +61,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 @@ -180,7 +180,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 @@ -202,7 +202,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
11 changes: 7 additions & 4 deletions .ado/jobs/nuget-desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,20 @@ jobs:
dependsOn:
- DesktopX64Release
- DesktopX86Debug

- DesktopARM64ECRelease

pool: ${{ parameters.AgentPool.Small }}
timeoutInMinutes: 30 # how long to run the job before automatically cancelling
cancelTimeoutInMinutes: 5 # how much time to give 'run always even if cancelled tasks' before killing them
steps:
- template: ../templates/checkout-shallow.yml

- template: ../templates/yarn-install.yml

- task: NuGetToolInstaller@1
inputs:
versionSpec: ">=5.8.0"

- template: ../templates/prep-and-pack-nuget.yml
parameters:
artifactName: Desktop
Expand All @@ -39,3 +40,5 @@ jobs:
configuration: Release
- platform: x86
configuration: Debug
- platform: ARM64EC
configuration: Release
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Port Desktop DLL to ARM64EC (#13320)",
"packageName": "react-native-windows",
"email": "julio.rocha@microsoft.com",
"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
22 changes: 20 additions & 2 deletions 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 @@ -99,6 +107,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 @@ -116,6 +130,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 @@ -155,7 +174,6 @@
<ItemGroup>
<PackageReference Include="boost" Version="1.76.0.0" />
<PackageReference Include="Microsoft.JavaScript.Hermes" Version="$(HermesVersion)" />
<PackageReference Include="ReactWindows.OpenSSL.StdCall.Static" Version="1.0.2-p.5" />
<PackageReference Include="$(V8PackageName)" Version="$(V8Version)" Condition="'$(UseV8)' == 'true'" />
</ItemGroup>
<Choose>
Expand All @@ -171,4 +189,4 @@
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Target Name="GetTargetFileName" Returns="$(OutDir)$(TargetName).dll" />
</Project>
</Project>
29 changes: 18 additions & 11 deletions vnext/Desktop.DLL/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
},
"Microsoft.JavaScript.Hermes": {
"type": "Direct",
"requested": "[0.1.18, )",
"resolved": "0.1.18",
"contentHash": "5K8rRihGwIs2XNOTP2Jsw3T6cegxCBQXcpPS4optONU/AmFElGAfnA6XBQJ4UqlCFCl9Nf9zQrgvCUPBWYHiag=="
"requested": "[0.1.21, )",
"resolved": "0.1.21",
"contentHash": "5njCh+3eXTLOv7+8nOnp6nJ5C0r6it5ze54c0nuWleeDptuK8t3dEDB79XTU4D5DKNvAPlqJpgXRDOak5nYIug=="
},
"Microsoft.SourceLink.GitHub": {
"type": "Direct",
Expand All @@ -30,12 +30,6 @@
"resolved": "0.71.8",
"contentHash": "ksHjshj05AMAQ/v7Wet5Dwcwn9Up2BTOIrTv1yEW7+D23FQX0yILW5Zw0bmlWtV8MEtdY611z+06U3Xvu2ygSA=="
},
"ReactWindows.OpenSSL.StdCall.Static": {
"type": "Direct",
"requested": "[1.0.2-p.5, )",
"resolved": "1.0.2-p.5",
"contentHash": "1tAtFgtbVpI/JgRIxy9j30R/W6B1zi9dYt0o5QwAk5V3X2mo9xrrHcbXlbczKQIftYoNHe0Mfq9ExIu9A1Cs0g=="
},
"Microsoft.Build.Tasks.Git": {
"type": "Transitive",
"resolved": "1.1.1",
Expand All @@ -46,6 +40,19 @@
"resolved": "1.1.1",
"contentHash": "WMcGpWKrmJmzrNeuaEb23bEMnbtR/vLmvZtkAP5qWu7vQsY59GqfRJd65sFpBszbd2k/bQ8cs8eWawQKAabkVg=="
},
"Microsoft.Windows.SDK.BuildTools": {
"type": "Transitive",
"resolved": "10.0.22621.756",
"contentHash": "7ZL2sFSioYm1Ry067Kw1hg0SCcW5kuVezC2SwjGbcPE61Nn+gTbH86T73G3LcEOVj0S3IZzNuE/29gZvOLS7VA=="
},
"Microsoft.WindowsAppSDK": {
"type": "Transitive",
"resolved": "1.5.240227000",
"contentHash": "6rESOsREi8534J7IDpNfFYPvxQaSleXKt4A7ZYPeQyckNMQ0o1W0jZ420bJbEMz9Cw/S/8IbpPftLLZ9w/GTCQ==",
"dependencies": {
"Microsoft.Windows.SDK.BuildTools": "10.0.22621.756"
}
},
"common": {
"type": "Project",
"dependencies": {
Expand Down Expand Up @@ -74,11 +81,11 @@
"Common": "[1.0.0, )",
"Folly": "[1.0.0, )",
"FollyWin32": "[1.0.0, )",
"Microsoft.JavaScript.Hermes": "[0.1.18, )",
"Microsoft.JavaScript.Hermes": "[0.1.21, )",
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
"Microsoft.WindowsAppSDK": "[1.5.240227000, )",
"ReactCommon": "[1.0.0, )",
"ReactNative.V8Jsi.Windows": "[0.71.8, )",
"ReactWindows.OpenSSL.StdCall.Static": "[1.0.2-p.5, )",
"boost": "[1.76.0, )"
}
},
Expand Down
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
Loading

0 comments on commit 696f0bb

Please sign in to comment.