NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.1k stars 14.15k forks source link

diffoscope is old and broken #93058

Closed rodarima closed 4 years ago

rodarima commented 4 years ago

Describe the bug Diffoscope fails to run the tests, and the build fails. Also the last release is 151.

To Reproduce

$ nix-channel --update
$ nix-env -iA nixpkgs.diffoscope

Log

installing 'diffoscope-150'
these derivations will be built:
  /nix/store/ji9vldmwv0p5mdyxaii7fizkzg8d4raj-diffoscope-150.drv
building '/nix/store/ji9vldmwv0p5mdyxaii7fizkzg8d4raj-diffoscope-150.drv'...
Sourcing python-recompile-bytecode-hook.sh
Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
...
writing manifest file 'diffoscope.egg-info/SOURCES.txt'
running build_ext
============================= test session starts ==============================
platform linux -- Python 3.8.3, pytest-5.4.3, py-1.8.1, pluggy-0.13.1
rootdir: /build/diffoscope-150
collected 447 items                                                            

tests/test_diff_mask.py ...                                              [  0%]
tests/test_difference.py .....                                           [  1%]
tests/test_excludes.py .......                                           [  3%]
tests/test_main.py ............                                          [  6%]
tests/test_presenters.py ..........s........                             [ 10%]
tests/test_progress.py ..                                                [ 10%]
tests/test_quines.py .....                                               [ 11%]
tests/test_readers.py .                                                  [ 12%]
tests/test_source.py s.                                                  [ 12%]
tests/test_tools.py s.                                                   [ 12%]
tests/comparators/test_android.py ..ss                                   [ 13%]
tests/comparators/test_apk.py ..ssssss                                   [ 15%]
tests/comparators/test_archive.py .                                      [ 15%]
tests/comparators/test_berkeley_db.py ....                               [ 16%]
tests/comparators/test_binary.py ..................s..                   [ 21%]
tests/comparators/test_binwalk.py sssss                                  [ 22%]
tests/comparators/test_bzip2.py ......                                   [ 23%]
tests/comparators/test_cbfs.py ssssss                                    [ 25%]
tests/comparators/test_containers.py ..                                  [ 25%]
tests/comparators/test_cpio.py ......                                    [ 27%]
tests/comparators/test_deb.py ...............                            [ 30%]
tests/comparators/test_debian.py .................                       [ 34%]
tests/comparators/test_device.py ...                                     [ 34%]
tests/comparators/test_dex.py ..ss                                       [ 35%]
tests/comparators/test_directory.py ........                             [ 37%]
tests/comparators/test_docx.py ..ss                                      [ 38%]
tests/comparators/test_dtb.py ....                                       [ 39%]
tests/comparators/test_elf.py ..............                             [ 42%]
tests/comparators/test_epub.py ....                                      [ 43%]
tests/comparators/test_ffprobe.py ..ss                                   [ 44%]
tests/comparators/test_fontconfig.py ...                                 [ 44%]
tests/comparators/test_fonts.py ..ss                                     [ 45%]
tests/comparators/test_fsimage.py ....ssss                               [ 47%]
tests/comparators/test_gettext.py .....                                  [ 48%]
tests/comparators/test_gif.py ..ssss                                     [ 50%]
tests/comparators/test_git.py ...                                        [ 50%]
tests/comparators/test_gnumeric.py ..ss                                  [ 51%]
tests/comparators/test_gzip.py ........                                  [ 53%]
tests/comparators/test_haskell.py s.s                                    [ 54%]
tests/comparators/test_hdf.py ssss                                       [ 55%]
tests/comparators/test_icc.py ..ss                                       [ 55%]
tests/comparators/test_ico_image.py ..ssss                               [ 57%]
tests/comparators/test_ipk.py .....                                      [ 58%]
tests/comparators/test_iso9660.py .......                                [ 59%]
tests/comparators/test_java.py ..ssss                                    [ 61%]
tests/comparators/test_javascript.py ....                                [ 62%]
tests/comparators/test_jpeg_image.py ..ssss                              [ 63%]
tests/comparators/test_json.py ......                                    [ 64%]
tests/comparators/test_kbx.py ..ss                                       [ 65%]
tests/comparators/test_lz4.py ......                                     [ 67%]
tests/comparators/test_macho.py ..ss                                     [ 68%]
tests/comparators/test_mono.py ..ss                                      [ 68%]
tests/comparators/test_ocaml.py ssss                                     [ 69%]
tests/comparators/test_odt.py ..ss                                       [ 70%]
tests/comparators/test_ogg.py ..ss                                       [ 71%]
tests/comparators/test_openssh_pub_key.py ..ss                           [ 72%]
tests/comparators/test_openssl.py ...                                    [ 73%]
tests/comparators/test_pcap.py ..ss                                      [ 74%]
tests/comparators/test_pdf.py ...sss                                     [ 75%]
tests/comparators/test_pgp.py ......                                     [ 76%]
tests/comparators/test_png.py ....s                                      [ 77%]
tests/comparators/test_ppu.py s.ss                                       [ 78%]
tests/comparators/test_ps.py .ssss                                       [ 79%]
tests/comparators/test_rdata.py ..ss                                     [ 80%]
tests/comparators/test_rlib.py ......s.                                  [ 82%]
tests/comparators/test_rpm.py .......                                    [ 84%]
tests/comparators/test_sqlite.py ....                                    [ 85%]
tests/comparators/test_squashfs.py .......                               [ 86%]
tests/comparators/test_symlink.py .                                      [ 86%]
tests/comparators/test_tar.py .......                                    [ 88%]
tests/comparators/test_text.py .......                                   [ 89%]
tests/comparators/test_utils.py .ss.....                                 [ 91%]
tests/comparators/test_wasm.py EEss                                      [ 92%]
tests/comparators/test_xml.py ....                                       [ 93%]
tests/comparators/test_xsb.py ..ss                                       [ 94%]
tests/comparators/test_xz.py ......                                      [ 95%]
tests/comparators/test_zip.py ................                           [ 99%]
tests/comparators/test_zst.py ...                                        [100%]

