[PATCH] Add python-angr.

  • Open
  • quality assurance status badge
Details
2 participants
  • soeren
  • Troy Figiel
Owner
unassigned
Submitted by
soeren
Severity
normal
S
S
soeren wrote on 12 Feb 15:55 +0100
(address . guix-patches@gnu.org)
cover.1707749005.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

This patchset adds a package for angr https://angr.io/. angr is a
binary analysis framework that implements different binary analysis
techniques, such as symbolic execution. Symbolic execution is an active
area of computer science research. This package is part of an ongoing
effort to package symbolic execution tools in Guix, thereby easing the
creation of computational environments for reproducible research in this
domain [1], [2], [3].

angr comes with an extensive test suite, which takes a while to run.
However, I would argue that enabling this test suite is worthwhile as it
allowed me to discover two upstream bugs in capstone and angr which I
fixed and backported as port of the patchset [4], [5]. angr also
requires unicorn 2.X hence I've included (and revised) an existing patch
updating unicorn [6].

Feedback is more than welcome!


Sören Tempel (13):
gnu: Add python-itanium-demangle.
gnu: Add python-keystone-engine.
gnu: Add python-mulpyplexer.
gnu: Add python-nampa.
gnu: Add python-rpyc.
gnu: Add python-pysmt.
gnu: Add python-claripy.
gnu: Add python-archinfo.
gnu: Add python-pyvex.
gnu: Add python-cle.
gnu: Add python-ailment.
gnu: capstone: Backport upstream fix for Python bindings.
gnu: Add python-angr.

c4droid (1):
gnu: unicorn: Update to 2.0.1.post1.

gnu/local.mk | 6 +
gnu/packages/emulators.scm | 119 +-----
gnu/packages/engineering.scm | 2 +
.../python-angr-addition-type-error.patch | 18 +
.../patches/python-angr-check-exec-deps.patch | 93 ++++
...python-capstone-fix-python-constants.patch | 84 ++++
.../python-pysmt-fix-pow-return-type.patch | 258 +++++++++++
...-pysmt-fix-smtlib-serialization-test.patch | 86 ++++
.../python-pyvex-remove-angr-dependency.patch | 80 ++++
gnu/packages/python-xyz.scm | 400 ++++++++++++++++++
10 files changed, 1047 insertions(+), 99 deletions(-)
create mode 100644 gnu/packages/patches/python-angr-addition-type-error.patch
create mode 100644 gnu/packages/patches/python-angr-check-exec-deps.patch
create mode 100644 gnu/packages/patches/python-capstone-fix-python-constants.patch
create mode 100644 gnu/packages/patches/python-pysmt-fix-pow-return-type.patch
create mode 100644 gnu/packages/patches/python-pysmt-fix-smtlib-serialization-test.patch
create mode 100644 gnu/packages/patches/python-pyvex-remove-angr-dependency.patch


base-commit: 179bb57d2532ee6b81791e078b0f782cbf88cb84
S
S
soeren wrote on 12 Feb 15:58 +0100
[PATCH] gnu: Add python-itanium-demangle.
(address . 69074@debbugs.gnu.org)
19ef0993fd8891d02402943609f70de73e0b233a.1707749005.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-itanium-demangle): New variable.
---
gnu/packages/python-xyz.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)

