NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.84k stars 13.92k forks source link

Build failure: metadata-cleaner #349451

Closed bitscoper closed 3 hours ago

bitscoper commented 3 hours ago

Steps To Reproduce

Steps to reproduce the behavior:

  1. build metadata-cleaner

Build log

[303/3272] Building CXX object swagger/CMakeFiles/swagger.dir/sdrangel/code/qt5/client/SWGPacketModActions_payload.cpp.o
tests/test_lightweight_cleaning.py F.                                    [ 97%]
[304/3272] Building CXX object swagger/CMakeFiles/swagger.dir/sdrangel/code/qt5/client/SWGPacketModSettings.cpp.o
tests/test_policy.py ...                                                 [100%]

=================================== FAILURES ===================================
_______________________ TestLightWeightCleaning.test_all _______________________

self = <tests.test_lightweight_cleaning.TestLightWeightCleaning testMethod=test_all>

    def test_all(self):
        for case in self.data:
            target = './tests/data/clean.' + case['name']
            shutil.copy('./tests/data/dirty.' + case['name'], target)
            p1 = case['parser'](target)

            meta = p1.get_meta()
            for k, v in case['meta'].items():
                self.assertEqual(meta[k], v)

            p1.lightweight_cleaning = True
>           self.assertTrue(p1.remove_all())

tests/test_lightweight_cleaning.py:55: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
libmat2/pdf.py:39: in remove_all
    return self.__remove_all_lightweight()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <libmat2.pdf.PDFParser object at 0x7ffff3bc03e0>

    def __remove_all_lightweight(self) -> bool:
        """
            Load the document into Poppler, render pages on a new PDFSurface.
        """
        document = Poppler.Document.new_from_file(self.uri, None)
        pages_count = document.get_n_pages()

        tmp_path = tempfile.mkstemp()[1]
        pdf_surface = cairo.PDFSurface(tmp_path, 10, 10)  # resized later anyway
        pdf_surface.restrict_to_version(FIXED_PDF_VERSION)
        pdf_context = cairo.Context(pdf_surface)  # context draws on the surface

        for pagenum in range(pages_count):
            logging.info("Rendering page %d/%d", pagenum + 1, pages_count)
            page = document.get_page(pagenum)
            page_width, page_height = page.get_size()
            pdf_surface.set_size(page_width, page_height)
            pdf_context.save()
            page.render_for_printing(pdf_context)
            pdf_context.restore()
            pdf_context.show_page()  # draw pdf_context on pdf_surface
>       pdf_surface.finish()
E       libmat2.pdf.cairo.MemoryError: out of memory

libmat2/pdf.py:63: cairo.MemoryError
=============================== warnings summary ===============================
tests/test_corrupted_files.py: 8 warnings
tests/test_libmat2.py: 27 warnings
  /build/source/libmat2/archive.py:155: DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.
    zin.extract(member=item, path=temp_folder)

tests/test_corrupted_files.py: 7 warnings
tests/test_libmat2.py: 24 warnings
  /build/source/libmat2/archive.py:206: DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.
    zin.extract(member=item, path=temp_folder)

tests/test_libmat2.py::TestCleaningArchives::test_tar
  /build/source/tests/test_libmat2.py:689: DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.
    zout.extractall(path=tmp_dir)

tests/test_libmat2.py::TestCleaningArchives::test_tarbz2
  /build/source/tests/test_libmat2.py:759: DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.
    zout.extractall(path=tmp_dir)

tests/test_libmat2.py::TestCleaningArchives::test_targz
  /build/source/tests/test_libmat2.py:724: DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.
    zout.extractall(path=tmp_dir)

tests/test_libmat2.py::TestCleaningArchives::test_tarxz
  /build/source/tests/test_libmat2.py:794: DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior.
    zout.extractall(path=tmp_dir)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_lightweight_cleaning.py::TestLightWeightCleaning::test_all - libmat2.pdf.cairo.MemoryError: out of memory
===== 1 failed, 119 passed, 1 deselected, 70 warnings in 95.03s (0:01:35) ======
error: builder for '/nix/store/3vq0p95id7r190i6fwk5zp4zjh2vb7ll-python3.12-mat2-0.13.4.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/16d6hcxbbkpib3wbpxjf54wn0b8r25wp-metadata-cleaner-2.5.6.drv' failed to build
error: 1 dependencies of derivation '/nix/store/a1kf7ihd21cmfpf6bczvi15l94y27bjk-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/4v73rqq0h9mzhpqhmgd68jmpzz00lnlj-nixos-system-Bitscoper-WorkStation-24.11pre692963.a3c0b3b21515.drv' failed to build

Additional context

Occurs when doing sudo nixos-rebuild switch --upgrade-all on NixOS unstable.

Notify maintainers

@dotlambda

Metadata

[bitscoper@Bitscoper-WorkStation:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.10.9-zen1, NixOS, 24.11 (Vicuna), 24.11pre690827.5633bcff0c61`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.8`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
dotlambda commented 3 hours ago

duplicate of https://github.com/NixOS/nixpkgs/issues/348081