From 675ece97388fc1bdec2d231a43ca1a016d717ad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 28 Apr 2024 01:37:06 +0200 Subject: [PATCH 1/2] diffoscope: downgrade tlsh --- pkgs/tools/misc/diffoscope/default.nix | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/misc/diffoscope/default.nix b/pkgs/tools/misc/diffoscope/default.nix index 55a02002e257..01d74b9c5306 100644 --- a/pkgs/tools/misc/diffoscope/default.nix +++ b/pkgs/tools/misc/diffoscope/default.nix @@ -76,8 +76,26 @@ , writeScript }: +let + python = python3.override { + packageOverrides = final: prev: { + # version 4 or newer would log the followng error but tests currently don't fail because radare2 is disabled + # ValueError: argument TNULL is not a TLSH hex string + tlsh = prev.tlsh.overridePythonAttrs ({ src, ... }: let + version = "3.19.1"; + in { + inherit version; + src = src.override { + rev = version; + hash = "sha256-ZYEjT/yShfA4+zpbGOtaFOx1nSSOWPtMvskPhHv3c9U="; + }; + }); + }; + }; +in + # Note: when upgrading this package, please run the list-missing-tools.sh script as described below! -python3.pkgs.buildPythonApplication rec { +python.pkgs.buildPythonApplication rec { pname = "diffoscope"; version = "265"; @@ -160,7 +178,7 @@ python3.pkgs.buildPythonApplication rec { zip zstd ] - ++ (with python3.pkgs; [ + ++ (with python.pkgs; [ argcomplete debian defusedxml @@ -209,7 +227,7 @@ python3.pkgs.buildPythonApplication rec { wabt xmlbeans ] - ++ (with python3.pkgs; [ + ++ (with python.pkgs; [ androguard binwalk guestfs @@ -224,7 +242,7 @@ python3.pkgs.buildPythonApplication rec { ++ lib.optionals (stdenv.hostPlatform.system != "aarch64-darwin") [ gnumeric ] )); - nativeCheckInputs = with python3.pkgs; [ + nativeCheckInputs = with python.pkgs; [ pytestCheckHook ] ++ pythonPath; From 02e439f973881c328f6806188460eac3a754b718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 28 Apr 2024 01:37:15 +0200 Subject: [PATCH 2/2] diffoscope: disable radare2 since r2pipe got added, the tests for it are executed, which fail --- pkgs/tools/misc/diffoscope/default.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/diffoscope/default.nix b/pkgs/tools/misc/diffoscope/default.nix index 01d74b9c5306..6d97581af26f 100644 --- a/pkgs/tools/misc/diffoscope/default.nix +++ b/pkgs/tools/misc/diffoscope/default.nix @@ -59,7 +59,6 @@ , python3 , qemu , R -, radare2 , sng , sqlite , squashfsTools @@ -142,6 +141,11 @@ python.pkgs.buildPythonApplication rec { # docx2txt <- makes tests broken: # > FAILED tests/comparators/test_docx.py::test_diff - IndexError: list index out of range # > FAILED tests/comparators/test_docx.py::test_compare_non_existing - AssertionError + # radare2 + # > FAILED tests/comparators/test_elf_decompiler.py::test_ghidra_diff - IndexError: list index out of range + # > FAILED tests/comparators/test_elf_decompiler.py::test_radare2_diff - AssertionError + # > FAILED tests/comparators/test_macho_decompiler.py::test_ghidra_diff - assert 0 == 1 + # > FAILED tests/comparators/test_macho_decompiler.py::test_radare2_diff - AssertionError # # We filter automatically all packages for the host platform (some dependencies are not supported on Darwin, aarch64, etc.). pythonPath = lib.filter (lib.meta.availableOn stdenv.hostPlatform) ([ @@ -221,7 +225,6 @@ python.pkgs.buildPythonApplication rec { procyon qemu R - radare2 tcpdump ubootTools wabt