Skip to content

Commit 5ac9261

Browse files
committed
feat: abi3 wheel for atomic ext, exotic platform hint on musl builds
1 parent 10992f5 commit 5ac9261

3 files changed

Lines changed: 38 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,4 @@ src/omnipkg/_vendor/wheels/
207207
.hunk_merger_state.json
208208
.gitattributes
209209
.omnipkg_baseline
210+
ci-wheel-cache/

setup.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ def _build_uv_ffi(install_dir=None):
156156
sources=["src/omnipkg/isolation/atomic_ops.c"],
157157
extra_compile_args=_c_args,
158158
optional=True,
159+
py_limited_api=True, # ← add this
159160
)
160161

161162
class OptionalBuildExt(build_ext):
@@ -168,6 +169,40 @@ def build_extension(self, ext):
168169
print(f"Reason: {e}")
169170
print(f"Installing successfully with Python-speed fallback.")
170171
print(f"{'!'*60}\n")
172+
finally:
173+
_print_exotic_platform_hint()
174+
175+
def _print_exotic_platform_hint():
176+
import platform, sys
177+
machine = platform.machine().lower()
178+
if machine not in ("armv7l", "armv7", "s390x", "riscv64"):
179+
return
180+
# Detect musl
181+
is_musl = False
182+
try:
183+
with open("/proc/self/maps") as f:
184+
is_musl = "musl" in f.read()
185+
except Exception:
186+
pass
187+
if not is_musl:
188+
return
189+
print()
190+
print("=" * 60)
191+
print(f" EXOTIC PLATFORM DETECTED: {platform.machine()} / musl")
192+
print()
193+
print(" Some dependencies (cryptography, psutil) have no")
194+
print(" prebuilt wheels for this platform on PyPI and will")
195+
print(" attempt to compile from source, which requires Rust")
196+
print(" and can take 20-40 minutes or fail entirely.")
197+
print()
198+
print(" Pre-built wheels available at:")
199+
print(" https://1minds3t.github.io/exotic-wheels/")
200+
print()
201+
print(" For a faster install run:")
202+
print(f" pip install omnipkg \\")
203+
print(f" --extra-index-url https://1minds3t.github.io/exotic-wheels/")
204+
print("=" * 60)
205+
print()
171206

172207
ext_modules = [atomic_extension]
173208
cmdclass = {'build_ext': OptionalBuildExt}

setup_atomic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
module = Extension(
2222
'omnipkg.isolation.omnipkg_atomic',
2323
sources=['src/omnipkg/isolation/atomic_ops.c'],
24-
extra_compile_args=_c_args
24+
extra_compile_args=_c_args,
25+
py_limited_api=True,
2526
)
2627

2728
setup(

0 commit comments

Comments
 (0)