==================================== ERRORS ====================================
____________________ ERROR at setup of test_identification _____________________

>   return pytest.fixture(lambda: specialize(FilesystemFile(filename)))

tests/utils/data.py:36:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/utils/specialize.py:55: in specialize
    if try_recognize(file, cls, cls.recognizes):
diffoscope/comparators/utils/specialize.py:38: in try_recognize
    if not recognizes(file):
diffoscope/comparators/debian.py:224: in recognizes
    if not super().recognizes(file):
diffoscope/comparators/utils/file.py:155: in recognizes
    file.magic_file_type,
diffoscope/comparators/utils/file.py:286: in magic_file_type
    self._magic_file_type = File.guess_file_type(self.path)
diffoscope/comparators/utils/file.py:93: in guess_file_type
    return maybe_decode(self._mimedb.from_file(path))
/nix/store/cpijcjhlxl95kjsj8iq3xh8jgjl0q6dn-python3.8-python-magic-0.4.18/lib/python3.8/site-packages/magic.py:101: in from_file
    return self._handle509Bug(e)
/nix/store/cpijcjhlxl95kjsj8iq3xh8jgjl0q6dn-python3.8-python-magic-0.4.18/lib/python3.8/site-packages/magic.py:110: in _handle509Bug
    raise e
/nix/store/cpijcjhlxl95kjsj8iq3xh8jgjl0q6dn-python3.8-python-magic-0.4.18/lib/python3.8/site-packages/magic.py:99: in from_file
    return maybe_decode(magic_file(self.cookie, filename))
/nix/store/cpijcjhlxl95kjsj8iq3xh8jgjl0q6dn-python3.8-python-magic-0.4.18/lib/python3.8/site-packages/magic.py:272: in magic_file
    return _magic_file(cookie, coerce_filename(filename))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

result = None, func = <_FuncPtr object at 0x7ffff5cfda00>
args = (12364208, b'/build/diffoscope-150/tests/data/hello1.wasm')

    def errorcheck_null(result, func, args):
        if result is None:
            err = magic_error(args[0])
>           raise MagicException(err)
E           magic.MagicException: b"Bad magic format `version %#x (MVP)' (bad format char: #)"

/nix/store/cpijcjhlxl95kjsj8iq3xh8jgjl0q6dn-python3.8-python-magic-0.4.18/lib/python3.8/site-packages/magic.py:209: MagicException
____________________ ERROR at setup of test_no_differences _____________________

>   return pytest.fixture(lambda: specialize(FilesystemFile(filename)))

tests/utils/data.py:36:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
diffoscope/comparators/utils/specialize.py:55: in specialize
    if try_recognize(file, cls, cls.recognizes):
diffoscope/comparators/utils/specialize.py:38: in try_recognize
    if not recognizes(file):
diffoscope/comparators/debian.py:224: in recognizes
    if not super().recognizes(file):
diffoscope/comparators/utils/file.py:155: in recognizes
    file.magic_file_type,
diffoscope/comparators/utils/file.py:286: in magic_file_type
    self._magic_file_type = File.guess_file_type(self.path)
diffoscope/comparators/utils/file.py:93: in guess_file_type
    return maybe_decode(self._mimedb.from_file(path))
/nix/store/cpijcjhlxl95kjsj8iq3xh8jgjl0q6dn-python3.8-python-magic-0.4.18/lib/python3.8/site-packages/magic.py:101: in from_file
    return self._handle509Bug(e)
/nix/store/cpijcjhlxl95kjsj8iq3xh8jgjl0q6dn-python3.8-python-magic-0.4.18/lib/python3.8/site-packages/magic.py:110: in _handle509Bug
    raise e
/nix/store/cpijcjhlxl95kjsj8iq3xh8jgjl0q6dn-python3.8-python-magic-0.4.18/lib/python3.8/site-packages/magic.py:99: in from_file
    return maybe_decode(magic_file(self.cookie, filename))
/nix/store/cpijcjhlxl95kjsj8iq3xh8jgjl0q6dn-python3.8-python-magic-0.4.18/lib/python3.8/site-packages/magic.py:272: in magic_file
    return _magic_file(cookie, coerce_filename(filename))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

result = None, func = <_FuncPtr object at 0x7ffff5cfda00>
args = (12364208, b'/build/diffoscope-150/tests/data/hello1.wasm')

    def errorcheck_null(result, func, args):
        if result is None:
            err = magic_error(args[0])
>           raise MagicException(err)
E           magic.MagicException: b"Bad magic format `version %#x (MVP)' (bad format char: #)"

/nix/store/cpijcjhlxl95kjsj8iq3xh8jgjl0q6dn-python3.8-python-magic-0.4.18/lib/python3.8/site-packages/magic.py:209: MagicException
=========================== short test summary info ============================
ERROR tests/comparators/test_wasm.py::test_identification - magic.MagicExcept...
ERROR tests/comparators/test_wasm.py::test_no_differences - magic.MagicExcept...
================== 346 passed, 99 skipped, 2 errors in 34.67s ==================
builder for '/nix/store/ji9vldmwv0p5mdyxaii7fizkzg8d4raj-diffoscope-150.drv' failed with exit code 1
error: build of '/nix/store/ji9vldmwv0p5mdyxaii7fizkzg8d4raj-diffoscope-150.drv' failed

Notify maintainers @dezgeg @ma27 @danielfullmer

Metadata Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

$ nix-shell -p nix-info --run "nix-info -m"
these paths will be fetched (0.00 MiB download, 0.00 MiB unpacked):
  /nix/store/ykmxzc74s2v5fy5fs5qhz2pldnn5kns3-nix-info
copying path '/nix/store/ykmxzc74s2v5fy5fs5qhz2pldnn5kns3-nix-info' from 'https://cache.nixos.org'...
 - system: `"x86_64-linux"`
 - host os: `Linux 4.4.49-92.14-default, SLES, 12-SP2`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.6`
 - channels(root): `"nixpkgs-20.09pre234399.0260f04fe25"`
 - channels(rarias): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: diffoscope
# a list of nixos modules affected by the problem
module:
dasj19 commented 4 years ago

Does this help: https://github.com/NixOS/nixpkgs/pull/93064

Test with nix-shell -p nixpkgs-review --run "nixpkgs-review 93064"

rodarima commented 4 years ago

Using nix-shell -p nixpkgs-review --run "nixpkgs-review pr 93064" works. Thanks!