Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

diffoscope: 287 -> 288 #380217

Merged
merged 1 commit into from
Feb 11, 2025
Merged

diffoscope: 287 -> 288 #380217

merged 1 commit into from
Feb 11, 2025

Conversation

trofi
Copy link
Contributor

@trofi trofi commented Feb 7, 2025

Changes: https://diffoscope.org/news/diffoscope-288-released/

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@trofi
Copy link
Contributor Author

trofi commented Feb 7, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 380217


x86_64-linux

❌ 5 packages failed to build:
  • diffoscope
  • diffoscope.dist
  • diffoscope.man
  • garble
  • tests.testers.testEqualContents.unequalExe
✅ 27 packages built:
  • diffoscopeMinimal
  • diffoscopeMinimal.dist
  • diffoscopeMinimal.man
  • tests.dotnet.final-attrs.check-output
  • tests.dotnet.final-attrs.output-matches-const
  • tests.dotnet.final-attrs.override-has-no-effect
  • tests.dotnet.final-attrs.override-modifies-output
  • tests.dotnet.structured-attrs.check-output
  • tests.dotnet.use-dotnet-from-env.fallback
  • tests.dotnet.use-dotnet-from-env.use-dotnet-path-env
  • tests.dotnet.use-dotnet-from-env.use-dotnet-root-env
  • tests.replaceVars.replaceVars.succeeds
  • tests.replaceVars.replaceVars.succeeds-with-exemption
  • tests.replaceVars.replaceVarsWith.succeeds
  • tests.replaceVars.replaceVarsWith.succeeds-with-exemption
  • tests.substitute.legacySingleArg
  • tests.substitute.legacySingleReplace
  • tests.substitute.legacyString
  • tests.substitute.legacyVar
  • tests.substitute.substitutions
  • tests.testers.testEqualContents.emptyFileAndDir
  • tests.testers.testEqualContents.equalDir
  • tests.testers.testEqualContents.equalExe
  • tests.testers.testEqualContents.fileDiff
  • tests.testers.testEqualContents.fileMissing
  • tests.testers.testEqualContents.nonExistentPath
  • tests.testers.testEqualContents.unequalExeInDir

@trofi
Copy link
Contributor Author

trofi commented Feb 7, 2025

diffoscope itself fails at it's dependencies:

@linsui
Copy link
Contributor

linsui commented Feb 8, 2025

#380276

@tnias
Copy link
Contributor

tnias commented Feb 10, 2025

PR to fix jefferson: #380735

@SuperSandro2000
Copy link
Member

diffoscope itself is still failing to build in its tests:

diffoscope> ==================================== ERRORS ====================================
diffoscope> ________________________ ERROR at setup of test_zipinfo ________________________
diffoscope>
diffoscope> apk1 = <<class 'abc.ApkFile'> /build/diffoscope-288/tests/data/test1.apk>
diffoscope> apk2 = <<class 'abc.ApkFile'> /build/diffoscope-288/tests/data/test2.apk>
diffoscope>
diffoscope>     @pytest.fixture
diffoscope>     def differences(apk1, apk2):
diffoscope> >       return apk1.compare(apk2).details
diffoscope>
diffoscope> tests/comparators/test_apk.py:54:
diffoscope> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope> diffoscope/comparators/zip.py:234: in compare
diffoscope>     x = super().compare(other, source)
diffoscope> diffoscope/comparators/utils/file.py:536: in compare
diffoscope>     difference = self._compare_using_details(other, source)
diffoscope> diffoscope/comparators/utils/file.py:437: in _compare_using_details
diffoscope>     details.extend(self.compare_details(other, source))
diffoscope> diffoscope/comparators/apk.py:274: in compare_details
diffoscope>     get_v2_signing_keys(self.path),
diffoscope> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope>
diffoscope> path = '/build/diffoscope-288/tests/data/test1.apk'
diffoscope>
diffoscope>     def get_v2_signing_keys(path):
diffoscope> >       from androguard.core.bytecodes import apk
diffoscope> E       ModuleNotFoundError: No module named 'androguard.core.bytecodes'
diffoscope>
diffoscope> diffoscope/comparators/apk.py:323: ModuleNotFoundError
diffoscope> __________________ ERROR at setup of test_apk_metadata_source __________________
diffoscope>
diffoscope> apk1 = <<class 'abc.ApkFile'> /build/diffoscope-288/tests/data/test1.apk>
diffoscope> apk2 = <<class 'abc.ApkFile'> /build/diffoscope-288/tests/data/test2.apk>
diffoscope>
diffoscope>     @pytest.fixture
diffoscope>     def differences(apk1, apk2):
diffoscope> >       return apk1.compare(apk2).details
diffoscope>
diffoscope> tests/comparators/test_apk.py:54:
diffoscope> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope> diffoscope/comparators/zip.py:234: in compare
diffoscope>     x = super().compare(other, source)
diffoscope> diffoscope/comparators/utils/file.py:536: in compare
diffoscope>     difference = self._compare_using_details(other, source)
diffoscope> diffoscope/comparators/utils/file.py:437: in _compare_using_details
diffoscope>     details.extend(self.compare_details(other, source))
diffoscope> diffoscope/comparators/apk.py:274: in compare_details
diffoscope>     get_v2_signing_keys(self.path),
diffoscope> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope>
diffoscope> path = '/build/diffoscope-288/tests/data/test1.apk'
diffoscope>
diffoscope>     def get_v2_signing_keys(path):
diffoscope> >       from androguard.core.bytecodes import apk
diffoscope> E       ModuleNotFoundError: No module named 'androguard.core.bytecodes'
diffoscope>
diffoscope> diffoscope/comparators/apk.py:323: ModuleNotFoundError
diffoscope> ____________ ERROR at setup of test_skip_undecoded_android_manifest ____________
diffoscope>
diffoscope> apk1 = <<class 'abc.ApkFile'> /build/diffoscope-288/tests/data/test1.apk>
diffoscope> apk2 = <<class 'abc.ApkFile'> /build/diffoscope-288/tests/data/test2.apk>
diffoscope>
diffoscope>     @pytest.fixture
diffoscope>     def differences(apk1, apk2):
diffoscope> >       return apk1.compare(apk2).details
diffoscope>
diffoscope> tests/comparators/test_apk.py:54:
diffoscope> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope> diffoscope/comparators/zip.py:234: in compare
diffoscope>     x = super().compare(other, source)
diffoscope> diffoscope/comparators/utils/file.py:536: in compare
diffoscope>     difference = self._compare_using_details(other, source)
diffoscope> diffoscope/comparators/utils/file.py:437: in _compare_using_details
diffoscope>     details.extend(self.compare_details(other, source))
diffoscope> diffoscope/comparators/apk.py:274: in compare_details
diffoscope>     get_v2_signing_keys(self.path),
diffoscope> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope>
diffoscope> path = '/build/diffoscope-288/tests/data/test1.apk'
diffoscope>
diffoscope>     def get_v2_signing_keys(path):
diffoscope> >       from androguard.core.bytecodes import apk
diffoscope> E       ModuleNotFoundError: No module named 'androguard.core.bytecodes'
diffoscope>
diffoscope> diffoscope/comparators/apk.py:323: ModuleNotFoundError
diffoscope> __________________ ERROR at setup of test_no_android_manifest __________________
diffoscope>
diffoscope> apk1 = <<class 'abc.ApkFile'> /build/diffoscope-288/tests/data/test1.apk>
diffoscope> apk3 = <<class 'abc.ApkFile'> /build/diffoscope-288/tests/data/test3.apk>
diffoscope>
diffoscope>     @pytest.fixture
diffoscope>     def differences2(apk1, apk3):
diffoscope> >       return apk1.compare(apk3).details
diffoscope>
diffoscope> tests/comparators/test_apk.py:59:
diffoscope> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope> diffoscope/comparators/zip.py:234: in compare
diffoscope>     x = super().compare(other, source)
diffoscope> diffoscope/comparators/utils/file.py:536: in compare
diffoscope>     difference = self._compare_using_details(other, source)
diffoscope> diffoscope/comparators/utils/file.py:437: in _compare_using_details
diffoscope>     details.extend(self.compare_details(other, source))
diffoscope> diffoscope/comparators/apk.py:274: in compare_details
diffoscope>     get_v2_signing_keys(self.path),
diffoscope> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope>
diffoscope> path = '/build/diffoscope-288/tests/data/test1.apk'
diffoscope>
diffoscope>     def get_v2_signing_keys(path):
diffoscope> >       from androguard.core.bytecodes import apk
diffoscope> E       ModuleNotFoundError: No module named 'androguard.core.bytecodes'
diffoscope>
diffoscope> diffoscope/comparators/apk.py:323: ModuleNotFoundError
diffoscope> =================================== FAILURES ===================================
diffoscope> _____________________________ test_no_differences ______________________________
diffoscope>
diffoscope> apk1 = <<class 'abc.ApkFile'> /build/diffoscope-288/tests/data/test1.apk>
diffoscope>
diffoscope>     def test_no_differences(apk1):
diffoscope> >       difference = apk1.compare(apk1)
diffoscope>
diffoscope> tests/comparators/test_apk.py:48:
diffoscope> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope> diffoscope/comparators/zip.py:234: in compare
diffoscope>     x = super().compare(other, source)
diffoscope> diffoscope/comparators/utils/file.py:536: in compare
diffoscope>     difference = self._compare_using_details(other, source)
diffoscope> diffoscope/comparators/utils/file.py:437: in _compare_using_details
diffoscope>     details.extend(self.compare_details(other, source))
diffoscope> diffoscope/comparators/apk.py:274: in compare_details
diffoscope>     get_v2_signing_keys(self.path),
diffoscope> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope>
diffoscope> path = '/build/diffoscope-288/tests/data/test1.apk'
diffoscope>
diffoscope>     def get_v2_signing_keys(path):
diffoscope> >       from androguard.core.bytecodes import apk
diffoscope> E       ModuleNotFoundError: No module named 'androguard.core.bytecodes'
diffoscope>
diffoscope> diffoscope/comparators/apk.py:323: ModuleNotFoundError
diffoscope> __________________________ test_compare_non_existing ___________________________
diffoscope>
diffoscope> monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7ffff631afc0>
diffoscope> apk1 = <<class 'abc.ApkFile'> /build/diffoscope-288/tests/data/test1.apk>
diffoscope>
diffoscope>     @skip_unless_tools_exist("apktool", "zipinfo")
diffoscope>     def test_compare_non_existing(monkeypatch, apk1):
diffoscope> >       assert_non_existing(monkeypatch, apk1)
diffoscope>
diffoscope> tests/comparators/test_apk.py:64:
diffoscope> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope> tests/utils/nonexisting.py:31: in assert_non_existing
diffoscope>     difference = fixture.compare(MissingFile("/nonexisting", fixture))
diffoscope> diffoscope/comparators/zip.py:234: in compare
diffoscope>     x = super().compare(other, source)
diffoscope> diffoscope/comparators/utils/file.py:536: in compare
diffoscope>     difference = self._compare_using_details(other, source)
diffoscope> diffoscope/comparators/utils/file.py:437: in _compare_using_details
diffoscope>     details.extend(self.compare_details(other, source))
diffoscope> diffoscope/comparators/apk.py:274: in compare_details
diffoscope>     get_v2_signing_keys(self.path),
diffoscope> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope>
diffoscope> path = '/build/diffoscope-288/tests/data/test1.apk'
diffoscope>
diffoscope>     def get_v2_signing_keys(path):
diffoscope> >       from androguard.core.bytecodes import apk
diffoscope> E       ModuleNotFoundError: No module named 'androguard.core.bytecodes'
diffoscope>
diffoscope> diffoscope/comparators/apk.py:323: ModuleNotFoundError
diffoscope> =========================== short test summary info ============================
diffoscope> FAILED tests/comparators/test_apk.py::test_no_differences - ModuleNotFoundError: No module named 'androguard.core.bytecodes'
diffoscope> FAILED tests/comparators/test_apk.py::test_compare_non_existing - ModuleNotFoundError: No module named 'androguard.core.bytecodes'
diffoscope> ERROR tests/comparators/test_apk.py::test_zipinfo - ModuleNotFoundError: No module named 'androguard.core.bytecodes'
diffoscope> ERROR tests/comparators/test_apk.py::test_apk_metadata_source - ModuleNotFoundError: No module named 'androguard.core.bytecodes'
diffoscope> ERROR tests/comparators/test_apk.py::test_skip_undecoded_android_manifest - ModuleNotFoundError: No module named 'androguard.core.bytecodes'
diffoscope> ERROR tests/comparators/test_apk.py::test_no_android_manifest - ModuleNotFoundError: No module named 'androguard.core.bytecodes'
diffoscope> = 2 failed, 683 passed, 39 skipped, 5 deselected, 1 xfailed, 2 xpassed, 4 errors in 81.00s (0:01:21) =