Toggle diff (49 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index c68b17b0ab..e630bdb6a6 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -146,6 +146,7 @@
;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2023 Attila Lendvai <attila@lendvai.name>
;;; Copyright © 2023, 2024 Troy Figiel <troy@troyfigiel.com>
+;;; Copyright © 2024 Sören Tempel <soeren@soeren-tempel.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -32302,6 +32303,36 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-itanium-demangle
+ (package
+ (name "python-itanium-demangle")
+ (version "1.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/whitequark/python-itanium_demangler")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1q47aqm5z3db6pasdzw05d6236vnb8hnapfy88fcmn9dr5ym98r3"))))
+ (build-system pyproject-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (with-directory-excursion "tests"
+ (invoke "python" "-m" "unittest"))))))))
+ (home-page "https://github.com/whitequark/python-itanium_demangler")
+ (synopsis "Pure Python Itanium C++ ABI demangler")
+ (description
+ "This Python module provides an implementation of the Itanium C++
+ABI symbol mangling language. The demangler generates an abstract
+syntax tree from mangled symbols, which can be used for directly
+extracting type information.")
+ (license license:bsd-0)))
+
(define-public python-peachpy
;; There is no tag in this repo.
(let ((commit "913d74c35a6b1d330e90bfc055208ce5b06b35a0")
S
S
soeren wrote on 12 Feb 15:58 +0100
[PATCH] gnu: Add python-keystone-engine.
(address . 69074@debbugs.gnu.org)
ac6b9eca583c61e7d9a6467caf6306f77b9543b7.1707749005.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-keystone-engine): New variable.
---
gnu/packages/python-xyz.scm | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

Toggle diff (33 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index e630bdb6a6..e4f6483f70 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32303,6 +32303,28 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-keystone-engine
+ (package
+ (name "python-keystone-engine")
+ (version "0.9.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "keystone-engine" version))
+ (sha256
+ (base32 "1xahdr6bh3dw5swrc2r8kqa8ljhqlb7k2kxv5mrw5rhcmcnzcyig"))))
+ (native-inputs (list cmake))
+ (build-system pyproject-build-system)
+ (home-page "https://www.keystone-engine.org")
+ (synopsis
+ "Lightweight multi-platform, multi-architecture assembler framework")
+ (description
+ "Keystone is a lightweight multi-platform, multi-architecture
+assembler framework. It supports a wide-range of different architectures
+and offers an intuitive architecture-neutral API for interacting with
+assembly for these architectures.")
+ (license license:gpl2)))
+
(define-public python-itanium-demangle
(package
(name "python-itanium-demangle")
S
S
soeren wrote on 12 Feb 15:58 +0100
[PATCH] gnu: Add python-mulpyplexer.
(address . 69074@debbugs.gnu.org)
5c6b13148d8a1937a5d336e09196de34d6e20e4f.1707749005.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-mulpyplexer): New variable.
---
gnu/packages/python-xyz.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

Toggle diff (31 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index e4f6483f70..20b7a17fd2 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32303,6 +32303,26 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-mulpyplexer
+ (package
+ (name "python-mulpyplexer")
+ (version "0.09")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "mulpyplexer" version))
+ (sha256
+ (base32 "0c5xzci1djy1yi9hxxh8g67l6ms8r7ad7ja20pv8hfbdysdrwkhl"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:tests? #f)) ;no tests
+ (home-page "https://github.com/zardus/mulpyplexer/")
+ (synopsis "Multiplexes interactions with lists of Python objects")
+ (description "This module provides utilities for multiplexing
+interactions with lists of Python objects.")
+ (license license:bsd-3)))
+
(define-public python-keystone-engine
(package
(name "python-keystone-engine")
S
S
soeren wrote on 12 Feb 15:58 +0100
[PATCH] gnu: Add python-nampa.
(address . 69074@debbugs.gnu.org)
7b73230899b3c2c8ef8ac60fa74f0bf0601b5f26.1707749005.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-nampa): New variable.
---
gnu/packages/python-xyz.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

Toggle diff (31 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 20b7a17fd2..f94b0056f0 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32303,6 +32303,26 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-nampa
+ (package
+ (name "python-nampa")
+ (version "0.1.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "nampa" version))
+ (sha256
+ (base32 "0k6cq2gflpkm40qhgqbbcjmq5lq589c15bmk567qyh3d08062hvd"))))
+ (build-system pyproject-build-system)
+ (propagated-inputs (list python-future))
+ (home-page "https://github.com/thebabush/nampa")
+ (synopsis "Python implementation of IDA Pro's FLIRT technology")
+ (description
+ "This Python module implements the Fast Library Identification
+and Recognition Technology (FLIRT). This technology is useful for identifying
+common library subroutines in disassembled binaries.")
+ (license license:lgpl3)))
+
(define-public python-mulpyplexer
(package
(name "python-mulpyplexer")
S
S
soeren wrote on 12 Feb 15:58 +0100
[PATCH] gnu: Add python-rpyc.
(address . 69074@debbugs.gnu.org)
7a7224e5bb8ddd664843cc0e1f6018256727606f.1707749005.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-rpyc): New variable.
---
gnu/packages/python-xyz.scm | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)

Toggle diff (37 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index f94b0056f0..5fe5c0d60a 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32303,6 +32303,32 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-rpyc
+ (package
+ (name "python-rpyc")
+ (version "5.3.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "rpyc" version))
+ (sha256
+ (base32 "0lmzrxc6f0sg6k0yvi6f2z44dkhiankdadv44sp1ibwzhxs328zj"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:tests? #f)) ;tests require network
+ (propagated-inputs (list python-hatchling python-plumbum))
+ (home-page "https://github.com/tomerfiliba-org/rpyc")
+ (synopsis
+ "Remote Python Call (RPyC) is a symmetric distributed computing library")
+ (description
+ "This Python module enables remote procedure calls, clustering, and
+distributed-computing. For this purpose, it makes use of object-proxying, a technique
+that employs python's dynamic nature, to overcome the physical boundaries between
+processes and computers, so that remote objects can be manipulated as if they
+were local.")
+ (license license:expat)))
+
(define-public python-nampa
(package
(name "python-nampa")
S
S
soeren wrote on 12 Feb 15:58 +0100
[PATCH] gnu: Add python-claripy.
(address . 69074@debbugs.gnu.org)
f1ad8234b4517fe8a31c04291db4d25644d327d4.1707749005.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-claripy): New variable.
---
gnu/packages/python-xyz.scm | 38 +++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

Toggle diff (49 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 055f7ea553..6c73948dd8 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32303,6 +32303,44 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-claripy
+ (package
+ (name "python-claripy")
+ (version "9.2.46")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/angr/claripy")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0nmawpi1596d9plafrp2db36cjsidy2fagkzkja51jwlx2m1ngai"))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ (substitute* "setup.cfg"
+ ;; Relax the z3 version constraint.
+ ;; See https://github.com/angr/claripy/commit/d1fe2df
+ (("z3-solver==4.10.2.0")
+ ""))))))
+ (build-system pyproject-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (with-directory-excursion "tests"
+ (invoke "python" "-m" "unittest"))))))))
+ (propagated-inputs (list python-cachetools python-decorator python-pysmt
+ z3))
+ (home-page "https://github.com/angr/claripy")
+ (synopsis "Abstraction layer for constraint solvers")
+ (description
+ "This Python module provides an abstraction layer for interacting
+with constraint solvers. Specifically, it is intended to be used with
+SMT solvers and is built on top of the Z3 solver.")
+ (license license:bsd-2)))
+
(define-public python-pysmt
(package
(name "python-pysmt")
S
S
soeren wrote on 12 Feb 15:58 +0100
[PATCH] gnu: Add python-pysmt.
(address . 69074@debbugs.gnu.org)
121fb91c6293f9de7529be4c82fc010c3b83730a.1707749005.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-pysmt): New variable.
---
gnu/local.mk | 2 +
.../python-pysmt-fix-pow-return-type.patch | 258 ++++++++++++++++++
...-pysmt-fix-smtlib-serialization-test.patch | 86 ++++++
gnu/packages/python-xyz.scm | 34 +++
4 files changed, 380 insertions(+)
create mode 100644 gnu/packages/patches/python-pysmt-fix-pow-return-type.patch
create mode 100644 gnu/packages/patches/python-pysmt-fix-smtlib-serialization-test.patch

Toggle diff (414 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index fbdb285695..1946fdcbb6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1925,6 +1925,8 @@ dist_patch_DATA = \
%D%/packages/patches/python-pyan3-fix-absolute-path-bug.patch \
%D%/packages/patches/python-pyan3-fix-positional-arguments.patch \
%D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch \
+ %D%/packages/patches/python-pysmt-fix-pow-return-type.patch \
+ %D%/packages/patches/python-pysmt-fix-smtlib-serialization-test.patch \
%D%/packages/patches/python-pytorch-runpath.patch \
%D%/packages/patches/python-pytorch-system-libraries.patch \
%D%/packages/patches/python-pytorch-1.9.0-system-libraries.patch \
diff --git a/gnu/packages/patches/python-pysmt-fix-pow-return-type.patch b/gnu/packages/patches/python-pysmt-fix-pow-return-type.patch
new file mode 100644
index 0000000000..0ec2d41b3c
--- /dev/null
+++ b/gnu/packages/patches/python-pysmt-fix-pow-return-type.patch
@@ -0,0 +1,258 @@
+Backport of an upstream patch which fixes a test failure with our
+packaged version of the Z3 SMT solver.
+
+Taken from: https://github.com/pysmt/pysmt/commit/f522e8cd8f3e75ff85f5eae29b427e18a6701859
+
+diff --git a/pysmt/formula.py b/pysmt/formula.py
+index ea4b46c..6cb9cbf 100644
+--- a/pysmt/formula.py
++++ b/pysmt/formula.py
+@@ -252,11 +252,7 @@ class FormulaManager(object):
+
+ if base.is_constant():
+ val = base.constant_value() ** exponent.constant_value()
+- if base.is_constant(types.REAL):
+- return self.Real(val)
+- else:
+- assert base.is_constant(types.INT)
+- return self.Int(val)
++ return self.Real(val)
+ return self.create_node(node_type=op.POW, args=(base, exponent))
+
+ def Div(self, left, right):
+diff --git a/pysmt/logics.py b/pysmt/logics.py
+index ef88dd6..9dc45b1 100644
+--- a/pysmt/logics.py
++++ b/pysmt/logics.py
+@@ -495,6 +495,12 @@ QF_NRA = Logic(name="QF_NRA",
+ real_arithmetic=True,
+ linear=False)
+
++QF_NIRA = Logic(name="QF_NIRA",
++ description="""Quantifier-free integer and real arithmetic.""",
++ quantifier_free=True,
++ integer_arithmetic=True,
++ real_arithmetic=True,
++ linear=False)
+
+ QF_RDL = Logic(name="QF_RDL",
+ description=\
+@@ -619,41 +625,41 @@ QF_AUFBVLIRA = Logic(name="QF_AUFBVLIRA",
+ AUTO = Logic(name="Auto",
+ description="Special logic used to indicate that the logic to be used depends on the formula.")
+
+-SMTLIB2_LOGICS = frozenset([ AUFLIA,
+- AUFLIRA,
+- AUFNIRA,
+- ALIA,
+- LRA,
+- LIA,
+- NIA,
+- NRA,
+- UFLRA,
+- UFNIA,
+- UFLIRA,
+- QF_ABV,
+- QF_AUFBV,
+- QF_AUFLIA,
+- QF_ALIA,
+- QF_AX,
+- QF_BV,
+- QF_IDL,
+- QF_LIA,
+- QF_LRA,
+- QF_NIA,
+- QF_NRA,
+- QF_RDL,
+- QF_UF,
+- QF_UFBV ,
+- QF_UFIDL,
+- QF_UFLIA,
+- QF_UFLRA,
+- QF_UFNRA,
+- QF_UFNIA,
+- QF_UFLIRA,
+- QF_SLIA
+- ])
+-
+-LOGICS = SMTLIB2_LOGICS | frozenset([ QF_BOOL, BOOL, QF_AUFBVLIRA])
++SMTLIB2_LOGICS = frozenset([AUFLIA,
++ AUFLIRA,
++ AUFNIRA,
++ ALIA,
++ LRA,
++ LIA,
++ NIA,
++ NRA,
++ UFLRA,
++ UFNIA,
++ UFLIRA,
++ QF_ABV,
++ QF_AUFBV,
++ QF_AUFLIA,
++ QF_ALIA,
++ QF_AX,
++ QF_BV,
++ QF_IDL,
++ QF_LIA,
++ QF_LRA,
++ QF_NIA,
++ QF_NRA,
++ QF_RDL,
++ QF_UF,
++ QF_UFBV,
++ QF_UFIDL,
++ QF_UFLIA,
++ QF_UFLRA,
++ QF_UFNRA,
++ QF_UFNIA,
++ QF_UFLIRA,
++ QF_SLIA
++ ])
++
++LOGICS = SMTLIB2_LOGICS | frozenset([QF_BOOL, BOOL, QF_AUFBVLIRA, QF_NIRA])
+
+ QF_LOGICS = frozenset(_l for _l in LOGICS if _l.quantifier_free)
+
+@@ -668,8 +674,8 @@ PYSMT_LOGICS = frozenset([QF_BOOL, QF_IDL, QF_LIA, QF_LRA, QF_RDL, QF_UF, QF_UFI
+ QF_BV, QF_UFBV,
+ QF_ABV, QF_AUFBV, QF_AUFLIA, QF_ALIA, QF_AX,
+ QF_AUFBVLIRA,
+- QF_NRA, QF_NIA, UFBV, BV,
+- ])
++ QF_NRA, QF_NIA, QF_NIRA, UFBV, BV,
++ ])
+
+ # PySMT Logics includes additional features:
+ # - constant arrays: QF_AUFBV becomes QF_AUFBV*
+@@ -697,7 +703,6 @@ for l in PYSMT_LOGICS:
+ ext_logics.add(nl)
+
+
+-
+ LOGICS = LOGICS | frozenset(ext_logics)
+ PYSMT_LOGICS = PYSMT_LOGICS | frozenset(ext_logics)
+
+diff --git a/pysmt/solvers/z3.py b/pysmt/solvers/z3.py
+index 3fb42b9..210b771 100644
+--- a/pysmt/solvers/z3.py
++++ b/pysmt/solvers/z3.py
+@@ -595,6 +595,8 @@ class Z3Converter(Converter, DagWalker):
+ None, None,
+ 0, None,
+ expr.ast)
++ print("Z3: SMTLIB")
++ print(s)
+ stream_in = StringIO(s)
+ r = parser.get_script(stream_in).get_last_formula(self.mgr)
+ key = (askey(expr), None)
+diff --git a/pysmt/test/examples.py b/pysmt/test/examples.py
+index 73455ee..b653185 100644
+--- a/pysmt/test/examples.py
++++ b/pysmt/test/examples.py
+@@ -898,12 +898,12 @@ def get_full_example_formulae(environment=None):
+ logic=pysmt.logics.QF_NRA
+ ),
+
+- Example(hr="((p ^ 2) = 0)",
+- expr=Equals(Pow(p, Int(2)), Int(0)),
++ Example(hr="((p ^ 2) = 0.0)",
++ expr=Equals(Pow(p, Int(2)), Real(0)),
+ is_valid=False,
+ is_sat=True,
+- logic=pysmt.logics.QF_NIA
+- ),
++ logic=pysmt.logics.QF_NIRA
++ ),
+
+ Example(hr="((r ^ 2.0) = 0.0)",
+ expr=Equals(Pow(r, Real(2)), Real(0)),
+diff --git a/pysmt/test/test_back.py b/pysmt/test/test_back.py
+index bceb45b..7a0ad63 100644
+--- a/pysmt/test/test_back.py
++++ b/pysmt/test/test_back.py
+@@ -55,10 +55,10 @@ class TestBasic(TestCase):
+ res = msat.converter.back(term)
+ self.assertFalse(f == res)
+
+- def do_back(self, solver_name, z3_string_buffer=False):
++ def do_back(self, solver_name, via_smtlib=False):
+ for formula, _, _, logic in get_example_formulae():
+ if logic.quantifier_free:
+- if logic.theory.custom_type and z3_string_buffer:
++ if logic.theory.custom_type and via_smtlib:
+ # Printing of declare-sort from Z3 is not conformant
+ # with the SMT-LIB. We might consider extending our
+ # parser.
+@@ -67,7 +67,7 @@ class TestBasic(TestCase):
+ s = Solver(name=solver_name, logic=logic)
+ term = s.converter.convert(formula)
+ if solver_name == "z3":
+- if z3_string_buffer:
++ if via_smtlib:
+ res = s.converter.back_via_smtlib(term)
+ else:
+ res = s.converter.back(term)
+@@ -84,8 +84,8 @@ class TestBasic(TestCase):
+
+ @skipIfSolverNotAvailable("z3")
+ def test_z3_back_formulae(self):
+- self.do_back("z3", z3_string_buffer=False)
+- self.do_back("z3", z3_string_buffer=True)
++ self.do_back("z3", via_smtlib=True)
++ self.do_back("z3", via_smtlib=False)
+
+
+ if __name__ == '__main__':
+diff --git a/pysmt/type_checker.py b/pysmt/type_checker.py
+index b700fcf..7ce05aa 100644
+--- a/pysmt/type_checker.py
++++ b/pysmt/type_checker.py
+@@ -33,6 +33,8 @@ class SimpleTypeChecker(walkers.DagWalker):
+
+ def __init__(self, env=None):
+ walkers.DagWalker.__init__(self, env=env)
++ # Return None if the type cannot be computed rather than
++ # raising an exception.
+ self.be_nice = False
+
+ def _get_key(self, formula, **kwargs):
+@@ -42,7 +44,7 @@ class SimpleTypeChecker(walkers.DagWalker):
+ """ Returns the pysmt.types type of the formula """
+ res = self.walk(formula)
+ if not self.be_nice and res is None:
+- raise PysmtTypeError("The formula '%s' is not well-formed" \
++ raise PysmtTypeError("The formula '%s' is not well-formed"
+ % str(formula))
+ return res
+
+@@ -114,7 +116,7 @@ class SimpleTypeChecker(walkers.DagWalker):
+
+ def walk_bv_comp(self, formula, args, **kwargs):
+ # We check that all children are BV and the same size
+- a,b = args
++ a, b = args
+ if a != b or (not a.is_bv_type()):
+ return None
+ return BVType(1)
+@@ -187,7 +189,7 @@ class SimpleTypeChecker(walkers.DagWalker):
+ if args[0].is_bool_type():
+ raise PysmtTypeError("The formula '%s' is not well-formed."
+ "Equality operator is not supported for Boolean"
+- " terms. Use Iff instead." \
++ " terms. Use Iff instead."
+ % str(formula))
+ elif args[0].is_bv_type():
+ return self.walk_bv_to_bool(formula, args)
+@@ -324,10 +326,7 @@ class SimpleTypeChecker(walkers.DagWalker):
+ def walk_pow(self, formula, args, **kwargs):
+ if args[0] != args[1]:
+ return None
+- # Exponent must be positive for INT
+- if args[0].is_int_type() and formula.arg(1).constant_value() < 0 :
+- return None
+- return args[0]
++ return REAL
+
+ # EOC SimpleTypeChecker
+
diff --git a/gnu/packages/patches/python-pysmt-fix-smtlib-serialization-test.patch b/gnu/packages/patches/python-pysmt-fix-smtlib-serialization-test.patch
new file mode 100644
index 0000000000..eee555f807
--- /dev/null
+++ b/gnu/packages/patches/python-pysmt-fix-smtlib-serialization-test.patch
@@ -0,0 +1,86 @@
+Backport of an upstream patch fixing a test suite failure.
+
+Taken from: https://github.com/pysmt/pysmt/commit/a246669a487aff69f5da34570ef867841d18508a
+
+diff --git a/pysmt/test/smtlib/test_parser_examples.py b/pysmt/test/smtlib/test_parser_examples.py
+index cca4194..c0852be 100644
+--- a/pysmt/test/smtlib/test_parser_examples.py
++++ b/pysmt/test/smtlib/test_parser_examples.py
+@@ -29,6 +29,7 @@ from pysmt.shortcuts import Iff
+ from pysmt.shortcuts import read_smtlib, write_smtlib, get_env
+ from pysmt.exceptions import PysmtSyntaxError
+
++
+ class TestSMTParseExamples(TestCase):
+
+ def test_parse_examples(self):
+@@ -41,7 +42,6 @@ class TestSMTParseExamples(TestCase):
+ buf = StringIO()
+ script_out = smtlibscript_from_formula(f_out)
+ script_out.serialize(outstream=buf)
+- #print(buf)
+
+ buf.seek(0)
+ parser = SmtLibParser()
+@@ -49,7 +49,6 @@ class TestSMTParseExamples(TestCase):
+ f_in = script_in.get_last_formula()
+ self.assertEqual(f_in.simplify(), f_out.simplify())
+
+-
+ @skipIfNoSolverForLogic(logics.QF_BV)
+ def test_parse_examples_bv(self):
+ """For BV we represent a superset of the operators defined in SMT-LIB.
+@@ -108,7 +107,18 @@ class TestSMTParseExamples(TestCase):
+ self.assertValid(Iff(f_in, f_out), f_in.serialize())
+
+ def test_dumped_logic(self):
+- # Dumped logic matches the logic in the example
++ # Dumped logic matches the logic in the example.
++ #
++ # There are a few cases where we use a logic
++ # that does not exist in SMT-LIB, and the SMT-LIB
++ # serialization logic will find a logic that
++ # is more expressive. We need to adjust the test
++ # for those cases (see rewrite dict below).
++ rewrite = {
++ logics.QF_BOOL: logics.QF_UF,
++ logics.BOOL: logics.LRA,
++ logics.QF_NIRA: logics.AUFNIRA,
++ }
+ fs = get_example_formulae()
+
+ for (f_out, _, _, logic) in fs:
+@@ -121,14 +131,9 @@ class TestSMTParseExamples(TestCase):
+ for cmd in script_in:
+ if cmd.name == "set-logic":
+ logic_in = cmd.args[0]
+- if logic == logics.QF_BOOL:
+- self.assertEqual(logic_in, logics.QF_UF)
+- elif logic == logics.BOOL:
+- self.assertEqual(logic_in, logics.LRA)
+- else:
+- self.assertEqual(logic_in, logic, script_in)
++ self.assertEqual(logic_in, rewrite.get(logic, logic))
+ break
+- else: # Loops exited normally
++ else: # Loops exited normally
+ print("-"*40)
+ print(script_in)
+
+@@ -136,7 +141,7 @@ class TestSMTParseExamples(TestCase):
+ fs = get_example_formulae()
+
+ fdi, tmp_fname = mkstemp()
+- os.close(fdi) # Close initial file descriptor
++ os.close(fdi) # Close initial file descriptor
+ for (f_out, _, _, _) in fs:
+ write_smtlib(f_out, tmp_fname)
+ # with open(tmp_fname) as fin:
+@@ -197,7 +202,6 @@ class TestSMTParseExamples(TestCase):
+ f_in = script.get_last_formula()
+ self.assertSat(f_in)
+
+-
+ def test_int_promotion_define_fun(self):
+ script = """
+ (define-fun x () Int 8)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 5fe5c0d60a..055f7ea553 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32303,6 +32303,40 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-pysmt
+ (package
+ (name "python-pysmt")
+ (version "0.9.5")
+ (source
+ (origin
+ (method git-fetch)
+ (patches (search-patches "python-pysmt-fix-pow-return-type.patch"
+ "python-pysmt-fix-smtlib-serialization-test.patch"))
+ (uri (git-reference
+ (url "https://github.com/pysmt/pysmt")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0hrxv23y5ip4ijfx5pvbwc2fq4zg9jz42wc9zqgqm0g0mjc9ckvh"))))
+ (build-system pyproject-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (setenv "PYSMT_SOLVER" "z3")
+ (invoke "python" "-m" "pytest" "pysmt" "-v")))))))
+ (native-inputs (list python-pytest))
+ (propagated-inputs (list z3))
+ (home-page "https://github.com/pysmt/pysmt")
+ (synopsis
+ "Solver-agnostic library for SMT formula manipulation and solving")
+ (description
+ "This Python module provides a solver-agnostic abstraction for
+working with Satisfiability Modulo Theory (SMT) formulas For example,
+it allows manipulation and solving such formulas.")
+ (license license:asl2.0)))
+
(define-public python-rpyc
(package
(name "python-rpyc")
S
S
soeren wrote on 12 Feb 15:58 +0100
[PATCH] gnu: Add python-archinfo.
(address . 69074@debbugs.gnu.org)
c1ec2100fa315f637402168a5377c1139ace6521.1707749005.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-archinfo): New variable.
---
gnu/packages/python-xyz.scm | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)

Toggle diff (45 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 6c73948dd8..ba3e85fd2d 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -189,6 +189,7 @@ (define-module (gnu packages python-xyz)
#:use-module (gnu packages djvu)
#:use-module (gnu packages docker)
#:use-module (gnu packages documentation)
+ #:use-module (gnu packages engineering)
#:use-module (gnu packages enchant)
#:use-module (gnu packages file)
#:use-module (gnu packages fonts)
@@ -32303,6 +32304,32 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-archinfo
+ (package
+ (name "python-archinfo")
+ (version "9.2.46")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "archinfo" version))
+ (sha256
+ (base32 "037xfq3wcf8ngayxz9623l4646m780v2102mfbygpzbkkjha1966"))))
+ (build-system pyproject-build-system)
+ (propagated-inputs (list python-capstone python-keystone-engine))
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (with-directory-excursion "tests"
+ (invoke "python" "-m" "unittest"))))))))
+ (home-page "https://github.com/angr/archinfo")
+ (synopsis "Extract architecture-specific information from binaries")
+ (description
+ "Collection of classes that contain architecture-specific information
+information. Useful for cross-architecture tools (such as @code{python-pyvex}).")
+ (license license:bsd-2)))
+
(define-public python-claripy
(package
(name "python-claripy")
S
S
soeren wrote on 12 Feb 15:58 +0100
[PATCH] gnu: Add python-pyvex.
(address . 69074@debbugs.gnu.org)
022636047a91685578f894adf01c344e0cdcbd54.1707749005.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-pyvex): New variable.
---
gnu/local.mk | 1 +
.../python-pyvex-remove-angr-dependency.patch | 80 +++++++++++++++++++
gnu/packages/python-xyz.scm | 35 ++++++++
3 files changed, 116 insertions(+)
create mode 100644 gnu/packages/patches/python-pyvex-remove-angr-dependency.patch

Toggle diff (144 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 1946fdcbb6..ecbae4bb53 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1930,6 +1930,7 @@ dist_patch_DATA = \
%D%/packages/patches/python-pytorch-runpath.patch \
%D%/packages/patches/python-pytorch-system-libraries.patch \
%D%/packages/patches/python-pytorch-1.9.0-system-libraries.patch \
+ %D%/packages/patches/python-pyvex-remove-angr-dependency.patch \
%D%/packages/patches/python-robotframework-atest.patch \
%D%/packages/patches/python-robotframework-source-date-epoch.patch \
%D%/packages/patches/python-robotframework-sshlibrary-rf5-compat.patch \
diff --git a/gnu/packages/patches/python-pyvex-remove-angr-dependency.patch b/gnu/packages/patches/python-pyvex-remove-angr-dependency.patch
new file mode 100644
index 0000000000..dccf22bbc6
--- /dev/null
+++ b/gnu/packages/patches/python-pyvex-remove-angr-dependency.patch
@@ -0,0 +1,80 @@
+This patch removes the angr dependency from the pyvex these, thus
+resolving a circular dependency (as angr depends on pyvex). This
+patch has been taken from upstream.
+
+This patch is a squashed version of the following upstream patches:
+
+* https://github.com/angr/pyvex/commit/61fb26f223a8d8a276b702d2448a12e02c5c9c6b
+* https://github.com/angr/pyvex/commit/a1fb2a4d0826b0e43bd8bbdd00b6db032643ec95
+
+diff --git a/tests/test_spotter.py b/tests/test_spotter.py
+index 9271ccd..bed7dd4 100644
+--- a/tests/test_spotter.py
++++ b/tests/test_spotter.py
+@@ -1,6 +1,5 @@
+ import os
+
+-import angr
+ import archinfo
+
+ import pyvex
+@@ -98,53 +97,28 @@ class CortexSpotter(GymratLifter):
+ register(CortexSpotter, "ARMEL")
+
+
+-def test_full_binary():
+- p = angr.Project(
+- os.path.join(test_location, "armel", "RTOSDemo.axf.issue_685"),
+- arch="ARMEL",
+- auto_load_libs=False,
+- )
+- st = p.factory.call_state(0x000013CE + 1)
+- b = st.block().vex
+- simgr = p.factory.simulation_manager(st)
+- simgr.step()
+- assert b.jumpkind == "Ijk_Sys_syscall"
+- assert simgr.active[0].regs.ip_at_syscall.args[0] == 0x13FB
+-
+-
+ def test_tmrs():
+- test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../binaries/tests"))
+- p = angr.Project(
+- os.path.join(test_location, "armel", "helloworld"),
+- arch="ARMEL",
+- auto_load_libs=False,
+- )
++ arch = archinfo.arch_from_id("ARMEL")
+ ins = b"\xef\xf3\x08\x82"
+- b = pyvex.block.IRSB(ins, 1, p.arch)
++ b = pyvex.block.IRSB(ins, 1, arch)
+ assert b.jumpkind == "Ijk_Boring"
+ assert type(b.statements[1].data) == pyvex.expr.Get
+- assert p.arch.register_names.get(b.statements[1].data.offset, "") == "sp"
++ assert arch.register_names.get(b.statements[1].data.offset, "") == "sp"
+ assert type(b.statements[2]) == pyvex.stmt.Put
+
+
+ def test_tmsr():
+- test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../binaries/tests"))
+- p = angr.Project(
+- os.path.join(test_location, "armel", "helloworld"),
+- arch="ARMEL",
+- auto_load_libs=False,
+- )
++ arch = archinfo.arch_from_id("ARMEL")
+ inss = b"\x82\xf3\x08\x88"
+- b = pyvex.block.IRSB(inss, 1, p.arch, opt_level=3)
++ b = pyvex.block.IRSB(inss, 1, arch, opt_level=3)
+ assert b.jumpkind == "Ijk_Boring"
+ assert type(b.statements[1].data) == pyvex.expr.Get
+- assert p.arch.register_names.get(b.statements[1].data.offset, "") == "r2"
++ assert arch.register_names.get(b.statements[1].data.offset, "") == "r2"
+ assert type(b.statements[2]) == pyvex.stmt.Put
+
+
+ if __name__ == "__main__":
+ test_basic()
+ test_embedded()
+- test_full_binary()
+ test_tmrs()
+ test_tmsr()
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ba3e85fd2d..d46963c481 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32304,6 +32304,41 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-pyvex
+ (package
+ (name "python-pyvex")
+ (version "9.2.46")
+ (source
+ (origin
+ (method url-fetch)
+ (patches (search-patches "python-pyvex-remove-angr-dependency.patch"))
+ (uri (pypi-uri "pyvex" version))
+ (sha256
+ (base32 "1v64rn7gxy6fg065bgsy38z6r494k5ri5r6sn4g08hjj32ihx1ka"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:phases #~(modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (with-directory-excursion "tests"
+ (invoke "python" "-m" "unittest")))))
+
+ (add-before 'build 'set-cc-native
+ (lambda _
+ (setenv "CC" "gcc")
+ (setenv "CC_NATIVE" "gcc"))))))
+ (propagated-inputs (list python-archinfo python-bitstring python-cffi))
+ (home-page "https://github.com/angr/pyvex")
+ (synopsis "Python interface to libVEX and VEX IR")
+ (description
+ "This package provides a Python interface the libVEX and VEX IR.
+VEX is the intermediate representation (also known as intermediate
+language) used by the Valgrind analysis tool. As such, VEX is designed
+to enable all kinds of binary analysis tasks.")
+ (license license:bsd-2)))
+
(define-public python-archinfo
(package
(name "python-archinfo")
S
S
soeren wrote on 12 Feb 15:58 +0100
[PATCH] gnu: Add python-cle.
(address . 69074@debbugs.gnu.org)
e095b802e1762753a03b1d3199d68f127ca71a93.1707749005.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-cle): New variable.
---
gnu/packages/python-xyz.scm | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)

Toggle diff (45 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index d46963c481..6ab83b7dc7 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32304,6 +32304,31 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-cle
+ (package
+ (name "python-cle")
+ (version "9.2.46")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "cle" version))
+ (sha256
+ (base32 "0mswv9gd2p2ws7zfsshqv5ybbj27wkdwakdcknq4vsrx9ry9k4yc"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:tests? #f))
+ (propagated-inputs (list python-pefile python-pyelftools python-pyvex
+ python-sortedcontainers))
+ (native-inputs (list python-cffi))
+ (home-page "https://github.com/angr/cle")
+ (synopsis "Python loader for binaries and their associated libraries")
+ (description
+ "CLE loads binaries and their associated libraries, resolves
+imports and provides an abstraction of process memory the same way as if
+it was loader by the operating system's loader.")
+ (license license:bsd-2)))
+
(define-public python-pyvex
(package
(name "python-pyvex")
@@ -32325,7 +32350,7 @@ (define-public python-pyvex
(with-directory-excursion "tests"
(invoke "python" "-m" "unittest")))))
- (add-before 'build 'set-cc-native
+ (add-before 'build 'set-cc
(lambda _
(setenv "CC" "gcc")
(setenv "CC_NATIVE" "gcc"))))))
S
S
soeren wrote on 12 Feb 15:58 +0100
[PATCH] gnu: Add python-ailment.
(address . 69074@debbugs.gnu.org)
67a4d4dfb737f0819fa3a7cdceec804904921bee.1707749005.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-ailment): New variable.
---
gnu/packages/python-xyz.scm | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)

