Skip to content

Commit 1bbecdf

Browse files
authored
Better experience for unsupported arch (#1984)
* build_attach_binaries: support other arch on linux * compile_linux: warn instead of quit for unsupported arch
1 parent c7e86a1 commit 1bbecdf

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

build_attach_binaries.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import argparse
33
import os
44
import platform
5+
import re
56

67
def build_pydevd_binaries(force: bool):
78
os.environ["PYDEVD_USE_CYTHON"] = "yes"
@@ -25,7 +26,12 @@ def build_pydevd_binaries(force: bool):
2526
if not os.path.exists(os.path.join(pydevd_attach_to_process_root, "attach_amd64.dll")) or force:
2627
os.system(os.path.join(pydevd_attach_to_process_root, "windows", "compile_windows.bat"))
2728
elif platform.system() == "Linux":
28-
if not os.path.exists(os.path.join(pydevd_attach_to_process_root, "attach_linux_amd64.so")) or force:
29+
arch = platform.machine()
30+
if re.match(r'^i.*86$', arch):
31+
arch = 'x86'
32+
if arch == "x86_64":
33+
arch = "amd64"
34+
if not os.path.exists(os.path.join(pydevd_attach_to_process_root, f"attach_linux_{arch}.so")) or force:
2935
os.system(os.path.join(pydevd_attach_to_process_root, "linux_and_mac", "compile_linux.sh"))
3036
elif platform.system() == "Darwin":
3137
if not os.path.exists(os.path.join(pydevd_attach_to_process_root, "attach.dylib")) or force:

src/debugpy/_vendored/pydevd/pydevd_attach_to_process/linux_and_mac/compile_linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARCH="$(uname -m)"
44
case $ARCH in
55
i*86) SUFFIX=x86;;
66
x86_64*) SUFFIX=amd64;;
7-
*) echo >&2 "unsupported: $ARCH"; exit 1;;
7+
*) echo >&2 "unsupported: $ARCH, this script may not work";;
88
esac
99

1010
SRC="$(dirname "$0")/.."

0 commit comments

Comments
 (0)