@trofi
Copy link
Contributor Author

trofi commented Feb 10, 2025

Yup, just like the current master's diffoscope-287. At least diffoscopeMinimal is not broken.

@tnias
Copy link
Contributor

tnias commented Feb 10, 2025

The diffoscope build failure seems to be related to changed import paths between androguard v3.4.0a1 and v4.1.2.
https://github.com/androguard/androguard/blob/v3.4.0a1/androguard/core/bytecodes/apk.py
https://github.com/androguard/androguard/blob/v4.1.2/androguard/core/apk/__init__.py

The current diffoscope master uses the old import path.
https://salsa.debian.org/reproducible-builds/diffoscope/-/blob/b8e3c6cbafed2103ce8d24539d8d2510eda6ac0e/diffoscope/comparators/apk.py#L323

The latest androguard packaged by debian is 3.4.0~a1-16. https://packages.debian.org/search?keywords=androguard&searchon=names&suite=all&section=all

Just replacing the import path makes the test pass for me.

diff --git a/pkgs/tools/misc/diffoscope/default.nix b/pkgs/tools/misc/diffoscope/default.nix
index 4cac3e286de4..104cbbcad1af 100644
--- a/pkgs/tools/misc/diffoscope/default.nix
+++ b/pkgs/tools/misc/diffoscope/default.nix
@@ -124,6 +124,9 @@ python.pkgs.buildPythonApplication rec {
     # Upstream doesn't provide a PKG-INFO file
     sed -i setup.py -e "/'rpm-python',/d"
 
+    substituteInPlace diffoscope/comparators/apk.py \
+      --replace "from androguard.core.bytecodes import apk" "from androguard.core import apk"
+
     # When generating manpage, use the installed version
     substituteInPlace doc/Makefile --replace "../bin" "$out/bin"
   '';

I have not tested this beyond getting a successful build.

@philiptaron
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 380217


x86_64-linux

❌ 1 package failed to build:
  • tests.testers.testEqualContents.unequalExe
✅ 31 packages built:
  • diffoscope
  • diffoscope.dist
  • diffoscope.man
  • diffoscopeMinimal
  • diffoscopeMinimal.dist
  • diffoscopeMinimal.man
  • garble
  • tests.dotnet.final-attrs.check-output
  • tests.dotnet.final-attrs.output-matches-const
  • tests.dotnet.final-attrs.override-has-no-effect
  • tests.dotnet.final-attrs.override-modifies-output
  • tests.dotnet.structured-attrs.check-output
  • tests.dotnet.use-dotnet-from-env.fallback
  • tests.dotnet.use-dotnet-from-env.use-dotnet-path-env
  • tests.dotnet.use-dotnet-from-env.use-dotnet-root-env
  • tests.replaceVars.replaceVars.succeeds
  • tests.replaceVars.replaceVars.succeeds-with-exemption
  • tests.replaceVars.replaceVarsWith.succeeds
  • tests.replaceVars.replaceVarsWith.succeeds-with-exemption
  • tests.substitute.legacySingleArg
  • tests.substitute.legacySingleReplace
  • tests.substitute.legacyString
  • tests.substitute.legacyVar
  • tests.substitute.substitutions
  • tests.testers.testEqualContents.emptyFileAndDir
  • tests.testers.testEqualContents.equalDir
  • tests.testers.testEqualContents.equalExe
  • tests.testers.testEqualContents.fileDiff
  • tests.testers.testEqualContents.fileMissing
  • tests.testers.testEqualContents.nonExistentPath
  • tests.testers.testEqualContents.unequalExeInDir

@philiptaron
Copy link
Contributor

What's the deal with the tests.testers.testEqualContents.unequalExe? Is this a real change in behavior with the new diffoscope?

@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Feb 10, 2025

The test is broken since a week https://hydra.nixos.org/build/287576616

Bisect says it failed with this update https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/285...286

 ➜ git bisect bad
b47982cc709c1da6900926c7bb1518175503f430 is the first bad commit
commit b47982cc709c1da6900926c7bb1518175503f430 (HEAD, refs/bisect/bad)
Author: Sergei Trofimovich <slyich@gmail.com>
Date:   Fri Jan 24 22:21:22 2025 +0000

    diffoscope: 285 -> 287

    Changes:
    - https://diffoscope.org/news/diffoscope-286-released/
    - https://diffoscope.org/news/diffoscope-287-released/

 pkgs/tools/misc/diffoscope/default.nix | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

@SuperSandro2000
Copy link
Member

The failure is really weird. When building an older version of package and running diffoscope on the files it doesn't report the mode difference but when building the tests it does. It always reports the difference when the files are placed inside a directory. I have really no clue where the issue is, maybe python compiler or based on some ambient packages? Going to ignore it for now

@SuperSandro2000 SuperSandro2000 merged commit 5d56f07 into NixOS:master Feb 11, 2025
27 checks passed
@trofi trofi deleted the diffoscope-update branch February 12, 2025 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants