-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[0.72] Properly detect the correct machine architecture in CLI (#11987)
This PR backports #11978 to RNW 0.72. ## Description Node's `process.arch` and `os.arch()` methods both return the architecture that the node binaries were built for, not the architecture of the machine they're running. This can cause issues with the various hardware virtualization layers, specifically when running 32-bit Node on 64-bit machines. Closes: #11977 ### Type of Change - Bug fix (non-breaking change which fixes an issue) ### Why We keep hitting issues when users run the 32-bit Node on 64-bit Windows configuration. Closes: #11977 ### What This PR: * Updates and exports the `deviceArchitecture()` API in the `@react-native-windows/telemetry` library, which now correctly detects when x86 Node is being used on an x64 machine * Adds and exports a new `nodeArchitecture()` method, which is also now recorded in telemetry * Updates the `react-native-windows-init` and `@react-native-windows/cli` commands to warn the user if there's a mismatch * Fixes an issue where querying for a registry key would fail due to querying the wrong registry because of the SysWOW64 redirection ## Screenshots N/A ## Testing Updated the telemetry tests with a new test for `nodeArchitecture`. ## Changelog Should this change be included in the release notes: Yes Properly detect the correct machine architecture for 32-bit Node on 64-bit Windows scenarios
- Loading branch information
1 parent
cef0edd
commit 219790d
Showing
10 changed files
with
95 additions
and
16 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@react-native-windows-cli-89b5d265-8b1d-40b6-9cda-1449d039d1b2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "[0.72] Properly detect the correct machine architecture", | ||
"packageName": "@react-native-windows/cli", | ||
"email": "jthysell@microsoft.com", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@react-native-windows-telemetry-39db57fb-a779-4bd5-93bd-edfa4aed719b.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "[0.72] Properly detect the correct machine architecture", | ||
"packageName": "@react-native-windows/telemetry", | ||
"email": "jthysell@microsoft.com", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/react-native-windows-init-632430bc-c96b-4bf3-b20e-26f62b73e43f.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "[0.72] Properly detect the correct machine architecture", | ||
"packageName": "react-native-windows-init", | ||
"email": "jthysell@microsoft.com", | ||
"dependentChangeType": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters