summaryrefslogtreecommitdiff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorSören Tempel <soeren@soeren-tempel.net>2024-07-11 23:27:22 +0200
committerjgart <jgart@dismail.de>2024-07-13 09:59:26 -0500
commitd4511a8970322de610efef4c6d0a2d2cc3ca0137 (patch)
tree9a24306c7232042988c04dd080721f2fd8f32e89 /gnu/packages/patches
parent61eb25c549886f803c68680fe9293f88d2e2589d (diff)
gnu: Add python-angr.
* 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. Signed-off-by: jgart <jgart@dismail.de>
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/python-angr-addition-type-error.patch18
-rw-r--r--gnu/packages/patches/python-angr-check-exec-deps.patch93
2 files changed, 111 insertions, 0 deletions
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.