Skip to content

fix(deps): cap cryptography <47 to fix SIGILL on ARM64 Apple Silicon#1324

Merged
nicoloboschi merged 1 commit intomainfrom
fix/pin-cryptography-below-47
Apr 29, 2026
Merged

fix(deps): cap cryptography <47 to fix SIGILL on ARM64 Apple Silicon#1324
nicoloboschi merged 1 commit intomainfrom
fix/pin-cryptography-below-47

Conversation

@nicoloboschi
Copy link
Copy Markdown
Collaborator

Summary

  • Pins cryptography>=46.0.6,<47 in hindsight-api-slim/pyproject.toml. cryptography 47.0.0 emits CPU instructions that aren't exposed in the ARM64 Linux VMs used by Docker Desktop and Podman (AppleHV) on Apple Silicon, causing SIGILL (exit 132) on the very first import of cryptography.hazmat.bindings._rust. See upstream illegal instruction on arm pyca/cryptography#14733.
  • Without an upper bound, our Dockerfile (which copies only pyproject.toml, not uv.lock, and runs uv sync without --locked) silently picked up 47.0.0 the moment it shipped (2026-04-24), which is why v0.5.4 containers were healthy (resolved 46.0.7) and v0.5.6 containers crash on those runtimes.

Closes #1322

Why CI didn't catch it

  • PR CI builds and smoke-tests the image on ubuntu-latest (linux/amd64) — cryptography 47.0.0 is fine on x86_64.
  • Release CI builds multi-arch (linux/amd64,linux/arm64) under QEMU and pushes both, but the smoke test that would actually start a container is commented out (release.yml:390-409, "TODO: Re-enable smoke test when disk space issue is resolved"). The arm64 binary is built and published without ever being executed.

A follow-up to re-enable the release-time smoke test (and ideally exercise the arm64 image) would prevent this class of bug in the future, but that's out of scope here.

Test plan

  • CI green (lint, type, tests, docker build)
  • Manual: pull a freshly-built v0.5.7 arm64 image under Docker Desktop on Apple Silicon and confirm python3 -c "from cryptography.hazmat.bindings._rust import openssl" succeeds (cryptography resolves to 46.0.x)
  • Manual: same on Podman AppleHV

cryptography 47.0.0 emits CPU instructions that aren't exposed in the
ARM64 Linux VMs used by Docker Desktop and Podman (AppleHV) on Apple
Silicon. Importing `cryptography.hazmat.bindings._rust` crashes with
SIGILL (exit 132), so v0.5.6 containers fail to start on those hosts.
See pyca/cryptography#14733.

The Dockerfile copies only pyproject.toml (not uv.lock) and runs
`uv sync` without --locked, so each build re-resolves to the latest
matching version. Without an upper bound, that picked up 47.0.0 once
it shipped on 2026-04-24.

Closes #1322
@nicoloboschi nicoloboschi merged commit 9025115 into main Apr 29, 2026
113 of 117 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v0.5.6 crashes with SIGILL on Apple Silicon (Podman/Docker ARM64) due to cryptography 47.0.0

1 participant