Skip to content

Drop capstone <6.0 compat fallbacks and require capstone >=6.0 - #354

Open
kripticni wants to merge 3 commits into
angr:masterfrom
kripticni:chore/capstone-v6-bump
Open

Drop capstone <6.0 compat fallbacks and require capstone >=6.0#354
kripticni wants to merge 3 commits into
angr:masterfrom
kripticni:chore/capstone-v6-bump

Conversation

@kripticni

Copy link
Copy Markdown
Contributor

Drop capstone <6.0 compat fallbacks and require capstone >=6.0

Per maintainer @twizmwazin's instruction on PR #353:
"If bumping capstone to 6.0, please do remove the compat code for
capstone<6. It should remain an optional dependency."

Changes:

  • arch_aarch64.py: remove hasattr() fallback, use CS_ARCH_AARCH64 directly
  • arch_s390x.py: remove hasattr() fallback, use CS_ARCH_SYSTEMZ directly
  • arch_riscv64.py: remove hasattr(CS_ARCH_RISCV) guard (exists in all >=6.0)
  • pyproject.toml: add optional capstone>=6.0.0a1 dependency

Note: uses >=6.0.0a1 because capstone has not shipped a stable 6.0.0
on PyPI yet (latest is 6.0.0a9). PEP 440 correctly orders pre-releases
before the release, so >=6.0.0 would exclude all published versions.

kripticni and others added 3 commits June 25, 2026 02:48
- arch_aarch64.py: remove hasattr(CS_ARCH_AARCH64) fallback,
  use CS_ARCH_AARCH64 directly
- arch_s390x.py: remove hasattr(CS_ARCH_SYSTEMZ) fallback,
  use CS_ARCH_SYSTEMZ directly
- arch_riscv64.py: remove hasattr(CS_ARCH_RISCV) guard
- pyproject.toml: add optional capstone>=6.0.0a1 dependency

Uses >=6.0.0a1 because capstone has not shipped a stable 6.0.0
on PyPI yet (latest is 6.0.0a9). PEP 440 correctly orders
6.0.0a9 < 6.0.0, so >=6.0.0 would exclude all released versions.

Per maintainer @twizmwazin's instruction on PR angr#353:
"If bumping capstone to 6.0, please do remove the compat code for
capstone<6. It should remain an optional dependency."
@kripticni

Copy link
Copy Markdown
Contributor Author

The ci job failures are expected. The angr/ci:3 container has capstone 5.x and the build installs angr@master which pins capstone==5.0.6. This PR needs the corresponding angr capstone bump at the same time.

The test job (archinfo pytest) passes fine as-is.

@twizmwazin

Copy link
Copy Markdown
Member

Oh, I did not realize 6.0 was not stable yet! Let's keep the compat code around so that the latest stable version is still supported. But don't close this PR, we can merge it once 6.0 is released as stable.

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