Skip to content

fix(install): fail when cryptography is unavailable - #552

Merged
joelteply merged 1 commit into
canaryfrom
codex/fail-install-on-crypto-miss
May 7, 2026
Merged

joelteply merged 1 commit into
canaryfrom
codex/fail-install-on-crypto-miss

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

  • treat cryptography as a hard install dependency because Ed25519 identity signing now requires it
  • fail install.sh immediately if pip cannot install cryptography or the final import check fails
  • keep system-python fallback only when cryptography is already importable there

Why

The first macOS clean-install run for #551 exposed a real bad state: pip install cryptography failed, install.sh still printed Installed, and the smoke test later failed at Ed25519 bootstrap. The rerun passed, so the trigger was transient, but the product behavior was wrong.

Validation

  • bash -n install.sh
  • temp HOME/BIN/SKILLS install path with AIRC_INSTALL_NO_PULL=1 AIRC_SKIP_PREREQS=1
  • git diff --check

Copilot AI review requested due to automatic review settings May 7, 2026 03:38
@joelteply
joelteply merged commit ef0332b into canary May 7, 2026
8 checks passed
@joelteply
joelteply deleted the codex/fail-install-on-crypto-miss branch May 7, 2026 03:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates install.sh to treat cryptography as a hard dependency (needed for Ed25519 identity bootstrap/signing) and to fail the installer early if cryptography cannot be installed or imported.

Changes:

  • Add a fail() helper to emit an error and exit immediately.
  • Convert cryptography venv install failures from warnings into hard failures.
  • Add a post-install import check for cryptography.hazmat.primitives.asymmetric.ed25519, with a system-Python fallback.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread install.sh
Comment on lines +550 to +557
_airc_crypto_python=""
if [ -x "$_airc_venv/bin/python" ]; then
_airc_crypto_python="$_airc_venv/bin/python"
elif [ -x "$_airc_venv/Scripts/python.exe" ]; then
_airc_crypto_python="$_airc_venv/Scripts/python.exe"
elif command -v python3 >/dev/null 2>&1; then
_airc_crypto_python="python3"
fi
Comment thread install.sh
Comment on lines 542 to 546
if "$_airc_venv_pip" install -q cryptography 2>&1 | tail -3; then
ok "cryptography installed in venv (envelope encryption ready)"
else
warn "cryptography install failed; airc will run in plaintext mode"
warn " Manual fix: $_airc_venv_pip install cryptography"
fail "cryptography install failed; airc requires it for Ed25519 signing. Manual fix: $_airc_venv_pip install cryptography"
fi
Comment thread install.sh
Comment on lines +558 to +560
if [ -z "$_airc_crypto_python" ] || ! "$_airc_crypto_python" -c "import cryptography.hazmat.primitives.asymmetric.ed25519" >/dev/null 2>&1; then
fail "cryptography is not importable after install; airc cannot bootstrap signed identity. Re-run install.sh after fixing Python/pip."
fi
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.

2 participants