mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-29 16:57:00 +08:00
Fix Node hooks on Apple Silicon
Fixed: 1494447 Change-Id: Ie80af8e1302517640c1433cdf62d2d22651b75e1 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4989682 Commit-Queue: Alex Rudenko <alexrudenko@chromium.org> Reviewed-by: Simon Zünd <szuend@chromium.org> Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
This commit is contained in:
committed by
Devtools-frontend LUCI CQ
parent
fa47345230
commit
e2bc335ce7
Vendored
+11
-1
@@ -10,10 +10,20 @@ import sys
|
||||
import os
|
||||
|
||||
|
||||
def get_mac_architecture():
|
||||
if platform.machine() == "x86_64":
|
||||
is_translated = subprocess.run(
|
||||
["sysctl", "-n", "sysctl.proc_translated"],
|
||||
capture_output=True,
|
||||
text=True).stdout.strip() == "1"
|
||||
return "arm64" if is_translated else "x86_64"
|
||||
return platform.machine()
|
||||
|
||||
|
||||
def GetBinaryPath():
|
||||
return os_path.join(
|
||||
os_path.dirname(__file__), *{
|
||||
'Darwin': ('mac', 'node-darwin-arm64' if platform.machine()
|
||||
'Darwin': ('mac', 'node-darwin-arm64' if get_mac_architecture()
|
||||
== 'arm64' else 'node-darwin-x64', 'bin', 'node'),
|
||||
'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
|
||||
'Windows': ('win', 'node.exe'),
|
||||
|
||||
Reference in New Issue
Block a user