Toggle diff (37 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 6ab83b7dc7..92c08020fb 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32304,6 +32304,32 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-ailment
+ (package
+ (name "python-ailment")
+ (version "9.2.46")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "ailment" version))
+ (sha256
+ (base32 "073fcssbjis1ckwv2w0dcz2dfl6715bj4d4qdhspajj911mvng2f"))))
+ (build-system pyproject-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (with-directory-excursion "tests"
+ (invoke "python" "-m" "unittest"))))))))
+ (home-page "https://github.com/angr/ailment")
+ (synopsis "The angr intermediate language")
+ (description
+ "This Python module implements an @acronym{IL, Intermediate Language},
+also known as @acronym{IR, Intermediate Representation}, used by the angr
+binary analysis platform.")
+ (license license:bsd-2)))
+
(define-public python-cle
(package
(name "python-cle")
S
S
soeren wrote on 12 Feb 15:58 +0100
[PATCH] gnu: capstone: Backport upstream fix for Python bindings.
(address . 69074@debbugs.gnu.org)
efca3e3eabb1b9e6642ace59d388fba7fe745fdb.1707749005.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/engineering.scm (capstone): New patch.
---
gnu/local.mk | 1 +
gnu/packages/engineering.scm | 2 +
...python-capstone-fix-python-constants.patch | 84 +++++++++++++++++++
3 files changed, 87 insertions(+)
create mode 100644 gnu/packages/patches/python-capstone-fix-python-constants.patch

Toggle diff (122 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index ecbae4bb53..ce0f1994c5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1901,6 +1901,7 @@ dist_patch_DATA = \
%D%/packages/patches/python-3-hurd-configure.patch \
%D%/packages/patches/python-aionotify-0.2.0-py3.8.patch \
%D%/packages/patches/python-argcomplete-1.11.1-fish31.patch \
+ %D%/packages/patches/python-capstone-fix-python-constants.patch \
%D%/packages/patches/python-cross-compile.patch \
%D%/packages/patches/python-configobj-setuptools.patch \
%D%/packages/patches/python-dateutil-pytest-compat.patch \
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 16f572909c..336c8b0e38 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -39,6 +39,7 @@
;;; Copyright © 2023 Theofilos Pechlivanis <theofilos.pechlivanis@gmail.com>
;;; Copyright © 2023 Sharlatan Hellseher <sharlatanus@gmail.com>
;;; Copyright © 2023 pinoaffe <pinoaffe@gmail.com>
+;;; Copyright © 2024 Sören Tempel <soeren@soeren-tempel.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1815,6 +1816,7 @@ (define-public capstone
(version "5.0.1")
(source (origin
(method git-fetch)
+ (patches (search-patches "python-capstone-fix-python-constants.patch"))
(uri (git-reference
(url "https://github.com/capstone-engine/capstone")
(commit version)))
diff --git a/gnu/packages/patches/python-capstone-fix-python-constants.patch b/gnu/packages/patches/python-capstone-fix-python-constants.patch
new file mode 100644
index 0000000000..75100c6652
--- /dev/null
+++ b/gnu/packages/patches/python-capstone-fix-python-constants.patch
@@ -0,0 +1,84 @@
+Backport upstream patch fixing various constants in the Python bindings.
+
+Taken from: https://github.com/capstone-engine/capstone/commit/f180e176de3efb060db62820ff981d0291ea8525
+
+diff --git a/bindings/python/capstone/__init__.py b/bindings/python/capstone/__init__.py
+index bda2fdb6..52353c28 100755
+--- a/bindings/python/capstone/__init__.py
++++ b/bindings/python/capstone/__init__.py
+@@ -113,7 +113,6 @@ __all__ = [
+ 'CS_OPT_SYNTAX_NOREGNAME',
+ 'CS_OPT_SYNTAX_MASM',
+ 'CS_OPT_SYNTAX_MOTOROLA',
+- 'CS_OPT_SYNTAX_CS_REG_ALIAS',
+
+ 'CS_OPT_DETAIL',
+ 'CS_OPT_MODE',
+@@ -152,19 +151,6 @@ __all__ = [
+ 'CS_OP_REG',
+ 'CS_OP_IMM',
+ 'CS_OP_FP',
+- 'CS_OP_PRED',
+- 'CS_OP_RESERVED_5',
+- 'CS_OP_RESERVED_6',
+- 'CS_OP_RESERVED_7',
+- 'CS_OP_RESERVED_8',
+- 'CS_OP_RESERVED_9',
+- 'CS_OP_RESERVED_10',
+- 'CS_OP_RESERVED_11',
+- 'CS_OP_RESERVED_12',
+- 'CS_OP_RESERVED_13',
+- 'CS_OP_RESERVED_14',
+- 'CS_OP_RESERVED_15',
+- 'CS_OP_SPECIAL',
+ 'CS_OP_MEM',
+
+ 'CS_GRP_INVALID',
+@@ -298,26 +284,13 @@ CS_OPT_NO_BRANCH_OFFSET = 9 # ARM, prints branch immediates without offset.
+
+ # Capstone option value
+ CS_OPT_OFF = 0 # Turn OFF an option - default option of CS_OPT_DETAIL
+-CS_OPT_ON = 1 << 0 # Turn ON an option (CS_OPT_DETAIL)
++CS_OPT_ON = 3 # Turn ON an option (CS_OPT_DETAIL)
+
+ # Common instruction operand types - to be consistent across all architectures.
+ CS_OP_INVALID = 0 # uninitialized/invalid operand.
+ CS_OP_REG = 1 # Register operand.
+ CS_OP_IMM = 2 # Immediate operand.
+ CS_OP_FP = 3 # Floating-Point operand.
+-CS_OP_PRED = 4 # Predicate operand.
+-CS_OP_RESERVED_5 = 5
+-CS_OP_RESERVED_6 = 6
+-CS_OP_RESERVED_7 = 7
+-CS_OP_RESERVED_8 = 8
+-CS_OP_RESERVED_9 = 9
+-CS_OP_RESERVED_10 = 10
+-CS_OP_RESERVED_11 = 11
+-CS_OP_RESERVED_12 = 12
+-CS_OP_RESERVED_13 = 13
+-CS_OP_RESERVED_14 = 14
+-CS_OP_RESERVED_15 = 15
+-CS_OP_SPECIAL = 0x10 # Special operands from archs
+ CS_OP_MEM = 0x80 # Memory operand. Can be ORed with another operand type.
+
+ # Common instruction groups - to be consistent across all architectures.
+@@ -336,13 +309,12 @@ CS_AC_READ = (1 << 0) # Operand that is read from.
+ CS_AC_WRITE = (1 << 1) # Operand that is written to.
+
+ # Capstone syntax value
+-CS_OPT_SYNTAX_DEFAULT = 1 << 1 # Default assembly syntax of all platforms (CS_OPT_SYNTAX)
+-CS_OPT_SYNTAX_INTEL = 1 << 2 # Intel X86 asm syntax - default syntax on X86 (CS_OPT_SYNTAX, CS_ARCH_X86)
+-CS_OPT_SYNTAX_ATT = 1 << 3 # ATT asm syntax (CS_OPT_SYNTAX, CS_ARCH_X86)
+-CS_OPT_SYNTAX_NOREGNAME = 1 << 4 # Asm syntax prints register name with only number - (CS_OPT_SYNTAX, CS_ARCH_PPC, CS_ARCH_ARM)
+-CS_OPT_SYNTAX_MASM = 1 << 5 # MASM syntax (CS_OPT_SYNTAX, CS_ARCH_X86)
+-CS_OPT_SYNTAX_MOTOROLA = 1 << 6 # MOS65XX use $ as hex prefix
+-CS_OPT_SYNTAX_CS_REG_ALIAS = 1 << 7 # Prints common register alias which are not defined in LLVM (ARM: r9 = sb etc.)
++CS_OPT_SYNTAX_DEFAULT = 0 # Default assembly syntax of all platforms (CS_OPT_SYNTAX)
++CS_OPT_SYNTAX_INTEL = 1 # Intel X86 asm syntax - default syntax on X86 (CS_OPT_SYNTAX, CS_ARCH_X86)
++CS_OPT_SYNTAX_ATT = 2 # ATT asm syntax (CS_OPT_SYNTAX, CS_ARCH_X86)
++CS_OPT_SYNTAX_NOREGNAME = 3 # Asm syntax prints register name with only number - (CS_OPT_SYNTAX, CS_ARCH_PPC, CS_ARCH_ARM)
++CS_OPT_SYNTAX_MASM = 4 # MASM syntax (CS_OPT_SYNTAX, CS_ARCH_X86)
++CS_OPT_SYNTAX_MOTOROLA = 5 # MOS65XX use $ as hex prefix
+
+ # Capstone error type
+ CS_ERR_OK = 0 # No error: everything was fine
S
S
soeren wrote on 12 Feb 15:58 +0100
[PATCH] gnu: Add python-angr.
(address . 69074@debbugs.gnu.org)
2d88c47aba75ad57d3e4c5aa341a975d5109c376.1707749005.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-angr): New variable.
---
gnu/local.mk | 2 +
.../python-angr-addition-type-error.patch | 18 ++++
.../patches/python-angr-check-exec-deps.patch | 93 ++++++++++++++++++
gnu/packages/python-xyz.scm | 96 +++++++++++++++++++
4 files changed, 209 insertions(+)
create mode 100644 gnu/packages/patches/python-angr-addition-type-error.patch
create mode 100644 gnu/packages/patches/python-angr-check-exec-deps.patch

Toggle diff (250 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index ce0f1994c5..8bbf66cc1e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1899,6 +1899,8 @@ dist_patch_DATA = \
%D%/packages/patches/python-3-search-paths.patch \
%D%/packages/patches/python-3-fix-tests.patch \
%D%/packages/patches/python-3-hurd-configure.patch \
+ %D%/packages/patches/python-angr-addition-type-error.patch \
+ %D%/packages/patches/python-angr-check-exec-deps.patch \
%D%/packages/patches/python-aionotify-0.2.0-py3.8.patch \
%D%/packages/patches/python-argcomplete-1.11.1-fish31.patch \
%D%/packages/patches/python-capstone-fix-python-constants.patch \
diff --git a/gnu/packages/patches/python-angr-addition-type-error.patch b/gnu/packages/patches/python-angr-addition-type-error.patch
new file mode 100644
index 0000000000..7301d8b505
--- /dev/null
+++ b/gnu/packages/patches/python-angr-addition-type-error.patch
@@ -0,0 +1,18 @@
+This fixes failures of the test_ln_gcc_O2 and other related tests
+in the angr test suite. The patch has been proposed upstream.
+
+Taken form: https://github.com/angr/angr/pull/4443
+
+diff --git a/angr/analyses/reassembler.py b/angr/analyses/reassembler.py
+index 7a2399a60..b09b3a8cb 100644
+--- a/angr/analyses/reassembler.py
++++ b/angr/analyses/reassembler.py
+@@ -730,7 +730,7 @@ class Instruction:
+ elif operand.type == capstone.CS_OP_MEM:
+ operand_offsets.append(capstone_instr.disp_offset)
+ else:
+- operand_offsets.append(None)
++ operand_offsets.append(0)
+
+ if self.addr is not None:
+ self._initialize(capstone_instr.operands, operand_offsets)
diff --git a/gnu/packages/patches/python-angr-check-exec-deps.patch b/gnu/packages/patches/python-angr-check-exec-deps.patch
new file mode 100644
index 0000000000..438f8ef183
--- /dev/null
+++ b/gnu/packages/patches/python-angr-check-exec-deps.patch
@@ -0,0 +1,93 @@
+The angr test suite performs analysis on several pre-compiled binaries
+to ensure its binary analysis capabilities are working as intended.
+Some of these binaries are also executed as part of the test suite to
+test if the simulation engine provided by angr results in the same
+output as native execution of the binary.
+
+For Guix, this files as the glibc shared objects cannot be found.
+Additionally, we don't really want to execute pre-compiled binaries
+on Guix, hence we disable those tests.
+
+diff --git a/tests/test_ctype_locale.py b/tests/test_ctype_locale.py
+index 08cb89836..2b9233558 100644
+--- a/tests/test_ctype_locale.py
++++ b/tests/test_ctype_locale.py
+@@ -14,7 +14,7 @@ test_location = os.path.dirname(os.path.abspath(__file__))
+
+
+ class TestCtypeLocale(unittest.TestCase):
+- @skip_if_not_linux
++ @unittest.skip("test executes pre-compiled binaries")
+ def test_ctype_b_loc(self):
+ """
+ test_ctype_locale.test_ctype_b_loc
+@@ -60,7 +60,7 @@ class TestCtypeLocale(unittest.TestCase):
+ output = subprocess.check_output(bin_path, shell=True)
+ assert result == output
+
+- @skip_if_not_linux
++ @unittest.skip("test executes pre-compiled binaries")
+ def test_ctype_tolower_loc(self):
+ """
+ test_ctype_locale.test_ctype_tolower_loc
+@@ -109,7 +109,7 @@ class TestCtypeLocale(unittest.TestCase):
+ output = subprocess.check_output(bin_path, shell=True)
+ assert result == output
+
+- @skip_if_not_linux
++ @unittest.skip("test executes pre-compiled binaries")
+ def test_ctype_toupper_loc(self):
+ """
+ test_ctype_locale.test_ctype_toupper_loc
+diff --git a/tests/test_signed_div.py b/tests/test_signed_div.py
+index 59cb9b8d1..994ed9c65 100644
+--- a/tests/test_signed_div.py
++++ b/tests/test_signed_div.py
+@@ -1,6 +1,7 @@
+ import angr
+ import subprocess
+ import sys
++import pytest
+
+ import logging
+
+@@ -13,7 +14,7 @@ import os
+ test_location = os.path.dirname(os.path.realpath(__file__))
+
+
+-@skipUnless(sys.platform.startswith("linux"), "linux only")
++@pytest.mark.skip(reason="test executes pre-compiled binaries")
+ def test_signed_div():
+ test_bin = os.path.join(test_location, "..", "..", "binaries", "tests", "x86_64", "test_signed_div")
+ b = angr.Project(test_bin, auto_load_libs=False)
+diff --git a/tests/test_sscanf.py b/tests/test_sscanf.py
+index 29d2c8403..ea799b310 100644
+--- a/tests/test_sscanf.py
++++ b/tests/test_sscanf.py
+@@ -1,3 +1,4 @@
++import pytest
+ import angr
+ import subprocess
+ import sys
+@@ -14,7 +15,7 @@ test_location = os.path.dirname(os.path.realpath(__file__))
+
+
+ class TestSscanf(unittest.TestCase):
+- @unittest.skipUnless(sys.platform.startswith("linux"), "linux only")
++ @unittest.skip("test executes pre-compiled binaries")
+ def test_sscanf(self):
+ test_bin = os.path.join(test_location, "..", "..", "binaries", "tests", "x86_64", "sscanf_test")
+ b = angr.Project(test_bin, auto_load_libs=False)
+diff --git a/tests/test_strtol.py b/tests/test_strtol.py
+index 6c29cab22..f36181407 100644
+--- a/tests/test_strtol.py
++++ b/tests/test_strtol.py
+@@ -11,7 +11,7 @@ class TestStrtol(unittest.TestCase):
+ # pylint: disable=no-self-use
+
+ @slow_test
+- @unittest.skipUnless(sys.platform.startswith("linux"), "linux-only")
++ @unittest.skip("test executes pre-compiled binaries")
+ def test_strtol(self, threads=None):
+ test_bin = os.path.join(bin_location, "tests", "x86_64", "strtol_test")
+ # disabling auto_load_libs increases the execution time of the test case.
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 92c08020fb..902312584a 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -189,6 +189,7 @@ (define-module (gnu packages python-xyz)
#:use-module (gnu packages djvu)
#:use-module (gnu packages docker)
#:use-module (gnu packages documentation)
+ #:use-module (gnu packages emulators)
#:use-module (gnu packages engineering)
#:use-module (gnu packages enchant)
#:use-module (gnu packages file)
@@ -32390,6 +32391,101 @@ (define-public python-pyvex
to enable all kinds of binary analysis tasks.")
(license license:bsd-2)))
+(define-public python-angr
+ (package
+ (name "python-angr")
+ (version "9.2.46")
+ (source
+ (origin
+ (method git-fetch)
+ (patches (search-patches "python-angr-addition-type-error.patch"
+ "python-angr-check-exec-deps.patch"))
+ (uri (git-reference
+ (url "https://github.com/angr/angr")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "18y9wyf7va7gvp9zd6lhw82j9a2x2ajsvbawh96xnxzml0jwlwjm"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'patch-tests
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((coreutils (assoc-ref inputs "coreutils")))
+ (substitute* "tests/test_vault.py"
+ (("/bin/false")
+ (string-append coreutils "/bin/false")))
+ (substitute* "tests/common.py"
+ (("\\[\"cc\"\\]")
+ "[\"gcc\"]")))))
+ (replace 'check
+ (lambda* (#:key inputs tests? #:allow-other-keys)
+ (when tests?
+ (copy-recursively (assoc-ref inputs "binaries")
+ "../binaries")
+ (with-directory-excursion "tests"
+ ;; test_mips32_missing_offset_in_instructions fails
+ ;; with capstone 5 and passes with capstone 4. Might
+ ;; be a capstone regressions, needs investigation.
+ (invoke "pytest" "-vv" "-x" "--dist" "loadfile"
+ "-k" "not test_mips32_missing_offset_in_instructions"
+ "-n" (number->string (parallel-job-count)))))))
+ (add-before 'build 'set-cc
+ (lambda _
+ (setenv "CC" "gcc"))))))
+ (propagated-inputs (list python-ailment
+ python-archinfo
+ python-cachetools
+ python-capstone
+ python-cffi
+ python-claripy
+ python-cle
+ python-colorama
+ python-cppheaderparser
+ python-dpkt
+ python-gitpython
+ python-mulpyplexer
+ python-nampa
+ python-networkx
+ python-protobuf
+ python-psutil
+ python-itanium-demangle
+ python-pycparser
+ python-pyvex
+ python-progressbar2
+ python-rpyc
+ python-sortedcontainers
+ python-sqlalchemy
+ python-sympy
+ unicorn))
+ (native-inputs `(("python-pytest" ,python-pytest)
+ ("python-pytest-xdist" ,python-pytest-xdist)
+ ("binaries"
+ ;; This repository ships several binaries used only for testing
+ ;; purpose. The binaries are not executed and not part of the
+ ;; angr distribution, they are only used to test angr's binary
+ ;; analysis capabilities. In the context of the GNU FSDG, these
+ ;; files should be considered non-functional data.
+ ,(origin
+ (method git-fetch)
+ (uri (git-reference (url
+ "https://github.com/angr/binaries")
+ (commit (string-append "v"
+ version))))
+ (file-name (git-file-name "angr-binaries" version))
+ (sha256 (base32
+ "1f286b2239zavxzwg1184hj1zs380cr9qr549mvy3vywvm8bsmgr"))))))
+ (home-page "https://github.com/angr/angr")
+ (synopsis "Multi-architecture binary analysis toolkit")
+ (description
+ "This package provides a versatile binary analysis platform with the
+ability to perform dynamic symbolic execution as well as various
+static analyses directly on binaries. As such, it can be used for all
+kinds of reverse engineering, vulnerability discovery, exploit
+generation, and software testing purposes.")
+ (license license:bsd-2)))
+
(define-public python-archinfo
(package
(name "python-archinfo")
S
S
soeren wrote on 12 Feb 15:58 +0100
[PATCH] gnu: unicorn: Update to 2.0.1.post1.
(address . 69074@debbugs.gnu.org)
143cc3f98ea37b51ef7cd80d19b0e00c9c417149.1707749005.git.soeren@soeren-tempel.net
From: c4droid <c4droid@foxmail.com>

* gnu/packages/emulators.scm (unicorn) Update to 2.0.1.post1.

Co-authored-by: Sören Tempel <soeren@soeren-tempel.net>
---
gnu/packages/emulators.scm | 119 +++++++------------------------------
1 file changed, 20 insertions(+), 99 deletions(-)

Toggle diff (152 lines)
diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index cde3ee052c..df6ca235d7 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -21,6 +21,7 @@
;;; Copyright © 2023 Yovan Naumovski <yovan@gorski.stream>
;;; Copyright © 2023 Hendursaga <hendursaga@aol.com>
;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
+;;; Copyright © 2024 Sören Tempel <soeren@soeren-tempel.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -61,6 +62,7 @@ (define-module (gnu packages emulators)
#:use-module (gnu packages boost)
#:use-module (gnu packages cdrom)
#:use-module (gnu packages check)
+ #:use-module (gnu packages cmake)
#:use-module (gnu packages compression)
#:use-module (gnu packages containers)
#:use-module (gnu packages cross-base)
@@ -113,6 +115,7 @@ (define-module (gnu packages emulators)
#:use-module (guix build-system gnu)
#:use-module (guix build-system meson)
#:use-module (guix build-system python)
+ #:use-module (guix build-system pyproject)
#:use-module (guix build-system qt))
(define-public vice
@@ -2191,106 +2194,24 @@ (define-public bsnes
performance, features, and ease of use.")
(license license:gpl3)))
-;; python-pwntools requires a -rc release of unicorn
(define-public unicorn
- (let ((unless-x86
- (lambda (code)
- (if (member (%current-system) '("x86_64-linux" "i686-linux"))
- '()
- code))))
- (package
- (name "unicorn")
- (version "1.0.2-rc4")
- ;; NOTE: unicorn ships a bundled QEMU, but with a lot of custom modifications.
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/unicorn-engine/unicorn")
- (commit version)))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "17nyccgk7hpc4hab24yn57f1xnmr7kq4px98zbp2bkwcrxny8gwy"))))
- (outputs '("out" "python"))
- ;; The main library is not written in Python, but the build process has
- ;; little in common with any defined build system, so we might as well
- ;; build on top of python-build-system and make use of all
- ;; the Python-specific phases that can be reused.
- (build-system python-build-system)
- (arguments
- `(#:modules ((srfi srfi-26)
- (guix build python-build-system)
- (guix build utils))
- #:phases
- (modify-phases %standard-phases
- (add-before 'build 'build-library
- (lambda* (#:key inputs #:allow-other-keys)
- (invoke "make"
- "-j" (number->string (parallel-job-count))
- "UNICORN_STATIC=no"
- "CC=gcc")))
- (add-after 'build-library 'install-library
- (lambda* (#:key outputs #:allow-other-keys)
- (invoke "make" "install"
- "UNICORN_STATIC=no"
- (string-append
- "PREFIX="
- (assoc-ref outputs "out")))))
- (add-before 'build 'prepare-bindings
- (lambda* (#:key outputs #:allow-other-keys)
- (chdir "bindings/python")
- ;; Set this environment variable so that the Python bindings
- ;; don't build their own copy of the shared object, but use
- ;; a dummy value such that the bindings test suite uses the
- ;; same mechanism for loading the library as any other user.
- (setenv "LIBUNICORN_PATH" "1")
- (substitute* "unicorn/unicorn.py"
- (("_path_list = \\[.*")
- (string-append
- "_path_list = [\""
- (assoc-ref outputs "out")
- ;; eat the rest of the list
- "/lib\"] + 0*[")))
- #t))
- (add-before 'check 'check-library
- (lambda* (#:key outputs #:allow-other-keys)
- (for-each
- (lambda (suite)
- (with-directory-excursion
- (string-append "../../tests/" suite)
- (invoke "make" "test" "CC=gcc"
- ,@(unless-x86
- '("AS=i686-unknown-linux-gnu-as"
- "OBJCOPY=i686-unknown-linux-gnu-objcopy")))))
- '("unit" "regress"))
- #t))
- (add-after 'install 'install-samples
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((python-samples (find-files "." "sample_.*"))
- (c-samples (find-files "../../samples" ".*\\.c"))
- (python-docdir
- (string-append (assoc-ref outputs "python")
- "/share/doc/unicorn/samples"))
- (c-docdir
- (string-append (assoc-ref outputs "out")
- "/share/doc/unicorn/samples")))
- (for-each (cut install-file <> c-docdir) c-samples)
- (for-each (cut install-file <> python-docdir) python-samples)
- #t))))))
- (native-inputs
- ;; NOTE: cross-binutils needs to be wrapped with unless-x86, as otherwise
- ;; the linker provided by the package will be used, circumventing the ld-wrapper.
- `(,@(unless-x86
- `(("assembler-for-tests" ,(cross-binutils "i686-unknown-linux-gnu"))))
- ("cmocka" ,cmocka)
- ("hexdump-for-tests" ,util-linux)))
- (home-page "https://www.unicorn-engine.org")
- (synopsis "Unicorn CPU emulator framework")
- (description
- "Unicorn is a lightweight, multi-platform, multi-architecture CPU emulator
-framework based on QEMU.")
- (license license:gpl2+))))
+ (package
+ (name "unicorn")
+ (version "2.0.1.post1")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri name version))
+ (sha256
+ (base32
+ "0mlfs8qfi0clyncfkbxp6in0cpl747510i6bqymwid43xcirbikz"))))
+ (build-system pyproject-build-system)
+ (native-inputs (list cmake pkg-config))
+ (home-page "https://www.unicorn-engine.org")
+ (synopsis "Generic CPU emulator framework")
+ (description
+ "Uniforn is a lightweight, multi-platform, multi-architecture CPU
+emulator framework based on QEMU.")
+ (license license:gpl2+)))
(define-public ppsspp
(package
T
T
Troy Figiel wrote on 12 Feb 23:53 +0100
Re: [bug#69074] [PATCH] Add python-angr.
(address . 69074@debbugs.gnu.org)
87v86tb8fw.fsf@troyfigiel.com
Hi Sören,

Just a small note, I had to switch the order of python-pysmt and
python-claripy to be able to apply this patch series. Somehow these are sent out of order.

This is not exhaustive, but a couple of things I noticed:

- python-mulpyplexer actually does have tests. The file mulpyplexer.py
itself is the test.
- python-rpyc seems to have an extensive test suite. Do all of them need
a network connection? It would be nicer to surgically remove the tests
that cannot be run.
- python-ailment skips both tests it runs. This might need to be looked
into or commented why this happens.
- python-angr does not build for me, because a test is failing. I think
you might have some nondeterministic behaviour in your build:
--8<---------------cut here---------------start------------->8---
FAILED test_memory.py::test_concrete_memset - assert 5.379231691360474 <= 5
--8<---------------cut here---------------end--------------->8---
- Would it make more sense to place python-archinfo and
python-keystone-engine under engineering.scm? The current placement
creates a direct import cycle engineering->python-xyz->engineering
- The changes to local.mk and the patches are not mentioned in the
commit messages.

Best wishes,

Troy
S
S
Sören Tempel wrote on 13 Feb 10:53 +0100
(address . 69074@debbugs.gnu.org)(address . troy@troyfigiel.com)
2T2LBWR63TVNP.3NFUJ8AHKFC01@8pit.net
Hi Troy,

First of all, thanks for the quick feedback. Much appreciated!

Toggle quote (4 lines)
> Just a small note, I had to switch the order of python-pysmt and
> python-claripy to be able to apply this patch series. Somehow these are
> sent out of order.

Sorry about that! I guess because I send 15 emails at once, the MTA
queued some of them and then just didn't send them in the original order
(which it isn't required to). I don't think there is much I can do about
it on my end. I suppose `git-format-patch --numbered` would help?

Toggle quote (3 lines)
> - python-mulpyplexer actually does have tests. The file mulpyplexer.py
> itself is the test.

Good catch! I will just enable those [0].

Toggle quote (4 lines)
> - python-rpyc seems to have an extensive test suite. Do all of them need
> a network connection? It would be nicer to surgically remove the tests
> that cannot be run.

Sure, we can enable parts of the test suite [1].

Toggle quote (3 lines)
> - python-ailment skips both tests it runs. This might need to be looked
> into or commented why this happens.

The first test is skipped because it needs python-pyvex, the second is
skipped because it needs python-angr. The first also indirectly depends
on angr because the VEX converter within ailment needs it. Therefore,
we cannot enable these tests as they would would result in a cyclic
dependency (python-angr <-> python-ailment). I can add a comment.

Toggle quote (3 lines)
> - python-angr does not build for me, because a test is failing. I think
> you might have some nondeterministic behaviour in your build:

The test performs benchmark using time.time() and expects a minimum
timespan to be satisfied [2]. Therefore, it depends on the current load
and the host CPU. Never failed for me, but probably good to disable it?

Toggle quote (4 lines)
> - Would it make more sense to place python-archinfo and
> python-keystone-engine under engineering.scm? The current placement
> creates a direct import cycle engineering->python-xyz->engineering

Sure, I can move them accordingly.

Toggle quote (3 lines)
> - The changes to local.mk and the patches are not mentioned in the
> commit messages.

Good find, I will fix this in the next revision of this patchset.

P.S: Should I resend the whole patch series with the updates or should
I only resend the patches that changed due to the outlined updates? Also
let me know if I should send a revision immediately or if you want me to
wait for further feedback.

Greetings
Sören

T
T
Troy Figiel wrote on 13 Feb 12:52 +0100
Re: [bug#69074] [PATCH] Add python-angr.
(address . 69074@debbugs.gnu.org)
daecefc7-d62c-4a3d-8d82-d02b664e6a0e@troyfigiel.com
Hi Sören,

First off, thank you for the patches! I will have a second look myself
today or tomorrow, as I was not familiar with angr and I would love to
try it out / play around with it myself.

On 2024-02-13 10:53, Sören Tempel wrote:
Toggle quote (6 lines)
> Sorry about that! I guess because I send 15 emails at once, the MTA
> queued some of them and then just didn't send them in the original order
> (which it isn't required to). I don't think there is much I can do about
> it on my end. I suppose `git-format-patch --numbered` would help?
>

No worries, I'm just mentioning it for other reviewers/committers, as I
don't have commit rights myself.

Toggle quote (7 lines)
> The first test is skipped because it needs python-pyvex, the second is
> skipped because it needs python-angr. The first also indirectly depends
> on angr because the VEX converter within ailment needs it. Therefore,
> we cannot enable these tests as they would would result in a cyclic
> dependency (python-angr <-> python-ailment). I can add a comment.
>

Yes, I would cover this with a comment regarding the cyclical
dependency. In general, I prefer failing tests to be "surgically
removed" or clearly commented, since it acts as an entry point for
future developers.

Toggle quote (5 lines)
> The test performs benchmark using time.time() and expects a minimum
> timespan to be satisfied [2]. Therefore, it depends on the current load
> and the host CPU. Never failed for me, but probably good to disable it?
>

I've had the same problem with some Go packages. The default test
timeout is set to 10 minutes and due to this, I cannot build these
packages locally. My laptop used to be considered fast :-) It seems QA
passes fine though.

I would be in favour of removing benchmark tests, but a second opinion
would be good.

Toggle quote (6 lines)
> P.S: Should I resend the whole patch series with the updates or should
> I only resend the patches that changed due to the outlined updates? Also
> let me know if I should send a revision immediately or if you want me to
> wait for further feedback.
>

I think it would be good to wait for feedback from others and
incorporate everything into a second patch set.

Best wishes,

Troy
T
T
Troy Figiel wrote on 15 Feb 22:39 +0100
(address . 69074@debbugs.gnu.org)
87jzn5be5g.fsf@troyfigiel.com
Hi Sören,

A couple points regarding back ports and versions:

I see that you back ported some upstream patches. I tend to use patches
more as a last resort and whenever possible I stick to upstream
versions and commits (in that order of preference). I find this makes
the life of future developers easier, as back ports might not apply
cleanly to newer versions.

I will attach a new patch for python-pysmt as an example. It seems
everything still built successfully (please check whether this works as
expected). I fixed up the description a bit and set the env variables in
a separate phase as well.

I believe upgrading to a later commit might work for capstone,
python-angr and python-pyvex, which also have back ported patches. For
python-angr and python-pyvex, I noticed you set them to version 9.2.46,
but this is not the latest version. Is there a reason we cannot upgrade
past this version? Could you add a comment mentioning what prevents such
an upgrade if so?

The versions of all other angr packages you added are also set to
9.2.46. It looks like this is on purpose, or not? If they all need the
exact same versions to work, could you add a comment (for each package)
that says something like "python-ailment, python-angr, python-archinfo,
python-claripy, python-cle and python-pyvex need to be set to the same
version"?

Some minor points:

- AFAIK assoc-ref is the old way of referring to inputs. With G-exps you would, for example, replace (assoc-ref inputs "binaries") in python-angr by something like #$(this-package-native-input "binaries").
- You can clean up the check phase for python-angr using test flags. I will add a patch as an example as well.
- Regarding binaries, I am honestly not sure how these would be best handled. They are binaries, but without them there might not be much to test anyway... A second opinion would be good here.

Hope this helps! The rest LGTM. I will ping the Python team, so someone with commit rights can have a look.

Best wishes,

Troy
T
T
Troy Figiel wrote on 12 Feb 15:58 +0100
[PATCH] gnu: Add python-pysmt.
(address . 69074@debbugs.gnu.org)
87il2pbdun.fsf@troyfigiel.com
Hi Sören, here an example for python-pysmt, taken from your commit. It might
be good to add a comment why you cannot stick to a fixed version like
0.9.5. Or ask upstream for a new version :-)

* gnu/packages/python-xyz.scm (python-pysmt): New variable.
---
gnu/packages/python-xyz.scm | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)

Toggle diff (46 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 5fe5c0d60a..bb58e3aaa8 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32303,6 +32303,39 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-pysmt
+ (let ((commit "f7b599c228ee8b429aab1b82ddf167bd956ea8a3")
+ (version "0.9.5")
+ (revision "0"))
+ (package
+ (name "python-pysmt")
+ (version (git-version version revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/pysmt/pysmt")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "05q70hk9rq3037f999ph5yi1ix4c91db29i17rxwcl6q24vlxiwg"))))
+ (build-system pyproject-build-system)
+ (arguments
+ '(#:phases (modify-phases %standard-phases
+ (add-before 'check 'set-pysmt-solver
+ (lambda _
+ (setenv "PYSMT_SOLVER" "z3"))))))
+ (native-inputs (list python-pytest))
+ (propagated-inputs (list z3))
+ (home-page "https://github.com/pysmt/pysmt")
+ (synopsis
+ "Solver-agnostic library for SMT formula manipulation and solving")
+ (description
+ "This Python module provides a solver-agnostic abstraction for working
+with @acronym{SMT, Satisfiability Modulo Theory} formulas. For example, it
+allows manipulation and solving such formulas.")
+ (license license:asl2.0))))
+
(define-public python-rpyc
(package
(name "python-rpyc")
--
2.42.0
T
T
Troy Figiel wrote on 12 Feb 15:58 +0100
[PATCH] gnu: Add python-angr.
(address . 69074@debbugs.gnu.org)
87h6i9bdjc.fsf@troyfigiel.com
And here the patch for python-angr. I changed a couple of things:
- Used pytest test-flags
- Used (which "false")
- Used #$(this-package-native-inputs "binaries")
- Removed the "-x" flag in pytest. If it fails in the CI, it can be nice to see all tests that failed

* gnu/packages/python-xyz.scm (python-angr): New variable.
---
gnu/local.mk | 2 +
.../python-angr-addition-type-error.patch | 18 ++++
.../patches/python-angr-check-exec-deps.patch | 93 ++++++++++++++++++
gnu/packages/python-xyz.scm | 97 +++++++++++++++++++
4 files changed, 210 insertions(+)
create mode 100644 gnu/packages/patches/python-angr-addition-type-error.patch
create mode 100644 gnu/packages/patches/python-angr-check-exec-deps.patch

Toggle diff (253 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 59e930ffb9..716bde347b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1899,6 +1899,8 @@ dist_patch_DATA = \
%D%/packages/patches/python-3-search-paths.patch \
%D%/packages/patches/python-3-fix-tests.patch \
%D%/packages/patches/python-3-hurd-configure.patch \
+ %D%/packages/patches/python-angr-addition-type-error.patch \
+ %D%/packages/patches/python-angr-check-exec-deps.patch \
%D%/packages/patches/python-aionotify-0.2.0-py3.8.patch \
%D%/packages/patches/python-argcomplete-1.11.1-fish31.patch \
%D%/packages/patches/python-capstone-fix-python-constants.patch \
diff --git a/gnu/packages/patches/python-angr-addition-type-error.patch b/gnu/packages/patches/python-angr-addition-type-error.patch
new file mode 100644
index 0000000000..7301d8b505
--- /dev/null
+++ b/gnu/packages/patches/python-angr-addition-type-error.patch
@@ -0,0 +1,18 @@
+This fixes failures of the test_ln_gcc_O2 and other related tests
+in the angr test suite. The patch has been proposed upstream.
+
+Taken form: https://github.com/angr/angr/pull/4443
+
+diff --git a/angr/analyses/reassembler.py b/angr/analyses/reassembler.py
+index 7a2399a60..b09b3a8cb 100644
+--- a/angr/analyses/reassembler.py
++++ b/angr/analyses/reassembler.py
+@@ -730,7 +730,7 @@ class Instruction:
+ elif operand.type == capstone.CS_OP_MEM:
+ operand_offsets.append(capstone_instr.disp_offset)
+ else:
+- operand_offsets.append(None)
++ operand_offsets.append(0)
+
+ if self.addr is not None:
+ self._initialize(capstone_instr.operands, operand_offsets)
diff --git a/gnu/packages/patches/python-angr-check-exec-deps.patch b/gnu/packages/patches/python-angr-check-exec-deps.patch
new file mode 100644
index 0000000000..438f8ef183
--- /dev/null
+++ b/gnu/packages/patches/python-angr-check-exec-deps.patch
@@ -0,0 +1,93 @@
+The angr test suite performs analysis on several pre-compiled binaries
+to ensure its binary analysis capabilities are working as intended.
+Some of these binaries are also executed as part of the test suite to
+test if the simulation engine provided by angr results in the same
+output as native execution of the binary.
+
+For Guix, this files as the glibc shared objects cannot be found.
+Additionally, we don't really want to execute pre-compiled binaries
+on Guix, hence we disable those tests.
+
+diff --git a/tests/test_ctype_locale.py b/tests/test_ctype_locale.py
+index 08cb89836..2b9233558 100644
+--- a/tests/test_ctype_locale.py
++++ b/tests/test_ctype_locale.py
+@@ -14,7 +14,7 @@ test_location = os.path.dirname(os.path.abspath(__file__))
+
+
+ class TestCtypeLocale(unittest.TestCase):
+- @skip_if_not_linux
++ @unittest.skip("test executes pre-compiled binaries")
+ def test_ctype_b_loc(self):
+ """
+ test_ctype_locale.test_ctype_b_loc
+@@ -60,7 +60,7 @@ class TestCtypeLocale(unittest.TestCase):
+ output = subprocess.check_output(bin_path, shell=True)
+ assert result == output
+
+- @skip_if_not_linux
++ @unittest.skip("test executes pre-compiled binaries")
+ def test_ctype_tolower_loc(self):
+ """
+ test_ctype_locale.test_ctype_tolower_loc
+@@ -109,7 +109,7 @@ class TestCtypeLocale(unittest.TestCase):
+ output = subprocess.check_output(bin_path, shell=True)
+ assert result == output
+
+- @skip_if_not_linux
++ @unittest.skip("test executes pre-compiled binaries")
+ def test_ctype_toupper_loc(self):
+ """
+ test_ctype_locale.test_ctype_toupper_loc
+diff --git a/tests/test_signed_div.py b/tests/test_signed_div.py
+index 59cb9b8d1..994ed9c65 100644
+--- a/tests/test_signed_div.py
++++ b/tests/test_signed_div.py
+@@ -1,6 +1,7 @@
+ import angr
+ import subprocess
+ import sys
++import pytest
+
+ import logging
+
+@@ -13,7 +14,7 @@ import os
+ test_location = os.path.dirname(os.path.realpath(__file__))
+
+
+-@skipUnless(sys.platform.startswith("linux"), "linux only")
++@pytest.mark.skip(reason="test executes pre-compiled binaries")
+ def test_signed_div():
+ test_bin = os.path.join(test_location, "..", "..", "binaries", "tests", "x86_64", "test_signed_div")
+ b = angr.Project(test_bin, auto_load_libs=False)
+diff --git a/tests/test_sscanf.py b/tests/test_sscanf.py
+index 29d2c8403..ea799b310 100644
+--- a/tests/test_sscanf.py
++++ b/tests/test_sscanf.py
+@@ -1,3 +1,4 @@
++import pytest
+ import angr
+ import subprocess
+ import sys
+@@ -14,7 +15,7 @@ test_location = os.path.dirname(os.path.realpath(__file__))
+
+
+ class TestSscanf(unittest.TestCase):
+- @unittest.skipUnless(sys.platform.startswith("linux"), "linux only")
++ @unittest.skip("test executes pre-compiled binaries")
+ def test_sscanf(self):
+ test_bin = os.path.join(test_location, "..", "..", "binaries", "tests", "x86_64", "sscanf_test")
+ b = angr.Project(test_bin, auto_load_libs=False)
+diff --git a/tests/test_strtol.py b/tests/test_strtol.py
+index 6c29cab22..f36181407 100644
+--- a/tests/test_strtol.py
++++ b/tests/test_strtol.py
+@@ -11,7 +11,7 @@ class TestStrtol(unittest.TestCase):
+ # pylint: disable=no-self-use
+
+ @slow_test
+- @unittest.skipUnless(sys.platform.startswith("linux"), "linux-only")
++ @unittest.skip("test executes pre-compiled binaries")
+ def test_strtol(self, threads=None):
+ test_bin = os.path.join(bin_location, "tests", "x86_64", "strtol_test")
+ # disabling auto_load_libs increases the execution time of the test case.
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index e42cbde76e..b3a0f70bd2 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -189,6 +189,7 @@ (define-module (gnu packages python-xyz)
#:use-module (gnu packages djvu)
#:use-module (gnu packages docker)
#:use-module (gnu packages documentation)
+ #:use-module (gnu packages emulators)
#:use-module (gnu packages engineering)
#:use-module (gnu packages enchant)
#:use-module (gnu packages file)
@@ -32390,6 +32391,102 @@ (define-public python-pyvex
to enable all kinds of binary analysis tasks.")
(license license:bsd-2)))
+(define-public python-angr
+ (package
+ (name "python-angr")
+ (version "9.2.46")
+ (source
+ (origin
+ (method git-fetch)
+ (patches (search-patches "python-angr-addition-type-error.patch"
+ "python-angr-check-exec-deps.patch"))
+ (uri (git-reference
+ (url "https://github.com/angr/angr")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "18y9wyf7va7gvp9zd6lhw82j9a2x2ajsvbawh96xnxzml0jwlwjm"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:test-flags '(list "tests"
+ "--dist"
+ "loadfile"
+ "-k"
+ ;; test_mips32_missing_offset_in_instructions fails
+ ;; with capstone 5 and passes with capstone 4. Might
+ ;; be a capstone regressions, needs investigation.
+ "not test_mips32_missing_offset_in_instructions"
+ "-n"
+ (number->string (parallel-job-count)))
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'patch-tests
+ (lambda _
+ (substitute* "tests/test_vault.py"
+ (("/bin/false")
+ (which "false")))
+ (substitute* "tests/common.py"
+ (("\\[\"cc\"\\]")
+ "[\"gcc\"]"))))
+ (add-before 'build 'set-cc
+ (lambda _
+ (setenv "CC" "gcc")))
+ (add-before 'check 'copy-binaries
+ (lambda _
+ (copy-recursively #$(this-package-native-input
+ "binaries") "../binaries"))))))
+ (propagated-inputs (list python-ailment
+ python-archinfo
+ python-cachetools
+ python-capstone
+ python-cffi
+ python-claripy
+ python-cle
+ python-colorama
+ python-cppheaderparser
+ python-dpkt
+ python-gitpython
+ python-mulpyplexer
+ python-nampa
+ python-networkx
+ python-protobuf
+ python-psutil
+ python-itanium-demangle
+ python-pycparser
+ python-pyvex
+ python-progressbar2
+ python-rpyc
+ python-sortedcontainers
+ python-sqlalchemy
+ python-sympy
+ unicorn))
+ (native-inputs `(("python-pytest" ,python-pytest)
+ ("python-pytest-xdist" ,python-pytest-xdist)
+ ("binaries"
+ ;; This repository ships several binaries used only for testing
+ ;; purpose. The binaries are not executed and not part of the
+ ;; angr distribution, they are only used to test angr's binary
+ ;; analysis capabilities. In the context of the GNU FSDG, these
+ ;; files should be considered non-functional data.
+ ,(origin
+ (method git-fetch)
+ (uri (git-reference (url
+ "https://github.com/angr/binaries")
+ (commit (string-append "v"
+ version))))
+ (file-name (git-file-name "angr-binaries" version))
+ (sha256 (base32
+ "1f286b2239zavxzwg1184hj1zs380cr9qr549mvy3vywvm8bsmgr"))))))
+ (home-page "https://github.com/angr/angr")
+ (synopsis "Multi-architecture binary analysis toolkit")
+ (description
+ "This package provides a versatile binary analysis platform with the
+ability to perform dynamic symbolic execution as well as various
+static analyses directly on binaries. As such, it can be used for all
+kinds of reverse engineering, vulnerability discovery, exploit
+generation, and software testing purposes.")
+ (license license:bsd-2)))
+
(define-public python-archinfo
(package
(name "python-archinfo")
--
2.42.0
T
T
Troy Figiel wrote on 15 Feb 23:09 +0100
Re: [bug#69074] [PATCH] Add python-angr.
(address . 69074@debbugs.gnu.org)
8f76ff66-ed29-431d-bcb0-edabc3c7d285@troyfigiel.com
Two more minor points:

- python-mulpyplexer actually has a BSD-2 license, not BSD-3
- In the description of python-namba, you can use @acronym for FLIRT as
I did in python-pysmt
S
S
Sören Tempel wrote on 1 Mar 13:02 +0100
(address . 69074@debbugs.gnu.org)(address . troy@troyfigiel.com)
3GK5VDMPCJCNW.2ORIO30Y0PROL@8pit.net
Hi Troy,

Sorry, for the late reply. I didn't receive your comments via email.
I think you might have to CC me. If I need to do something special
in order to have debbugs forward these mails to me let me know.

Nonetheless, thanks for your additional feedback! I will look into it in
more detail and hopefully address it with a new revision of my patchset.
I don't have time to do so this weekend, but I am hopeful that I get
around to it next weekend.

Greetings
Sören
S
S
soeren wrote on 10 Mar 21:09 +0100
[PATCH v2 01/14] gnu: Add python-itanium-demangle.
(address . 69074@debbugs.gnu.org)(address . troy@troyfigiel.com)
19ef0993fd8891d02402943609f70de73e0b233a.1710101374.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-itanium-demangle): New variable.
---
gnu/packages/python-xyz.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)

Toggle diff (51 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index c68b17b0ab..e630bdb6a6 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -146,6 +146,7 @@
;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2023 Attila Lendvai <attila@lendvai.name>
;;; Copyright © 2023, 2024 Troy Figiel <troy@troyfigiel.com>
+;;; Copyright © 2024 Sören Tempel <soeren@soeren-tempel.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -32302,6 +32303,36 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-itanium-demangle
+ (package
+ (name "python-itanium-demangle")
+ (version "1.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/whitequark/python-itanium_demangler")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "1q47aqm5z3db6pasdzw05d6236vnb8hnapfy88fcmn9dr5ym98r3"))))
+ (build-system pyproject-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (with-directory-excursion "tests"
+ (invoke "python" "-m" "unittest"))))))))
+ (home-page "https://github.com/whitequark/python-itanium_demangler")
+ (synopsis "Pure Python Itanium C++ ABI demangler")
+ (description
+ "This Python module provides an implementation of the Itanium C++
+ABI symbol mangling language. The demangler generates an abstract
+syntax tree from mangled symbols, which can be used for directly
+extracting type information.")
+ (license license:bsd-0)))
+
(define-public python-peachpy
;; There is no tag in this repo.
(let ((commit "913d74c35a6b1d330e90bfc055208ce5b06b35a0")

base-commit: 179bb57d2532ee6b81791e078b0f782cbf88cb84
S
S
soeren wrote on 10 Mar 21:09 +0100
[PATCH v2 02/14] gnu: Add python-keystone-engine.
(address . 69074@debbugs.gnu.org)(address . troy@troyfigiel.com)
aeff8272e52d0d3532f4fa96a8dc1d91a92821b0.1710101374.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/emulators.scm (python-keystone-engine): New variable.
---
gnu/packages/emulators.scm | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

Toggle diff (33 lines)
diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index cde3ee052c..43af9804e5 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -2597,6 +2597,28 @@ (define-public uxn
stack-machine, written in ANSI C. Graphical output is implemented using SDL2.")
(license license:expat))))
+(define-public python-keystone-engine
+ (package
+ (name "python-keystone-engine")
+ (version "0.9.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "keystone-engine" version))
+ (sha256
+ (base32 "1xahdr6bh3dw5swrc2r8kqa8ljhqlb7k2kxv5mrw5rhcmcnzcyig"))))
+ (native-inputs (list cmake))
+ (build-system pyproject-build-system)
+ (home-page "https://www.keystone-engine.org")
+ (synopsis
+ "Lightweight multi-platform, multi-architecture assembler framework")
+ (description
+ "Keystone is a lightweight multi-platform, multi-architecture
+assembler framework. It supports a wide-range of different architectures
+and offers an intuitive architecture-neutral API for interacting with
+assembly for these architectures.")
+ (license license:gpl2)))
+
(define-public emu8051
(let ((commit "5dc681275151c4a5d7b85ec9ff4ceb1b25abd5a8")
(revision "1"))
S
S
soeren wrote on 10 Mar 21:09 +0100
[PATCH v2 03/14] gnu: Add python-mulpyplexer.
(address . 69074@debbugs.gnu.org)(address . troy@troyfigiel.com)
e08cfaa3ac39d2e956c8a3bcf8a8473f87f5039b.1710101374.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-mulpyplexer): New variable.
---
gnu/packages/python-xyz.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

Toggle diff (34 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index e630bdb6a6..ddb0224b53 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32303,6 +32303,29 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-mulpyplexer
+ (package
+ (name "python-mulpyplexer")
+ (version "0.09")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "mulpyplexer" version))
+ (sha256
+ (base32 "0c5xzci1djy1yi9hxxh8g67l6ms8r7ad7ja20pv8hfbdysdrwkhl"))))
+ (build-system pyproject-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "python" "mulpyplexer.py")))))))
+ (home-page "https://github.com/zardus/mulpyplexer/")
+ (synopsis "Multiplexes interactions with lists of Python objects")
+ (description "This module provides utilities for multiplexing
+interactions with lists of Python objects.")
+ (license license:bsd-2)))
+
(define-public python-itanium-demangle
(package
(name "python-itanium-demangle")
S
S
soeren wrote on 10 Mar 21:09 +0100
[PATCH v2 04/14] gnu: Add python-nampa.
(address . 69074@debbugs.gnu.org)(address . troy@troyfigiel.com)
6158dede0f875324c1c4dc48afcd2798faca472d.1710101374.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-nampa): New variable.
---
gnu/packages/python-xyz.scm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)

Toggle diff (31 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index ddb0224b53..f713e27c64 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32303,6 +32303,26 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-nampa
+ (package
+ (name "python-nampa")
+ (version "0.1.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "nampa" version))
+ (sha256
+ (base32 "0k6cq2gflpkm40qhgqbbcjmq5lq589c15bmk567qyh3d08062hvd"))))
+ (build-system pyproject-build-system)
+ (propagated-inputs (list python-future))
+ (home-page "https://github.com/thebabush/nampa")
+ (synopsis "Python implementation of IDA Pro's FLIRT technology")
+ (description
+ "This Python module implements the @acronym{FLIRT, Fast Library Identification
+and Recognition Technology}. This technology is useful for identifying
+common library subroutines in disassembled binaries.")
+ (license license:lgpl3)))
+
(define-public python-mulpyplexer
(package
(name "python-mulpyplexer")
S
S
soeren wrote on 10 Mar 21:09 +0100
[PATCH v2 05/14] gnu: Add python-rpyc.
(address . 69074@debbugs.gnu.org)(address . troy@troyfigiel.com)
ea7fabbe45a7f408518ea538eed11db91e5b052b.1710101374.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-rpyc): New variable.
---
gnu/packages/python-xyz.scm | 39 +++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

Toggle diff (50 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index f713e27c64..f9bd733ecd 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32303,6 +32303,45 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-rpyc
+ (package
+ (name "python-rpyc")
+ (version "5.3.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/tomerfiliba-org/rpyc")
+ (commit version)))
+ (sha256
+ (base32 "15mnp9qkyw3mmxmr5y4kf3xkvxyp00n892vqaqwznr7al35apgnr"))
+ (snippet '(begin
+ ;; Disable deploy tests, these rely on OpenSSH and require
+ ;; configuring the SSH client manually to accept the host key.
+ (delete-file "tests/test_deploy.py")
+ ;; Disable tests requiring network access. These tests
+ ;; presently fail with the error "Network is unreachable".
+ (delete-file "tests/test_registry.py")))))
+ (build-system pyproject-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (with-directory-excursion "tests"
+ (invoke "python" "-m" "unittest"))))))))
+ (propagated-inputs (list python-hatchling python-plumbum))
+ (home-page "https://github.com/tomerfiliba-org/rpyc")
+ (synopsis
+ "Remote Python Call (RPyC) is a symmetric distributed computing library")
+ (description
+ "This Python module enables remote procedure calls, clustering, and
+distributed-computing. For this purpose, it makes use of object-proxying, a technique
+that employs python's dynamic nature, to overcome the physical boundaries between
+processes and computers, so that remote objects can be manipulated as if they
+were local.")
+ (license license:expat)))
+
(define-public python-nampa
(package
(name "python-nampa")
S
S
soeren wrote on 10 Mar 21:09 +0100
[PATCH v2 06/14] gnu: Add python-pysmt.
(address . 69074@debbugs.gnu.org)(address . troy@troyfigiel.com)
37b09a67f0fb1e1c33994b145fd05aab064c876c.1710101374.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/patches/python-pysmt-fix-pow-return-type.patch:
New patch.
* gnu/packages/patches/python-pysmt-fix-smtlib-serialization-test.patch:
New patch.
* gnu/local.mk (dist_patch_DATA): Add them.
* gnu/packages/python-xyz.scm (python-pysmt): New variable.
---
gnu/local.mk | 2 +
.../python-pysmt-fix-pow-return-type.patch | 258 ++++++++++++++++++
...-pysmt-fix-smtlib-serialization-test.patch | 86 ++++++
gnu/packages/python-xyz.scm | 32 +++
4 files changed, 378 insertions(+)
create mode 100644 gnu/packages/patches/python-pysmt-fix-pow-return-type.patch
create mode 100644 gnu/packages/patches/python-pysmt-fix-smtlib-serialization-test.patch

Toggle diff (412 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index fbdb285695..1946fdcbb6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1925,6 +1925,8 @@ dist_patch_DATA = \
%D%/packages/patches/python-pyan3-fix-absolute-path-bug.patch \
%D%/packages/patches/python-pyan3-fix-positional-arguments.patch \
%D%/packages/patches/python-pygpgme-fix-pinentry-tests.patch \
+ %D%/packages/patches/python-pysmt-fix-pow-return-type.patch \
+ %D%/packages/patches/python-pysmt-fix-smtlib-serialization-test.patch \
%D%/packages/patches/python-pytorch-runpath.patch \
%D%/packages/patches/python-pytorch-system-libraries.patch \
%D%/packages/patches/python-pytorch-1.9.0-system-libraries.patch \
diff --git a/gnu/packages/patches/python-pysmt-fix-pow-return-type.patch b/gnu/packages/patches/python-pysmt-fix-pow-return-type.patch
new file mode 100644
index 0000000000..0ec2d41b3c
--- /dev/null
+++ b/gnu/packages/patches/python-pysmt-fix-pow-return-type.patch
@@ -0,0 +1,258 @@
+Backport of an upstream patch which fixes a test failure with our
+packaged version of the Z3 SMT solver.
+
+Taken from: https://github.com/pysmt/pysmt/commit/f522e8cd8f3e75ff85f5eae29b427e18a6701859
+
+diff --git a/pysmt/formula.py b/pysmt/formula.py
+index ea4b46c..6cb9cbf 100644
+--- a/pysmt/formula.py
++++ b/pysmt/formula.py
+@@ -252,11 +252,7 @@ class FormulaManager(object):
+
+ if base.is_constant():
+ val = base.constant_value() ** exponent.constant_value()
+- if base.is_constant(types.REAL):
+- return self.Real(val)
+- else:
+- assert base.is_constant(types.INT)
+- return self.Int(val)
++ return self.Real(val)
+ return self.create_node(node_type=op.POW, args=(base, exponent))
+
+ def Div(self, left, right):
+diff --git a/pysmt/logics.py b/pysmt/logics.py
+index ef88dd6..9dc45b1 100644
+--- a/pysmt/logics.py
++++ b/pysmt/logics.py
+@@ -495,6 +495,12 @@ QF_NRA = Logic(name="QF_NRA",
+ real_arithmetic=True,
+ linear=False)
+
++QF_NIRA = Logic(name="QF_NIRA",
++ description="""Quantifier-free integer and real arithmetic.""",
++ quantifier_free=True,
++ integer_arithmetic=True,
++ real_arithmetic=True,
++ linear=False)
+
+ QF_RDL = Logic(name="QF_RDL",
+ description=\
+@@ -619,41 +625,41 @@ QF_AUFBVLIRA = Logic(name="QF_AUFBVLIRA",
+ AUTO = Logic(name="Auto",
+ description="Special logic used to indicate that the logic to be used depends on the formula.")
+
+-SMTLIB2_LOGICS = frozenset([ AUFLIA,
+- AUFLIRA,
+- AUFNIRA,
+- ALIA,
+- LRA,
+- LIA,
+- NIA,
+- NRA,
+- UFLRA,
+- UFNIA,
+- UFLIRA,
+- QF_ABV,
+- QF_AUFBV,
+- QF_AUFLIA,
+- QF_ALIA,
+- QF_AX,
+- QF_BV,
+- QF_IDL,
+- QF_LIA,
+- QF_LRA,
+- QF_NIA,
+- QF_NRA,
+- QF_RDL,
+- QF_UF,
+- QF_UFBV ,
+- QF_UFIDL,
+- QF_UFLIA,
+- QF_UFLRA,
+- QF_UFNRA,
+- QF_UFNIA,
+- QF_UFLIRA,
+- QF_SLIA
+- ])
+-
+-LOGICS = SMTLIB2_LOGICS | frozenset([ QF_BOOL, BOOL, QF_AUFBVLIRA])
++SMTLIB2_LOGICS = frozenset([AUFLIA,
++ AUFLIRA,
++ AUFNIRA,
++ ALIA,
++ LRA,
++ LIA,
++ NIA,
++ NRA,
++ UFLRA,
++ UFNIA,
++ UFLIRA,
++ QF_ABV,
++ QF_AUFBV,
++ QF_AUFLIA,
++ QF_ALIA,
++ QF_AX,
++ QF_BV,
++ QF_IDL,
++ QF_LIA,
++ QF_LRA,
++ QF_NIA,
++ QF_NRA,
++ QF_RDL,
++ QF_UF,
++ QF_UFBV,
++ QF_UFIDL,
++ QF_UFLIA,
++ QF_UFLRA,
++ QF_UFNRA,
++ QF_UFNIA,
++ QF_UFLIRA,
++ QF_SLIA
++ ])
++
++LOGICS = SMTLIB2_LOGICS | frozenset([QF_BOOL, BOOL, QF_AUFBVLIRA, QF_NIRA])
+
+ QF_LOGICS = frozenset(_l for _l in LOGICS if _l.quantifier_free)
+
+@@ -668,8 +674,8 @@ PYSMT_LOGICS = frozenset([QF_BOOL, QF_IDL, QF_LIA, QF_LRA, QF_RDL, QF_UF, QF_UFI
+ QF_BV, QF_UFBV,
+ QF_ABV, QF_AUFBV, QF_AUFLIA, QF_ALIA, QF_AX,
+ QF_AUFBVLIRA,
+- QF_NRA, QF_NIA, UFBV, BV,
+- ])
++ QF_NRA, QF_NIA, QF_NIRA, UFBV, BV,
++ ])
+
+ # PySMT Logics includes additional features:
+ # - constant arrays: QF_AUFBV becomes QF_AUFBV*
+@@ -697,7 +703,6 @@ for l in PYSMT_LOGICS:
+ ext_logics.add(nl)
+
+
+-
+ LOGICS = LOGICS | frozenset(ext_logics)
+ PYSMT_LOGICS = PYSMT_LOGICS | frozenset(ext_logics)
+
+diff --git a/pysmt/solvers/z3.py b/pysmt/solvers/z3.py
+index 3fb42b9..210b771 100644
+--- a/pysmt/solvers/z3.py
++++ b/pysmt/solvers/z3.py
+@@ -595,6 +595,8 @@ class Z3Converter(Converter, DagWalker):
+ None, None,
+ 0, None,
+ expr.ast)
++ print("Z3: SMTLIB")
++ print(s)
+ stream_in = StringIO(s)
+ r = parser.get_script(stream_in).get_last_formula(self.mgr)
+ key = (askey(expr), None)
+diff --git a/pysmt/test/examples.py b/pysmt/test/examples.py
+index 73455ee..b653185 100644
+--- a/pysmt/test/examples.py
++++ b/pysmt/test/examples.py
+@@ -898,12 +898,12 @@ def get_full_example_formulae(environment=None):
+ logic=pysmt.logics.QF_NRA
+ ),
+
+- Example(hr="((p ^ 2) = 0)",
+- expr=Equals(Pow(p, Int(2)), Int(0)),
++ Example(hr="((p ^ 2) = 0.0)",
++ expr=Equals(Pow(p, Int(2)), Real(0)),
+ is_valid=False,
+ is_sat=True,
+- logic=pysmt.logics.QF_NIA
+- ),
++ logic=pysmt.logics.QF_NIRA
++ ),
+
+ Example(hr="((r ^ 2.0) = 0.0)",
+ expr=Equals(Pow(r, Real(2)), Real(0)),
+diff --git a/pysmt/test/test_back.py b/pysmt/test/test_back.py
+index bceb45b..7a0ad63 100644
+--- a/pysmt/test/test_back.py
++++ b/pysmt/test/test_back.py
+@@ -55,10 +55,10 @@ class TestBasic(TestCase):
+ res = msat.converter.back(term)
+ self.assertFalse(f == res)
+
+- def do_back(self, solver_name, z3_string_buffer=False):
++ def do_back(self, solver_name, via_smtlib=False):
+ for formula, _, _, logic in get_example_formulae():
+ if logic.quantifier_free:
+- if logic.theory.custom_type and z3_string_buffer:
++ if logic.theory.custom_type and via_smtlib:
+ # Printing of declare-sort from Z3 is not conformant
+ # with the SMT-LIB. We might consider extending our
+ # parser.
+@@ -67,7 +67,7 @@ class TestBasic(TestCase):
+ s = Solver(name=solver_name, logic=logic)
+ term = s.converter.convert(formula)
+ if solver_name == "z3":
+- if z3_string_buffer:
++ if via_smtlib:
+ res = s.converter.back_via_smtlib(term)
+ else:
+ res = s.converter.back(term)
+@@ -84,8 +84,8 @@ class TestBasic(TestCase):
+
+ @skipIfSolverNotAvailable("z3")
+ def test_z3_back_formulae(self):
+- self.do_back("z3", z3_string_buffer=False)
+- self.do_back("z3", z3_string_buffer=True)
++ self.do_back("z3", via_smtlib=True)
++ self.do_back("z3", via_smtlib=False)
+
+
+ if __name__ == '__main__':
+diff --git a/pysmt/type_checker.py b/pysmt/type_checker.py
+index b700fcf..7ce05aa 100644
+--- a/pysmt/type_checker.py
++++ b/pysmt/type_checker.py
+@@ -33,6 +33,8 @@ class SimpleTypeChecker(walkers.DagWalker):
+
+ def __init__(self, env=None):
+ walkers.DagWalker.__init__(self, env=env)
++ # Return None if the type cannot be computed rather than
++ # raising an exception.
+ self.be_nice = False
+
+ def _get_key(self, formula, **kwargs):
+@@ -42,7 +44,7 @@ class SimpleTypeChecker(walkers.DagWalker):
+ """ Returns the pysmt.types type of the formula """
+ res = self.walk(formula)
+ if not self.be_nice and res is None:
+- raise PysmtTypeError("The formula '%s' is not well-formed" \
++ raise PysmtTypeError("The formula '%s' is not well-formed"
+ % str(formula))
+ return res
+
+@@ -114,7 +116,7 @@ class SimpleTypeChecker(walkers.DagWalker):
+
+ def walk_bv_comp(self, formula, args, **kwargs):
+ # We check that all children are BV and the same size
+- a,b = args
++ a, b = args
+ if a != b or (not a.is_bv_type()):
+ return None
+ return BVType(1)
+@@ -187,7 +189,7 @@ class SimpleTypeChecker(walkers.DagWalker):
+ if args[0].is_bool_type():
+ raise PysmtTypeError("The formula '%s' is not well-formed."
+ "Equality operator is not supported for Boolean"
+- " terms. Use Iff instead." \
++ " terms. Use Iff instead."
+ % str(formula))
+ elif args[0].is_bv_type():
+ return self.walk_bv_to_bool(formula, args)
+@@ -324,10 +326,7 @@ class SimpleTypeChecker(walkers.DagWalker):
+ def walk_pow(self, formula, args, **kwargs):
+ if args[0] != args[1]:
+ return None
+- # Exponent must be positive for INT
+- if args[0].is_int_type() and formula.arg(1).constant_value() < 0 :
+- return None
+- return args[0]
++ return REAL
+
+ # EOC SimpleTypeChecker
+
diff --git a/gnu/packages/patches/python-pysmt-fix-smtlib-serialization-test.patch b/gnu/packages/patches/python-pysmt-fix-smtlib-serialization-test.patch
new file mode 100644
index 0000000000..eee555f807
--- /dev/null
+++ b/gnu/packages/patches/python-pysmt-fix-smtlib-serialization-test.patch
@@ -0,0 +1,86 @@
+Backport of an upstream patch fixing a test suite failure.
+
+Taken from: https://github.com/pysmt/pysmt/commit/a246669a487aff69f5da34570ef867841d18508a
+
+diff --git a/pysmt/test/smtlib/test_parser_examples.py b/pysmt/test/smtlib/test_parser_examples.py
+index cca4194..c0852be 100644
+--- a/pysmt/test/smtlib/test_parser_examples.py
++++ b/pysmt/test/smtlib/test_parser_examples.py
+@@ -29,6 +29,7 @@ from pysmt.shortcuts import Iff
+ from pysmt.shortcuts import read_smtlib, write_smtlib, get_env
+ from pysmt.exceptions import PysmtSyntaxError
+
++
+ class TestSMTParseExamples(TestCase):
+
+ def test_parse_examples(self):
+@@ -41,7 +42,6 @@ class TestSMTParseExamples(TestCase):
+ buf = StringIO()
+ script_out = smtlibscript_from_formula(f_out)
+ script_out.serialize(outstream=buf)
+- #print(buf)
+
+ buf.seek(0)
+ parser = SmtLibParser()
+@@ -49,7 +49,6 @@ class TestSMTParseExamples(TestCase):
+ f_in = script_in.get_last_formula()
+ self.assertEqual(f_in.simplify(), f_out.simplify())
+
+-
+ @skipIfNoSolverForLogic(logics.QF_BV)
+ def test_parse_examples_bv(self):
+ """For BV we represent a superset of the operators defined in SMT-LIB.
+@@ -108,7 +107,18 @@ class TestSMTParseExamples(TestCase):
+ self.assertValid(Iff(f_in, f_out), f_in.serialize())
+
+ def test_dumped_logic(self):
+- # Dumped logic matches the logic in the example
++ # Dumped logic matches the logic in the example.
++ #
++ # There are a few cases where we use a logic
++ # that does not exist in SMT-LIB, and the SMT-LIB
++ # serialization logic will find a logic that
++ # is more expressive. We need to adjust the test
++ # for those cases (see rewrite dict below).
++ rewrite = {
++ logics.QF_BOOL: logics.QF_UF,
++ logics.BOOL: logics.LRA,
++ logics.QF_NIRA: logics.AUFNIRA,
++ }
+ fs = get_example_formulae()
+
+ for (f_out, _, _, logic) in fs:
+@@ -121,14 +131,9 @@ class TestSMTParseExamples(TestCase):
+ for cmd in script_in:
+ if cmd.name == "set-logic":
+ logic_in = cmd.args[0]
+- if logic == logics.QF_BOOL:
+- self.assertEqual(logic_in, logics.QF_UF)
+- elif logic == logics.BOOL:
+- self.assertEqual(logic_in, logics.LRA)
+- else:
+- self.assertEqual(logic_in, logic, script_in)
++ self.assertEqual(logic_in, rewrite.get(logic, logic))
+ break
+- else: # Loops exited normally
++ else: # Loops exited normally
+ print("-"*40)
+ print(script_in)
+
+@@ -136,7 +141,7 @@ class TestSMTParseExamples(TestCase):
+ fs = get_example_formulae()
+
+ fdi, tmp_fname = mkstemp()
+- os.close(fdi) # Close initial file descriptor
++ os.close(fdi) # Close initial file descriptor
+ for (f_out, _, _, _) in fs:
+ write_smtlib(f_out, tmp_fname)
+ # with open(tmp_fname) as fin:
+@@ -197,7 +202,6 @@ class TestSMTParseExamples(TestCase):
+ f_in = script.get_last_formula()
+ self.assertSat(f_in)
+
+-
+ def test_int_promotion_define_fun(self):
+ script = """
+ (define-fun x () Int 8)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index f9bd733ecd..0c6265f60e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32303,6 +32303,38 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-pysmt
+ (package
+ (name "python-pysmt")
+ (version "0.9.5")
+ (source
+ (origin
+ (method git-fetch)
+ (patches (search-patches "python-pysmt-fix-pow-return-type.patch"
+ "python-pysmt-fix-smtlib-serialization-test.patch"))
+ (uri (git-reference
+ (url "https://github.com/pysmt/pysmt")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0hrxv23y5ip4ijfx5pvbwc2fq4zg9jz42wc9zqgqm0g0mjc9ckvh"))))
+ (build-system pyproject-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (add-before 'check 'set-pysmt-solver
+ (lambda _
+ (setenv "PYSMT_SOLVER" "z3"))))))
+ (native-inputs (list python-pytest))
+ (propagated-inputs (list z3))
+ (home-page "https://github.com/pysmt/pysmt")
+ (synopsis
+ "Solver-agnostic library for SMT formula manipulation and solving")
+ (description
+ "This Python module provides a solver-agnostic abstraction for
+working with @acronym{SMT, Satisfiability Modulo Theory} formulas. For example,
+it allows manipulation and solving such formulas.")
+ (license license:asl2.0)))
+
(define-public python-rpyc
(package
(name "python-rpyc")
S
S
soeren wrote on 10 Mar 21:09 +0100
[PATCH v2 07/14] gnu: Add python-claripy.
(address . 69074@debbugs.gnu.org)(address . troy@troyfigiel.com)
504c280dd5ccde02f5c844b6c6a0f6aaccb6551b.1710101374.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-claripy): New variable.
---
gnu/packages/python-xyz.scm | 39 +++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

Toggle diff (50 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 0c6265f60e..58a6855850 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32303,6 +32303,45 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-claripy
+ (package
+ (name "python-claripy")
+ ;; Must be the same version as python-angr.
+ (version "9.2.46")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/angr/claripy")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0nmawpi1596d9plafrp2db36cjsidy2fagkzkja51jwlx2m1ngai"))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ (substitute* "setup.cfg"
+ ;; Relax the z3 version constraint.
+ ;; See https://github.com/angr/claripy/commit/d1fe2df
+ (("z3-solver==4.10.2.0")
+ ""))))))
+ (build-system pyproject-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (with-directory-excursion "tests"
+ (invoke "python" "-m" "unittest"))))))))
+ (propagated-inputs (list python-cachetools python-decorator python-pysmt
+ z3))
+ (home-page "https://github.com/angr/claripy")
+ (synopsis "Abstraction layer for constraint solvers")
+ (description
+ "This Python module provides an abstraction layer for interacting
+with constraint solvers. Specifically, it is intended to be used with
+SMT solvers and is built on top of the Z3 solver.")
+ (license license:bsd-2)))
+
(define-public python-pysmt
(package
(name "python-pysmt")
S
S
soeren wrote on 10 Mar 21:09 +0100
[PATCH v2 08/14] gnu: Add python-archinfo.
(address . 69074@debbugs.gnu.org)(address . troy@troyfigiel.com)
a26261c367807bd46669f3efb05b7079a1524206.1710101374.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/emulators.scm (python-archinfo): New variable.
---
gnu/packages/emulators.scm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

Toggle diff (46 lines)
diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index 43af9804e5..28bb1ac3cf 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -66,6 +66,7 @@ (define-module (gnu packages emulators)
#:use-module (gnu packages cross-base)
#:use-module (gnu packages curl)
#:use-module (gnu packages digest)
+ #:use-module (gnu packages engineering)
#:use-module (gnu packages elf)
#:use-module (gnu packages flex)
#:use-module (gnu packages fltk)
@@ -2619,6 +2620,33 @@ (define-public python-keystone-engine
assembly for these architectures.")
(license license:gpl2)))
+(define-public python-archinfo
+ (package
+ (name "python-archinfo")
+ ;; Must be the same version as python-angr.
+ (version "9.2.46")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "archinfo" version))
+ (sha256
+ (base32 "037xfq3wcf8ngayxz9623l4646m780v2102mfbygpzbkkjha1966"))))
+ (build-system pyproject-build-system)
+ (propagated-inputs (list python-capstone python-keystone-engine))
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (with-directory-excursion "tests"
+ (invoke "python" "-m" "unittest"))))))))
+ (home-page "https://github.com/angr/archinfo")
+ (synopsis "Extract architecture-specific information from binaries")
+ (description
+ "Collection of classes that contain architecture-specific information
+information. Useful for cross-architecture tools (such as @code{python-pyvex}).")
+ (license license:bsd-2)))
+
(define-public emu8051
(let ((commit "5dc681275151c4a5d7b85ec9ff4ceb1b25abd5a8")
(revision "1"))
S
S
soeren wrote on 10 Mar 21:09 +0100
[PATCH v2 09/14] gnu: Add python-pyvex.
(address . 69074@debbugs.gnu.org)(address . troy@troyfigiel.com)
cef99276565fb2f3be1343491e4a358a97f67a29.1710101374.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/patches/python-pyvex-remove-angr-dependency.patch:
New patch.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/python-xyz.scm (python-pyvex): New variable.
---
gnu/local.mk | 1 +
.../python-pyvex-remove-angr-dependency.patch | 80 +++++++++++++++++++
gnu/packages/python-xyz.scm | 37 +++++++++
3 files changed, 118 insertions(+)
create mode 100644 gnu/packages/patches/python-pyvex-remove-angr-dependency.patch

Toggle diff (153 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 1946fdcbb6..ecbae4bb53 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1930,6 +1930,7 @@ dist_patch_DATA = \
%D%/packages/patches/python-pytorch-runpath.patch \
%D%/packages/patches/python-pytorch-system-libraries.patch \
%D%/packages/patches/python-pytorch-1.9.0-system-libraries.patch \
+ %D%/packages/patches/python-pyvex-remove-angr-dependency.patch \
%D%/packages/patches/python-robotframework-atest.patch \
%D%/packages/patches/python-robotframework-source-date-epoch.patch \
%D%/packages/patches/python-robotframework-sshlibrary-rf5-compat.patch \
diff --git a/gnu/packages/patches/python-pyvex-remove-angr-dependency.patch b/gnu/packages/patches/python-pyvex-remove-angr-dependency.patch
new file mode 100644
index 0000000000..dccf22bbc6
--- /dev/null
+++ b/gnu/packages/patches/python-pyvex-remove-angr-dependency.patch
@@ -0,0 +1,80 @@
+This patch removes the angr dependency from the pyvex these, thus
+resolving a circular dependency (as angr depends on pyvex). This
+patch has been taken from upstream.
+
+This patch is a squashed version of the following upstream patches:
+
+* https://github.com/angr/pyvex/commit/61fb26f223a8d8a276b702d2448a12e02c5c9c6b
+* https://github.com/angr/pyvex/commit/a1fb2a4d0826b0e43bd8bbdd00b6db032643ec95
+
+diff --git a/tests/test_spotter.py b/tests/test_spotter.py
+index 9271ccd..bed7dd4 100644
+--- a/tests/test_spotter.py
++++ b/tests/test_spotter.py
+@@ -1,6 +1,5 @@
+ import os
+
+-import angr
+ import archinfo
+
+ import pyvex
+@@ -98,53 +97,28 @@ class CortexSpotter(GymratLifter):
+ register(CortexSpotter, "ARMEL")
+
+
+-def test_full_binary():
+- p = angr.Project(
+- os.path.join(test_location, "armel", "RTOSDemo.axf.issue_685"),
+- arch="ARMEL",
+- auto_load_libs=False,
+- )
+- st = p.factory.call_state(0x000013CE + 1)
+- b = st.block().vex
+- simgr = p.factory.simulation_manager(st)
+- simgr.step()
+- assert b.jumpkind == "Ijk_Sys_syscall"
+- assert simgr.active[0].regs.ip_at_syscall.args[0] == 0x13FB
+-
+-
+ def test_tmrs():
+- test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../binaries/tests"))
+- p = angr.Project(
+- os.path.join(test_location, "armel", "helloworld"),
+- arch="ARMEL",
+- auto_load_libs=False,
+- )
++ arch = archinfo.arch_from_id("ARMEL")
+ ins = b"\xef\xf3\x08\x82"
+- b = pyvex.block.IRSB(ins, 1, p.arch)
++ b = pyvex.block.IRSB(ins, 1, arch)
+ assert b.jumpkind == "Ijk_Boring"
+ assert type(b.statements[1].data) == pyvex.expr.Get
+- assert p.arch.register_names.get(b.statements[1].data.offset, "") == "sp"
++ assert arch.register_names.get(b.statements[1].data.offset, "") == "sp"
+ assert type(b.statements[2]) == pyvex.stmt.Put
+
+
+ def test_tmsr():
+- test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), "../../binaries/tests"))
+- p = angr.Project(
+- os.path.join(test_location, "armel", "helloworld"),
+- arch="ARMEL",
+- auto_load_libs=False,
+- )
++ arch = archinfo.arch_from_id("ARMEL")
+ inss = b"\x82\xf3\x08\x88"
+- b = pyvex.block.IRSB(inss, 1, p.arch, opt_level=3)
++ b = pyvex.block.IRSB(inss, 1, arch, opt_level=3)
+ assert b.jumpkind == "Ijk_Boring"
+ assert type(b.statements[1].data) == pyvex.expr.Get
+- assert p.arch.register_names.get(b.statements[1].data.offset, "") == "r2"
++ assert arch.register_names.get(b.statements[1].data.offset, "") == "r2"
+ assert type(b.statements[2]) == pyvex.stmt.Put
+
+
+ if __name__ == "__main__":
+ test_basic()
+ test_embedded()
+- test_full_binary()
+ test_tmrs()
+ test_tmsr()
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 58a6855850..392df37f2b 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -189,6 +189,7 @@ (define-module (gnu packages python-xyz)
#:use-module (gnu packages djvu)
#:use-module (gnu packages docker)
#:use-module (gnu packages documentation)
+ #:use-module (gnu packages emulators)
#:use-module (gnu packages enchant)
#:use-module (gnu packages file)
#:use-module (gnu packages fonts)
@@ -32303,6 +32304,42 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-pyvex
+ (package
+ (name "python-pyvex")
+ ;; Must be the same version as python-angr.
+ (version "9.2.46")
+ (source
+ (origin
+ (method url-fetch)
+ (patches (search-patches "python-pyvex-remove-angr-dependency.patch"))
+ (uri (pypi-uri "pyvex" version))
+ (sha256
+ (base32 "1v64rn7gxy6fg065bgsy38z6r494k5ri5r6sn4g08hjj32ihx1ka"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:phases #~(modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (with-directory-excursion "tests"
+ (invoke "python" "-m" "unittest")))))
+
+ (add-before 'build 'set-cc-native
+ (lambda _
+ (setenv "CC" #$(cc-for-target))
+ (setenv "CC_NATIVE" "gcc"))))))
+ (propagated-inputs (list python-archinfo python-bitstring python-cffi))
+ (home-page "https://github.com/angr/pyvex")
+ (synopsis "Python interface to libVEX and VEX IR")
+ (description
+ "This package provides a Python interface the libVEX and VEX IR.
+VEX is the intermediate representation (also known as intermediate
+language) used by the Valgrind analysis tool. As such, VEX is designed
+to enable all kinds of binary analysis tasks.")
+ (license license:bsd-2)))
+
(define-public python-claripy
(package
(name "python-claripy")
S
S
soeren wrote on 10 Mar 21:09 +0100
[PATCH v2 10/14] gnu: Add python-cle.
(address . 69074@debbugs.gnu.org)(address . troy@troyfigiel.com)
4703336301eee2463b26cbe353b257c455b76bca.1710101374.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-cle): New variable.
---
gnu/packages/python-xyz.scm | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)

Toggle diff (46 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 392df37f2b..76f115f6d0 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32304,6 +32304,32 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-cle
+ (package
+ (name "python-cle")
+ ;; Must be the same version as python-angr.
+ (version "9.2.46")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "cle" version))
+ (sha256
+ (base32 "0mswv9gd2p2ws7zfsshqv5ybbj27wkdwakdcknq4vsrx9ry9k4yc"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:tests? #f))
+ (propagated-inputs (list python-pefile python-pyelftools python-pyvex
+ python-sortedcontainers))
+ (native-inputs (list python-cffi))
+ (home-page "https://github.com/angr/cle")
+ (synopsis "Python loader for binaries and their associated libraries")
+ (description
+ "CLE loads binaries and their associated libraries, resolves
+imports and provides an abstraction of process memory the same way as if
+it was loader by the operating system's loader.")
+ (license license:bsd-2)))
+
(define-public python-pyvex
(package
(name "python-pyvex")
@@ -32326,7 +32352,7 @@ (define-public python-pyvex
(with-directory-excursion "tests"
(invoke "python" "-m" "unittest")))))
- (add-before 'build 'set-cc-native
+ (add-before 'build 'set-cc
(lambda _
(setenv "CC" #$(cc-for-target))
(setenv "CC_NATIVE" "gcc"))))))
S
S
soeren wrote on 10 Mar 21:09 +0100
[PATCH v2 11/14] gnu: Add python-ailment.
(address . 69074@debbugs.gnu.org)(address . troy@troyfigiel.com)
ffae0b0c7e4b4d2b6dfa7e878d21351a4628ba5b.1710101374.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/python-xyz.scm (python-ailment): New variable.
---
gnu/packages/python-xyz.scm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

Toggle diff (39 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 76f115f6d0..7c85404c2a 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32304,6 +32304,34 @@ (define-public python-opcodes
and BMI2).")
(license license:bsd-2))))
+(define-public python-ailment
+ (package
+ (name "python-ailment")
+ ;; Must be the same version as python-angr.
+ (version "9.2.46")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "ailment" version))
+ (sha256
+ (base32 "073fcssbjis1ckwv2w0dcz2dfl6715bj4d4qdhspajj911mvng2f"))))
+ (build-system pyproject-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (replace 'check
+ ;; Many tests are skipped due to cyclic dependencies.
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (with-directory-excursion "tests"
+ (invoke "python" "-m" "unittest"))))))))
+ (home-page "https://github.com/angr/ailment")
+ (synopsis "The angr intermediate language")
+ (description
+ "This Python module implements an @acronym{IL, Intermediate Language},
+also known as @acronym{IR, Intermediate Representation}, used by the angr
+binary analysis platform.")
+ (license license:bsd-2)))
+
(define-public python-cle
(package
(name "python-cle")
S
S
soeren wrote on 10 Mar 21:09 +0100
[PATCH v2 12/14] gnu: unicorn: Update to 2.0.1.post1.
(address . 69074@debbugs.gnu.org)(address . troy@troyfigiel.com)
354c7b431967b4dd15a9e4279f03242afbee156f.1710101374.git.soeren@soeren-tempel.net
From: c4droid <c4droid@foxmail.com>

* gnu/packages/emulators.scm (unicorn) Update to 2.0.1.post1.

Co-authored-by: Sören Tempel <soeren@soeren-tempel.net>
---
gnu/packages/emulators.scm | 119 +++++++------------------------------
1 file changed, 20 insertions(+), 99 deletions(-)

Toggle diff (152 lines)
diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index 28bb1ac3cf..90debdcf76 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -21,6 +21,7 @@
;;; Copyright © 2023 Yovan Naumovski <yovan@gorski.stream>
;;; Copyright © 2023 Hendursaga <hendursaga@aol.com>
;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
+;;; Copyright © 2024 Sören Tempel <soeren@soeren-tempel.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -61,6 +62,7 @@ (define-module (gnu packages emulators)
#:use-module (gnu packages boost)
#:use-module (gnu packages cdrom)
#:use-module (gnu packages check)
+ #:use-module (gnu packages cmake)
#:use-module (gnu packages compression)
#:use-module (gnu packages containers)
#:use-module (gnu packages cross-base)
@@ -114,6 +116,7 @@ (define-module (gnu packages emulators)
#:use-module (guix build-system gnu)
#:use-module (guix build-system meson)
#:use-module (guix build-system python)
+ #:use-module (guix build-system pyproject)
#:use-module (guix build-system qt))
(define-public vice
@@ -2192,106 +2195,24 @@ (define-public bsnes
performance, features, and ease of use.")
(license license:gpl3)))
-;; python-pwntools requires a -rc release of unicorn
(define-public unicorn
- (let ((unless-x86
- (lambda (code)
- (if (member (%current-system) '("x86_64-linux" "i686-linux"))
- '()
- code))))
- (package
- (name "unicorn")
- (version "1.0.2-rc4")
- ;; NOTE: unicorn ships a bundled QEMU, but with a lot of custom modifications.
- (source
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/unicorn-engine/unicorn")
- (commit version)))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "17nyccgk7hpc4hab24yn57f1xnmr7kq4px98zbp2bkwcrxny8gwy"))))
- (outputs '("out" "python"))
- ;; The main library is not written in Python, but the build process has
- ;; little in common with any defined build system, so we might as well
- ;; build on top of python-build-system and make use of all
- ;; the Python-specific phases that can be reused.
- (build-system python-build-system)
- (arguments
- `(#:modules ((srfi srfi-26)
- (guix build python-build-system)
- (guix build utils))
- #:phases
- (modify-phases %standard-phases
- (add-before 'build 'build-library
- (lambda* (#:key inputs #:allow-other-keys)
- (invoke "make"
- "-j" (number->string (parallel-job-count))
- "UNICORN_STATIC=no"
- "CC=gcc")))
- (add-after 'build-library 'install-library
- (lambda* (#:key outputs #:allow-other-keys)
- (invoke "make" "install"
- "UNICORN_STATIC=no"
- (string-append
- "PREFIX="
- (assoc-ref outputs "out")))))
- (add-before 'build 'prepare-bindings
- (lambda* (#:key outputs #:allow-other-keys)
- (chdir "bindings/python")
- ;; Set this environment variable so that the Python bindings
- ;; don't build their own copy of the shared object, but use
- ;; a dummy value such that the bindings test suite uses the
- ;; same mechanism for loading the library as any other user.
- (setenv "LIBUNICORN_PATH" "1")
- (substitute* "unicorn/unicorn.py"
- (("_path_list = \\[.*")
- (string-append
- "_path_list = [\""
- (assoc-ref outputs "out")
- ;; eat the rest of the list
- "/lib\"] + 0*[")))
- #t))
- (add-before 'check 'check-library
- (lambda* (#:key outputs #:allow-other-keys)
- (for-each
- (lambda (suite)
- (with-directory-excursion
- (string-append "../../tests/" suite)
- (invoke "make" "test" "CC=gcc"
- ,@(unless-x86
- '("AS=i686-unknown-linux-gnu-as"
- "OBJCOPY=i686-unknown-linux-gnu-objcopy")))))
- '("unit" "regress"))
- #t))
- (add-after 'install 'install-samples
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((python-samples (find-files "." "sample_.*"))
- (c-samples (find-files "../../samples" ".*\\.c"))
- (python-docdir
- (string-append (assoc-ref outputs "python")
- "/share/doc/unicorn/samples"))
- (c-docdir
- (string-append (assoc-ref outputs "out")
- "/share/doc/unicorn/samples")))
- (for-each (cut install-file <> c-docdir) c-samples)
- (for-each (cut install-file <> python-docdir) python-samples)
- #t))))))
- (native-inputs
- ;; NOTE: cross-binutils needs to be wrapped with unless-x86, as otherwise
- ;; the linker provided by the package will be used, circumventing the ld-wrapper.
- `(,@(unless-x86
- `(("assembler-for-tests" ,(cross-binutils "i686-unknown-linux-gnu"))))
- ("cmocka" ,cmocka)
- ("hexdump-for-tests" ,util-linux)))
- (home-page "https://www.unicorn-engine.org")
- (synopsis "Unicorn CPU emulator framework")
- (description
- "Unicorn is a lightweight, multi-platform, multi-architecture CPU emulator
-framework based on QEMU.")
- (license license:gpl2+))))
+ (package
+ (name "unicorn")
+ (version "2.0.1.post1")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri name version))
+ (sha256
+ (base32
+ "0mlfs8qfi0clyncfkbxp6in0cpl747510i6bqymwid43xcirbikz"))))
+ (build-system pyproject-build-system)
+ (native-inputs (list cmake pkg-config))
+ (home-page "https://www.unicorn-engine.org")
+ (synopsis "Generic CPU emulator framework")
+ (description
+ "Uniforn is a lightweight, multi-platform, multi-architecture CPU
+emulator framework based on QEMU.")
+ (license license:gpl2+)))
(define-public ppsspp
(package
S
S
Sören Tempel wrote on 10 Mar 21:12 +0100
Re: [bug#69074] [PATCH] Add python-angr.
(address . 69074@debbugs.gnu.org)(address . troy@troyfigiel.com)
3F8X2Q5S9RUQP.2PBT94JRGRMIB@8pit.net
Hi,

Thanks again for your feedback!

I believe I implemented most of your suggestions. Most importantly, I
believe, I resolved the cyclic dependency between python-xyz.scm and
engineering.scm. Further comments below.

Toggle quote (4 lines)
> - Regarding binaries, I am honestly not sure how these would be best handled.
> They are binaries, but without them there might not be much to test anyway...
> A second opinion would be good here.

I don't think there is an issue with the binaries. angr is a binary
analysis tools. Naturally, the test suite will need sample binaries
for testing purposes. The GNU FSDG has an explicit clause regarding
"non-functional data", I believe this very much applies here as these
binaries are not executed and only needed for testing angr's analysis
capabilities. Without the binaries there are no tests to run for angr.
I would strongly advocate for not disabling the angr test suite as
running it on Guix has resulted in the discovery bugs both in angr
and in capstone [1, 2].

Toggle quote (2 lines)
> I noticed you set them to version 9.2.46, but this is not the latest version.

Newer version of angr will require an update of the python-rich and
python-pygments Guix package. Since this would entail a lot of rebuilds
(and the upstream integration of the present changeset has already been
quite effortful), I opted for packaging an "older" version of angr for
now which does not depend on python-rich yet. As soon as python-rich and
python-pygments are updated, we can update angr too.

Toggle quote (3 lines)
> The versions of all other angr packages you added are also set to
> 9.2.46. It looks like this is on purpose, or not?

This is intended, all of these packages are distributed by the angr
development team and need to be set to the same version as angr itself.
I added a corresponding comment.

Toggle quote (4 lines)
> I see that you back ported some upstream patches. I tend to use patches
> more as a last resort and whenever possible I stick to upstream
> versions and commits (in that order of preference).

With the exception of one patch these are all upstreamed patches. I
don't want to package unreleased Git versions of these packages and
I think it's therefore preferable to just backport the bug fixes. Also
consider that angr is very sensitive to versions of packages distributed
by angr developers (see the prior comment).

Toggle quote (3 lines)
> - Hope this helps! The rest LGTM. I will ping the Python team, so
> someone with commit rights can have a look.

Yea, the feedback definitely helps. Would also love to hear from the
Python team. What is left to do in order to get this merged?

Greetings
Sören

S
S
soeren wrote on 10 Mar 21:09 +0100
[PATCH v2 13/14] gnu: capstone: Backport upstream fix for Python bindings.
(address . 69074@debbugs.gnu.org)(address . troy@troyfigiel.com)
ba2ca0de42c3a792474064619e9374cbf195ee51.1710101374.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/patches/python-capstone-fix-python-constants.patch:
New patch.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/engineering.scm (capstone): New patch.
---
gnu/local.mk | 1 +
gnu/packages/engineering.scm | 2 +
...python-capstone-fix-python-constants.patch | 84 +++++++++++++++++++
3 files changed, 87 insertions(+)
create mode 100644 gnu/packages/patches/python-capstone-fix-python-constants.patch

Toggle diff (122 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index ecbae4bb53..ce0f1994c5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1901,6 +1901,7 @@ dist_patch_DATA = \
%D%/packages/patches/python-3-hurd-configure.patch \
%D%/packages/patches/python-aionotify-0.2.0-py3.8.patch \
%D%/packages/patches/python-argcomplete-1.11.1-fish31.patch \
+ %D%/packages/patches/python-capstone-fix-python-constants.patch \
%D%/packages/patches/python-cross-compile.patch \
%D%/packages/patches/python-configobj-setuptools.patch \
%D%/packages/patches/python-dateutil-pytest-compat.patch \
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 16f572909c..336c8b0e38 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -39,6 +39,7 @@
;;; Copyright © 2023 Theofilos Pechlivanis <theofilos.pechlivanis@gmail.com>
;;; Copyright © 2023 Sharlatan Hellseher <sharlatanus@gmail.com>
;;; Copyright © 2023 pinoaffe <pinoaffe@gmail.com>
+;;; Copyright © 2024 Sören Tempel <soeren@soeren-tempel.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1815,6 +1816,7 @@ (define-public capstone
(version "5.0.1")
(source (origin
(method git-fetch)
+ (patches (search-patches "python-capstone-fix-python-constants.patch"))
(uri (git-reference
(url "https://github.com/capstone-engine/capstone")
(commit version)))
diff --git a/gnu/packages/patches/python-capstone-fix-python-constants.patch b/gnu/packages/patches/python-capstone-fix-python-constants.patch
new file mode 100644
index 0000000000..75100c6652
--- /dev/null
+++ b/gnu/packages/patches/python-capstone-fix-python-constants.patch
@@ -0,0 +1,84 @@
+Backport upstream patch fixing various constants in the Python bindings.
+
+Taken from: https://github.com/capstone-engine/capstone/commit/f180e176de3efb060db62820ff981d0291ea8525
+
+diff --git a/bindings/python/capstone/__init__.py b/bindings/python/capstone/__init__.py
+index bda2fdb6..52353c28 100755
+--- a/bindings/python/capstone/__init__.py
++++ b/bindings/python/capstone/__init__.py
+@@ -113,7 +113,6 @@ __all__ = [
+ 'CS_OPT_SYNTAX_NOREGNAME',
+ 'CS_OPT_SYNTAX_MASM',
+ 'CS_OPT_SYNTAX_MOTOROLA',
+- 'CS_OPT_SYNTAX_CS_REG_ALIAS',
+
+ 'CS_OPT_DETAIL',
+ 'CS_OPT_MODE',
+@@ -152,19 +151,6 @@ __all__ = [
+ 'CS_OP_REG',
+ 'CS_OP_IMM',
+ 'CS_OP_FP',
+- 'CS_OP_PRED',
+- 'CS_OP_RESERVED_5',
+- 'CS_OP_RESERVED_6',
+- 'CS_OP_RESERVED_7',
+- 'CS_OP_RESERVED_8',
+- 'CS_OP_RESERVED_9',
+- 'CS_OP_RESERVED_10',
+- 'CS_OP_RESERVED_11',
+- 'CS_OP_RESERVED_12',
+- 'CS_OP_RESERVED_13',
+- 'CS_OP_RESERVED_14',
+- 'CS_OP_RESERVED_15',
+- 'CS_OP_SPECIAL',
+ 'CS_OP_MEM',
+
+ 'CS_GRP_INVALID',
+@@ -298,26 +284,13 @@ CS_OPT_NO_BRANCH_OFFSET = 9 # ARM, prints branch immediates without offset.
+
+ # Capstone option value
+ CS_OPT_OFF = 0 # Turn OFF an option - default option of CS_OPT_DETAIL
+-CS_OPT_ON = 1 << 0 # Turn ON an option (CS_OPT_DETAIL)
++CS_OPT_ON = 3 # Turn ON an option (CS_OPT_DETAIL)
+
+ # Common instruction operand types - to be consistent across all architectures.
+ CS_OP_INVALID = 0 # uninitialized/invalid operand.
+ CS_OP_REG = 1 # Register operand.
+ CS_OP_IMM = 2 # Immediate operand.
+ CS_OP_FP = 3 # Floating-Point operand.
+-CS_OP_PRED = 4 # Predicate operand.
+-CS_OP_RESERVED_5 = 5
+-CS_OP_RESERVED_6 = 6
+-CS_OP_RESERVED_7 = 7
+-CS_OP_RESERVED_8 = 8
+-CS_OP_RESERVED_9 = 9
+-CS_OP_RESERVED_10 = 10
+-CS_OP_RESERVED_11 = 11
+-CS_OP_RESERVED_12 = 12
+-CS_OP_RESERVED_13 = 13
+-CS_OP_RESERVED_14 = 14
+-CS_OP_RESERVED_15 = 15
+-CS_OP_SPECIAL = 0x10 # Special operands from archs
+ CS_OP_MEM = 0x80 # Memory operand. Can be ORed with another operand type.
+
+ # Common instruction groups - to be consistent across all architectures.
+@@ -336,13 +309,12 @@ CS_AC_READ = (1 << 0) # Operand that is read from.
+ CS_AC_WRITE = (1 << 1) # Operand that is written to.
+
+ # Capstone syntax value
+-CS_OPT_SYNTAX_DEFAULT = 1 << 1 # Default assembly syntax of all platforms (CS_OPT_SYNTAX)
+-CS_OPT_SYNTAX_INTEL = 1 << 2 # Intel X86 asm syntax - default syntax on X86 (CS_OPT_SYNTAX, CS_ARCH_X86)
+-CS_OPT_SYNTAX_ATT = 1 << 3 # ATT asm syntax (CS_OPT_SYNTAX, CS_ARCH_X86)
+-CS_OPT_SYNTAX_NOREGNAME = 1 << 4 # Asm syntax prints register name with only number - (CS_OPT_SYNTAX, CS_ARCH_PPC, CS_ARCH_ARM)
+-CS_OPT_SYNTAX_MASM = 1 << 5 # MASM syntax (CS_OPT_SYNTAX, CS_ARCH_X86)
+-CS_OPT_SYNTAX_MOTOROLA = 1 << 6 # MOS65XX use $ as hex prefix
+-CS_OPT_SYNTAX_CS_REG_ALIAS = 1 << 7 # Prints common register alias which are not defined in LLVM (ARM: r9 = sb etc.)
++CS_OPT_SYNTAX_DEFAULT = 0 # Default assembly syntax of all platforms (CS_OPT_SYNTAX)
++CS_OPT_SYNTAX_INTEL = 1 # Intel X86 asm syntax - default syntax on X86 (CS_OPT_SYNTAX, CS_ARCH_X86)
++CS_OPT_SYNTAX_ATT = 2 # ATT asm syntax (CS_OPT_SYNTAX, CS_ARCH_X86)
++CS_OPT_SYNTAX_NOREGNAME = 3 # Asm syntax prints register name with only number - (CS_OPT_SYNTAX, CS_ARCH_PPC, CS_ARCH_ARM)
++CS_OPT_SYNTAX_MASM = 4 # MASM syntax (CS_OPT_SYNTAX, CS_ARCH_X86)
++CS_OPT_SYNTAX_MOTOROLA = 5 # MOS65XX use $ as hex prefix
+
+ # Capstone error type
+ CS_ERR_OK = 0 # No error: everything was fine
S
S
soeren wrote on 10 Mar 21:09 +0100
[PATCH v2 14/14] gnu: Add python-angr.
(address . 69074@debbugs.gnu.org)(address . troy@troyfigiel.com)
cfe1e1ee6829877978e1f86b8172024e70bd34ec.1710101374.git.soeren@soeren-tempel.net
From: Sören Tempel <soeren@soeren-tempel.net>

* gnu/packages/patches/python-angr-addition-type-error.patch:
New patch.
* gnu/packages/patches/python-angr-check-exec-deps.patch:
New patch.
* gnu/local.mk (dist_patch_DATA): Add them.
* gnu/packages/python-xyz.scm (python-angr): New variable.
---
gnu/local.mk | 2 +
.../python-angr-addition-type-error.patch | 18 ++++
.../patches/python-angr-check-exec-deps.patch | 93 ++++++++++++++++++
gnu/packages/python-xyz.scm | 96 +++++++++++++++++++
4 files changed, 209 insertions(+)
create mode 100644 gnu/packages/patches/python-angr-addition-type-error.patch
create mode 100644 gnu/packages/patches/python-angr-check-exec-deps.patch

Toggle diff (243 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index ce0f1994c5..8bbf66cc1e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1899,6 +1899,8 @@ dist_patch_DATA = \
%D%/packages/patches/python-3-search-paths.patch \
%D%/packages/patches/python-3-fix-tests.patch \
%D%/packages/patches/python-3-hurd-configure.patch \
+ %D%/packages/patches/python-angr-addition-type-error.patch \
+ %D%/packages/patches/python-angr-check-exec-deps.patch \
%D%/packages/patches/python-aionotify-0.2.0-py3.8.patch \
%D%/packages/patches/python-argcomplete-1.11.1-fish31.patch \
%D%/packages/patches/python-capstone-fix-python-constants.patch \
diff --git a/gnu/packages/patches/python-angr-addition-type-error.patch b/gnu/packages/patches/python-angr-addition-type-error.patch
new file mode 100644
index 0000000000..7301d8b505
--- /dev/null
+++ b/gnu/packages/patches/python-angr-addition-type-error.patch
@@ -0,0 +1,18 @@
+This fixes failures of the test_ln_gcc_O2 and other related tests
+in the angr test suite. The patch has been proposed upstream.
+
+Taken form: https://github.com/angr/angr/pull/4443
+
+diff --git a/angr/analyses/reassembler.py b/angr/analyses/reassembler.py
+index 7a2399a60..b09b3a8cb 100644
+--- a/angr/analyses/reassembler.py
++++ b/angr/analyses/reassembler.py
+@@ -730,7 +730,7 @@ class Instruction:
+ elif operand.type == capstone.CS_OP_MEM:
+ operand_offsets.append(capstone_instr.disp_offset)
+ else:
+- operand_offsets.append(None)
++ operand_offsets.append(0)
+
+ if self.addr is not None:
+ self._initialize(capstone_instr.operands, operand_offsets)
diff --git a/gnu/packages/patches/python-angr-check-exec-deps.patch b/gnu/packages/patches/python-angr-check-exec-deps.patch
new file mode 100644
index 0000000000..438f8ef183
--- /dev/null
+++ b/gnu/packages/patches/python-angr-check-exec-deps.patch
@@ -0,0 +1,93 @@
+The angr test suite performs analysis on several pre-compiled binaries
+to ensure its binary analysis capabilities are working as intended.
+Some of these binaries are also executed as part of the test suite to
+test if the simulation engine provided by angr results in the same
+output as native execution of the binary.
+
+For Guix, this files as the glibc shared objects cannot be found.
+Additionally, we don't really want to execute pre-compiled binaries
+on Guix, hence we disable those tests.
+
+diff --git a/tests/test_ctype_locale.py b/tests/test_ctype_locale.py
+index 08cb89836..2b9233558 100644
+--- a/tests/test_ctype_locale.py
++++ b/tests/test_ctype_locale.py
+@@ -14,7 +14,7 @@ test_location = os.path.dirname(os.path.abspath(__file__))
+
+
+ class TestCtypeLocale(unittest.TestCase):
+- @skip_if_not_linux
++ @unittest.skip("test executes pre-compiled binaries")
+ def test_ctype_b_loc(self):
+ """
+ test_ctype_locale.test_ctype_b_loc
+@@ -60,7 +60,7 @@ class TestCtypeLocale(unittest.TestCase):
+ output = subprocess.check_output(bin_path, shell=True)
+ assert result == output
+
+- @skip_if_not_linux
++ @unittest.skip("test executes pre-compiled binaries")
+ def test_ctype_tolower_loc(self):
+ """
+ test_ctype_locale.test_ctype_tolower_loc
+@@ -109,7 +109,7 @@ class TestCtypeLocale(unittest.TestCase):
+ output = subprocess.check_output(bin_path, shell=True)
+ assert result == output
+
+- @skip_if_not_linux
++ @unittest.skip("test executes pre-compiled binaries")
+ def test_ctype_toupper_loc(self):
+ """
+ test_ctype_locale.test_ctype_toupper_loc
+diff --git a/tests/test_signed_div.py b/tests/test_signed_div.py
+index 59cb9b8d1..994ed9c65 100644
+--- a/tests/test_signed_div.py
++++ b/tests/test_signed_div.py
+@@ -1,6 +1,7 @@
+ import angr
+ import subprocess
+ import sys
++import pytest
+
+ import logging
+
+@@ -13,7 +14,7 @@ import os
+ test_location = os.path.dirname(os.path.realpath(__file__))
+
+
+-@skipUnless(sys.platform.startswith("linux"), "linux only")
++@pytest.mark.skip(reason="test executes pre-compiled binaries")
+ def test_signed_div():
+ test_bin = os.path.join(test_location, "..", "..", "binaries", "tests", "x86_64", "test_signed_div")
+ b = angr.Project(test_bin, auto_load_libs=False)
+diff --git a/tests/test_sscanf.py b/tests/test_sscanf.py
+index 29d2c8403..ea799b310 100644
+--- a/tests/test_sscanf.py
++++ b/tests/test_sscanf.py
+@@ -1,3 +1,4 @@
++import pytest
+ import angr
+ import subprocess
+ import sys
+@@ -14,7 +15,7 @@ test_location = os.path.dirname(os.path.realpath(__file__))
+
+
+ class TestSscanf(unittest.TestCase):
+- @unittest.skipUnless(sys.platform.startswith("linux"), "linux only")
++ @unittest.skip("test executes pre-compiled binaries")
+ def test_sscanf(self):
+ test_bin = os.path.join(test_location, "..", "..", "binaries", "tests", "x86_64", "sscanf_test")
+ b = angr.Project(test_bin, auto_load_libs=False)
+diff --git a/tests/test_strtol.py b/tests/test_strtol.py
+index 6c29cab22..f36181407 100644
+--- a/tests/test_strtol.py
++++ b/tests/test_strtol.py
+@@ -11,7 +11,7 @@ class TestStrtol(unittest.TestCase):
+ # pylint: disable=no-self-use
+
+ @slow_test
+- @unittest.skipUnless(sys.platform.startswith("linux"), "linux-only")
++ @unittest.skip("test executes pre-compiled binaries")
+ def test_strtol(self, threads=None):
+ test_bin = os.path.join(bin_location, "tests", "x86_64", "strtol_test")
+ # disabling auto_load_libs increases the execution time of the test case.
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 7c85404c2a..f4b0501187 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -32577,6 +32577,102 @@ (define-public python-itanium-demangle
extracting type information.")
(license license:bsd-0)))
+(define-public python-angr
+ (package
+ (name "python-angr")
+ (version "9.2.46")
+ (source
+ (origin
+ (method git-fetch)
+ (patches (search-patches "python-angr-addition-type-error.patch"
+ "python-angr-check-exec-deps.patch"))
+ (uri (git-reference
+ (url "https://github.com/angr/angr")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "18y9wyf7va7gvp9zd6lhw82j9a2x2ajsvbawh96xnxzml0jwlwjm"))))
+ (build-system pyproject-build-system)
+ (arguments
+ (list
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'patch-tests
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((coreutils (assoc-ref inputs "coreutils")))
+ (substitute* "tests/test_vault.py"
+ (("/bin/false")
+ (which "false")))
+ (substitute* "tests/common.py"
+ (("\\[\"cc\"\\]")
+ "[\"gcc\"]")))))
+ (replace 'check
+ (lambda* (#:key inputs tests? #:allow-other-keys)
+ (when tests?
+ (copy-recursively #$(this-package-native-input "binaries")
+ "../binaries")
+ (with-directory-excursion "tests"
+ ;; test_mips32_missing_offset_in_instructions fails
+ ;; with capstone 5 and passes with capstone 4. Might
+ ;; be a capstone regressions, needs investigation.
+ ;;
+ ;; test_concrete_memset is a non-deterministic benchmark.
+ (invoke "pytest" "-vv" "-x" "--dist" "loadfile"
+ "-k" "not test_mips32_missing_offset_in_instructions and not test_concrete_memset"
+ "-n" (number->string (parallel-job-count)))))))
+ (add-before 'build 'set-cc
+ (lambda _
+ (setenv "CC" "gcc"))))))
+ (propagated-inputs (list python-ailment
+ python-archinfo
+ python-cachetools
+ python-cffi
+ python-claripy
+ python-cle
+ python-colorama
+ python-cppheaderparser
+ python-dpkt
+ python-gitpython
+ python-mulpyplexer
+ python-nampa
+ python-networkx
+ python-protobuf
+ python-psutil
+ python-itanium-demangle
+ python-pycparser
+ python-pyvex
+ python-progressbar2
+ python-rpyc
+ python-sortedcontainers
+ python-sqlalchemy
+ python-sympy
+ unicorn))
+ (native-inputs `(("python-pytest" ,python-pytest)
+ ("python-pytest-xdist" ,python-pytest-xdist)
+ ("binaries"
+ ;; This repository ships several binaries used only for testing
+ ;; purpose. The binaries are not executed and not part of the
+ ;; angr distribution, they are only used to test angr's binary
+ ;; analysis capabilities. In the context of the GNU FSDG, these
+ ;; files should be considered non-functional data.
+ ,(origin
+ (method git-fetch)
+ (uri (git-reference (url
+ "https://github.com/angr/binaries")
+ (commit (string-append "v"
+ version))))
+ (file-name (git-file-name "angr-binaries" version))
+ (sha256 (base32
+ "1f286b2239zavxzwg1184hj1zs380cr9qr549mvy3vywvm8bsmgr"))))))
+ (home-page "https://github.com/angr/angr")
+ (synopsis "Multi-architecture binary analysis toolkit")
+ (description
+ "This package provides a versatile binary analysis platform with the
+ability to perform dynamic symbolic execution as well as various
+static analyses directly on binaries. As such, it can be used for all
+kinds of reverse engineering, vulnerability discovery, exploit
+generation, and software testing purposes.")
+ (license license:bsd-2)))
+
(define-public python-peachpy
;; There is no tag in this repo.
(let ((commit "913d74c35a6b1d330e90bfc055208ce5b06b35a0")
T
T
Troy Figiel wrote on 10 Mar 23:46 +0100
Re: [bug#69074] [PATCH] Add python-angr.
(address . 69074@debbugs.gnu.org)(name . Sören Tempel)(address . soeren@soeren-tempel.net)
2c45d288-755e-4a69-962b-1c35eeea9fcf@troyfigiel.com
Hi Sören,

On 2024-03-10 21:12, Sören Tempel wrote:
Toggle quote (10 lines)
> I don't think there is an issue with the binaries. angr is a binary
> analysis tools. Naturally, the test suite will need sample binaries
> for testing purposes. The GNU FSDG has an explicit clause regarding
> "non-functional data", I believe this very much applies here as these
> binaries are not executed and only needed for testing angr's analysis
> capabilities. Without the binaries there are no tests to run for angr.
> I would strongly advocate for not disabling the angr test suite as
> running it on Guix has resulted in the discovery bugs both in angr
> and in capstone [1, 2].

Thanks for finding some references. I also found Poppler ran into a
similar problem [1]. I am in favour of having these tests too, but I
think the difficult part will be the licensing. AFAIK we would have to
make sure all binaries that are included can be freely distributed.

I had a quick look and most (if not all) binaries are free. I would also
assume, if the angr authors are distributing the binaries in this way,
it should very likely be fine. I will have a more in-depth look the
coming week, feel free to do so as well.

By the way, I see the tests for python-cle require binaries. Are these
the same binaries as used for the python-angr tests? I didn't try it
out, but if so, it might be possible to run those tests during the build
as well.

Toggle quote (7 lines)
> Newer version of angr will require an update of the python-rich and
> python-pygments Guix package. Since this would entail a lot of rebuilds
> (and the upstream integration of the present changeset has already been
> quite effortful), I opted for packaging an "older" version of angr for
> now which does not depend on python-rich yet. As soon as python-rich and
> python-pygments are updated, we can update angr too.

Sounds good!

Toggle quote (4 lines)
> This is intended, all of these packages are distributed by the angr
> development team and need to be set to the same version as angr itself.
> I added a corresponding comment.

Super!

Toggle quote (6 lines)
> With the exception of one patch these are all upstreamed patches. I
> don't want to package unreleased Git versions of these packages and
> I think it's therefore preferable to just backport the bug fixes. Also
> consider that angr is very sensitive to versions of packages distributed
> by angr developers (see the prior comment).

Fair enough, I see all patches that come from commits and PRs have a
reference, so it shouldn't be too hard to check whether they should be
removed/updated when updating the package version.

Toggle quote (2 lines)
> What is left to do in order to get this merged?

We have to find someone with commit rights :-) I pinged the Python team
before, but might be good to do so again once we are sure about the
licensing of the binaries. I will keep you posted. The rest LGTM.

Best wishes,

Troy

S
S
Sören Tempel wrote on 11 Mar 09:50 +0100
(name . Troy Figiel)(address . troy@troyfigiel.com)(address . 69074@debbugs.gnu.org)
34ECWM52B8ETV.35329O8HROD2I@8pit.net
Hi Troy,

Troy Figiel <troy@troyfigiel.com> wrote:
Toggle quote (5 lines)
> By the way, I see the tests for python-cle require binaries. Are these
> the same binaries as used for the python-angr tests? I didn't try it
> out, but if so, it might be possible to run those tests during the build
> as well.

Yes, python-cle requires the same binaries. I just didn't enable those
tests yet as I did not want to invest additional work into tests based
on these binaries until someone with commit access confirms that it is
ok to use these as non-functional data in the tests.

Toggle quote (6 lines)
> > What is left to do in order to get this merged?
>
> We have to find someone with commit rights :-) I pinged the Python team
> before, but might be good to do so again once we are sure about the
> licensing of the binaries. I will keep you posted. The rest LGTM.

Great! And thanks again for your feedback it was really valuable.

Greetings
Sören
?