The issue here is that we have an old version of ocrmypdf (4.3.5) with a
backported version of Ghostscript (9.26) and the latter's behavior has
changed in a way that breaks the test.

I recommend disabling the test and documenting a caveat that certain
metadata may not be preserved in output files. This is arguably a fairly
minor loss of functionality.

On Tue, Aug 6, 2019 at 3:48 AM Santiago Vila <sanv...@debian.org> wrote:

> Package: src:ocrmypdf
> Version: 4.3.5-3
> Severity: serious
> Tags: ftbfs
>
> Dear maintainer:
>
> I tried to build this package in stretch but it failed:
>
>
> --------------------------------------------------------------------------------
> [...]
>  debian/rules build-indep
> dh build-indep --with python3,sphinxdoc --buildsystem=pybuild
>    dh_testdir -i -O--buildsystem=pybuild
>    dh_update_autotools_config -i -O--buildsystem=pybuild
>    dh_autoreconf -i -O--buildsystem=pybuild
>    dh_auto_configure -i -O--buildsystem=pybuild
> I: pybuild base:184: python3.5 setup.py config
> Skipping external program tests because of --force
> running config
>    debian/rules override_dh_auto_build
> make[1]: Entering directory '/<<PKGBUILDDIR>>'
> mkdir -p debian/.debhelper
> cp -R ocrmypdf debian/.debhelper
> sed -i debian/.debhelper/ocrmypdf/__init__.py -e \
>         "s|^VERSION =.*|VERSION = \"4.3.5\"|"
> PYTHONPATH=debian/.debhelper sphinx-build docs html
> Running Sphinx v1.4.9
> making output directory...
> loading pickled environment... not yet created
> building [mo]: targets for 0 po files that are out of date
> building [html]: targets for 7 source files that are out of date
> updating environment: 7 added, 0 changed, 0 removed
> reading sources... [ 14%] cookbook
> reading sources... [ 28%] errors
> reading sources... [ 42%] index
> reading sources... [ 57%] installation
> reading sources... [ 71%] introduction
> reading sources... [ 85%] languages
> reading sources... [100%] security
>
> /<<PKGBUILDDIR>>/docs/installation.rst:2: WARNING: Duplicate explicit
> target name: "docker".
> /<<PKGBUILDDIR>>/docs/installation.rst:2: WARNING: Duplicate explicit
> target name: "docker".
> looking for now-outdated files... none found
> pickling environment... done
> checking consistency... /<<PKGBUILDDIR>>/docs/installation.rst:: WARNING:
> document isn't included in any toctree
> done
> preparing documents... done
> writing output... [ 14%] cookbook
> writing output... [ 28%] errors
> writing output... [ 42%] index
> writing output... [ 57%] installation
> writing output... [ 71%] introduction
> writing output... [ 85%] languages
> writing output... [100%] security
>
> generating indices... genindex
> writing additional pages... search
> copying images... [100%] bitmap_vs_svg.svg
>
> copying static files... WARNING: html_static_path entry
> '/<<PKGBUILDDIR>>/docs/_static' does not exist
> done
> copying extra files... done
> dumping search index in English (code: en) ... done
> dumping object inventory... done
> build succeeded, 4 warnings.
> dh_auto_build -O--buildsystem=pybuild
> I: pybuild base:184: /usr/bin/python3 setup.py build
> Skipping external program tests because of --force
> running build
> running build_py
> creating /<<PKGBUILDDIR>>/.pybuild/pythonX.Y_3.5/build/ocrmypdf
> copying ocrmypdf/unpaper.py ->
> /<<PKGBUILDDIR>>/.pybuild/pythonX.Y_3.5/build/ocrmypdf
> copying ocrmypdf/hocrtransform.py ->
> /<<PKGBUILDDIR>>/.pybuild/pythonX.Y_3.5/build/ocrmypdf
> copying ocrmypdf/pdfa.py ->
> /<<PKGBUILDDIR>>/.pybuild/pythonX.Y_3.5/build/ocrmypdf
> copying ocrmypdf/ghostscript.py ->
> /<<PKGBUILDDIR>>/.pybuild/pythonX.Y_3.5/build/ocrmypdf
> copying ocrmypdf/leptonica.py ->
> /<<PKGBUILDDIR>>/.pybuild/pythonX.Y_3.5/build/ocrmypdf
> copying ocrmypdf/tesseract.py ->
> /<<PKGBUILDDIR>>/.pybuild/pythonX.Y_3.5/build/ocrmypdf
> copying ocrmypdf/main.py ->
> /<<PKGBUILDDIR>>/.pybuild/pythonX.Y_3.5/build/ocrmypdf
> copying ocrmypdf/__init__.py ->
> /<<PKGBUILDDIR>>/.pybuild/pythonX.Y_3.5/build/ocrmypdf
> copying ocrmypdf/qpdf.py ->
> /<<PKGBUILDDIR>>/.pybuild/pythonX.Y_3.5/build/ocrmypdf
> copying ocrmypdf/__main__.py ->
> /<<PKGBUILDDIR>>/.pybuild/pythonX.Y_3.5/build/ocrmypdf
> copying ocrmypdf/pageinfo.py ->
> /<<PKGBUILDDIR>>/.pybuild/pythonX.Y_3.5/build/ocrmypdf
> creating /<<PKGBUILDDIR>>/.pybuild/pythonX.Y_3.5/build/ocrmypdf/data
> copying ocrmypdf/data/sRGB.icc ->
> /<<PKGBUILDDIR>>/.pybuild/pythonX.Y_3.5/build/ocrmypdf/data
> generating cffi module
> '/<<PKGBUILDDIR>>/.pybuild/pythonX.Y_3.5/build/ocrmypdf/lib/_leptonica.py'
> creating /<<PKGBUILDDIR>>/.pybuild/pythonX.Y_3.5/build/ocrmypdf/lib
> make[1]: Leaving directory '/<<PKGBUILDDIR>>'
>    debian/rules override_dh_auto_test
> make[1]: Entering directory '/<<PKGBUILDDIR>>'
> python3 setup.py test
> Checking for tesseract >= 3.03...
> Found tesseract 3.04.01
> Checking for gs >= 9.15...
> Found gs 9.26
> Checking for unpaper >= 6.1...
> Found unpaper 6.1
> Checking for qpdf >= 5.0.0...
> Found qpdf 6.0.0
> running pytest
> running egg_info
> creating ocrmypdf.egg-info
> writing requirements to ocrmypdf.egg-info/requires.txt
> writing ocrmypdf.egg-info/PKG-INFO
> writing top-level names to ocrmypdf.egg-info/top_level.txt
> writing entry points to ocrmypdf.egg-info/entry_points.txt
> writing dependency_links to ocrmypdf.egg-info/dependency_links.txt
> writing manifest file 'ocrmypdf.egg-info/SOURCES.txt'
> reading manifest file 'ocrmypdf.egg-info/SOURCES.txt'
> reading manifest template 'MANIFEST.in'
> warning: no previously-included files matching '*' found under directory
> 'tests/output'
> warning: no previously-included files matching '*' found under directory
> 'tests/output_pageinfo'
> warning: no previously-included files matching '*' found under directory
> 'tests/resources/private'
> warning: no previously-included files matching '*' found under directory
> 'tests/cache'
> warning: no previously-included files matching '*' found under directory
> '.github'
> warning: no previously-included files matching '*' found under directory
> 'docs/_build'
> warning: no previously-included files found matching 'tasks.py'
> warning: no previously-included files found matching
> 'ocrmypdf/lib/_leptonica.py'
> writing manifest file 'ocrmypdf.egg-info/SOURCES.txt'
> running build_ext
> generating cffi module 'ocrmypdf/lib/_leptonica.py'
> ============================= test session starts
> ==============================
> platform linux -- Python 3.5.3, pytest-3.0.6, py-1.4.32, pluggy-0.4.0
> rootdir: /<<PKGBUILDDIR>>, inifile: pytest.ini
> collected 84 items
>
> tests/test_hocrtransform.py .
> tests/test_main.py
> ........................F.ss...................................................
> tests/test_pageinfo.py ....
>
> =================================== FAILURES
> ===================================
> _________________________ test_preserve_metadata[pdfa]
> _________________________
>
> spoof_tesseract_noop = {'APT_CONFIG': '/var/lib/sbuild/apt.conf',
> 'CFLAGS': '-g -O2
> -fdebug-prefix-map=/<<PKGBUILDDIR>>=...bug-prefix-map=/<<PKGBUILDDIR>>=.
> -fstack-protector-strong -Wformat -Werror=format-security', ...}
> output_type = 'pdfa'
>
>     @pytest.mark.parametrize("output_type", [
>         'pdfa', 'pdf'
>         ])
>     def test_preserve_metadata(spoof_tesseract_noop, output_type):
>         pdf_before = pypdf.PdfFileReader(_infile('graph.pdf'))
>
>         output = check_ocrmypdf('graph.pdf', 'test_metadata_preserve.pdf',
>                                 '--output-type', output_type,
>                                 env=spoof_tesseract_noop)
>
>         pdf_after = pypdf.PdfFileReader(output)
>
>         for key in ('/Title', '/Author'):
> >           assert pdf_before.documentInfo[key] ==
> pdf_after.documentInfo[key]
>
> tests/test_main.py:245:
> _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> _ _ _
>
> self = {'/Producer': 'GPL Ghostscript 9.26', '/ModDate':
> "D:20170430232155Z00'00'", '/CreationDate': "D:20170430232155Z00'00'"}
> key = '/Title'
>
>     def __getitem__(self, key):
> >       return dict.__getitem__(self, key).getObject()
> E       KeyError: '/Title'
>
> /usr/lib/python3/dist-packages/PyPDF2/generic.py:520: KeyError
> ----------------------------- Captured stdout call
> -----------------------------
>    INFO - Output file is a PDF/A-2B (as expected)
>
> =============== 1 failed, 81 passed, 2 skipped in 608.18 seconds
> ===============
> debian/rules:44: recipe for target 'override_dh_auto_test' failed
> make[1]: *** [override_dh_auto_test] Error 1
> make[1]: Leaving directory '/<<PKGBUILDDIR>>'
> debian/rules:15: recipe for target 'build-indep' failed
> make: *** [build-indep] Error 2
> dpkg-buildpackage: error: debian/rules build-indep gave error exit status 2
>
> --------------------------------------------------------------------------------
>
> The build was made in my autobuilder with "dpkg-buildpackage -A"
> and it also fails here:
>
>
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/ocrmypdf.html
>
> If this is really a bug in one of the build-depends, please use reassign
> and affects,
> so that this is still visible in the BTS web page for this package.
>
> Thanks.
>
>

Reply via email to