Skip to content

Commit a7debfd

Browse files
committed
Use sysconfig.get_platform for machine detection
This should function correctly when cross compiling unlike platform.machine.
1 parent 5e4f7e0 commit a7debfd

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## AI Assistance Disclosure
2+
3+
- [x] I did **not** use any AI-assistance tools to help create this pull request.
4+
- [ ] I **did** use AI-assistance tools to *help* create this pull request.
5+
- [x] I have read, understood and followed the projects' [AI Policy](https://github.com/crossbario/autobahn-python/blob/main/AI_POLICY.md) when creating code, documentation etc. for this pull request.
6+
7+
Submitted by: @jameshilliard
8+
Date: 2026-01-01
9+
Related issue(s): #1834
10+
Branch: sysconfig-machine

src/autobahn/nvx/_compile_args.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124

125125
import os
126126
import sys
127-
import platform
127+
import sysconfig
128128

129129

130130
def is_building_wheel():
@@ -194,7 +194,7 @@ def get_compile_args():
194194
return ["/O2", "/W3"]
195195

196196
# GCC/Clang on POSIX (Linux, macOS, *BSD)
197-
machine = platform.machine().lower()
197+
machine = sysconfig.get_platform().lower().split("-")[-1]
198198

199199
# Base flags for all POSIX platforms
200200
base_args = [

0 commit comments

Comments
 (0)