Bug#903698: sphinxbase: build appears broken for multiple python3 versions

Samuel Thibault sthibault at debian.org
Mon Oct 29 00:01:34 GMT 2018


Control: reassign -1 dh-python
Control: tags -1 + patch

Samuel Thibault, le mar. 16 oct. 2018 22:13:59 +0200, a ecrit:
> Samuel Thibault, le mar. 16 oct. 2018 03:04:16 +0200, a ecrit:
> > This is driving me crazy :)
> > 
> > I have uploaded the VM images on
> > https://people.debian.org/~sthibault/tmp/fails.img.gz
> > https://people.debian.org/~sthibault/tmp/works.img.gz
> > 
> > Booting one or the other does not matter. What does matter is the
> > disk image used to store the chroot. Each VM image has its own
> > /var/cache/pbuilder/sphinxbase-build directory (almost exactly the
> > same), and it does not matter which of the two I copy, if I copy it
> > inside the fails.img disk I'm getting the lintian issue, and if it's
> > inside the works.img disk I'm not getting it (there's a fresh checkout
> > of sphinbase in /tmp/sphinxbase inside the chroots). And of course my
> > own main system is in the fails case, thus preventing me from building
> > the package :) tune2fsk does not show any difference between the two
> > filesystem options, just creation time, mount count & such.
> > 
> > Any other idea of what could be different between the two filesystems?
> 
> It could very well be e.g. the resulting inode numbers and such, thus my
> hypothesis at the top of the quotes above. Python people can have a look
> at the fails.img.gz image, where the issue is notably reproducible from
> the chroot in /var/cache/pbuilder/sphinxbase-build , building for
> instance in /tmp/sphinxbase.

I overrided dh_python3 into /bin/false to catch the result just before
running dh_python3, the two build trees are similar except the .pyc
timestamps which are a few seconds apart in the 2.7 and 3.6 trees.

I then tried to pass -v to dh_python3, and got differing results,
as attached.  It seems in the failure case it indeed doesn't do
everything for 3.6: there are 4 lines less which rename the .so to a 36
variant.  I looked deeper in fs.py, and I found that in the succeeding
case, the main loop inside share_files sees _sphinbase.so before
_sphinxbase.so.0.0.0, and thus renames it, and in the failing case, that
loop sees _sphinxbase.so.0.0.0 before _sphinxbase.so.0, and when it
looks at _sphinxbase.so.0, exits() fails, because the target was moved,
and thus the symlink is now broken. I changed that exists() call into
lexists() to allow for broken symlinks, as the attached patch does, and
things got fixed. This seems like a logical thing to do, and possibly
needed in a few other places in fs.py

Samuel
-------------- next part --------------
D: dh_python3 dh_python3:161: version: 3.20180927
D: dh_python3 dh_python3:162: argv: ['/usr/bin/dh_python3', '-v']
D: dh_python3 dh_python3:163: options: {'guess_deps': True, 'skip_private': False, 'verbose': True, 'arch': None, 'package': None, 'no_package': None, 'compile_all': False, 'vrange': None, 'regexpr': None, 'accept_upstream_versions': False, 'depends': None, 'depends_section': None, 'recommends': None, 'recommends_section': None, 'suggests': None, 'suggests_section': None, 'requires': None, 'shebang': None, 'ignore_shebangs': False, 'clean_dbg_pkg': True, 'no_ext_rename': False, 'no_shebang_rewrite': False, 'O': None}
D: dh_python3 dh_python3:164: args: []
D: dh_python3 dh_python3:166: supported Python versions: 3.6,3.7 (default=3.6)
D: dh_python3 debhelper:100: skipping package libsphinxbase-doc (missing ${python3:Depends} in Depends)
D: dh_python3 debhelper:100: skipping package libsphinxbase-dev (missing ${python3:Depends} in Depends)
D: dh_python3 debhelper:100: skipping package sphinxbase-utils (missing ${python3:Depends} in Depends)
D: dh_python3 debhelper:100: skipping package libsphinxbase3 (missing ${python3:Depends} in Depends)
D: dh_python3 debhelper:107: skipping package: python-sphinxbase
D: dh_python3 debhelper:100: skipping package swig-sphinxbase (missing ${python3:Depends} in Depends)
D: dh_python3 debhelper:153: source=sphinxbase, binary packages=['python3-sphinxbase']
D: dh_python3 dh_python3:183: processing package python3-sphinxbase...
D: dh_python3 fs:49: moving files from debian/python3-sphinxbase/usr/lib/python3.6/site-packages to debian/python3-sphinxbase/usr/lib/python3/dist-packages/
I: dh_python3 fs:312: removing symlink: debian/python3-sphinxbase/usr/lib/python3.6/site-packages/sphinxbase/_sphinxbase.so
I: dh_python3 fs:314: renaming debian/python3-sphinxbase/usr/lib/python3.6/site-packages/sphinxbase/_sphinxbase.so.0.0.0 to _sphinxbase.so
D: dh_python3 tools:230: invoking: python3.6 -c 'import sysconfig as s;print("__SEP__".join(i or "" for i in s.get_config_vars("SOABI", "MULTIARCH", "INCLUDEPY", "LIBPL", "LDLIBRARY")))'
I: dh_python3 fs:329: renaming _sphinxbase.so to _sphinxbase.cpython-36m-x86_64-linux-gnu.so
D: dh_python3 fs:49: moving files from debian/python3-sphinxbase/usr/lib/python3.7/site-packages to debian/python3-sphinxbase/usr/lib/python3/dist-packages/
I: dh_python3 fs:312: removing symlink: debian/python3-sphinxbase/usr/lib/python3.7/site-packages/sphinxbase/_sphinxbase.so
I: dh_python3 fs:314: renaming debian/python3-sphinxbase/usr/lib/python3.7/site-packages/sphinxbase/_sphinxbase.so.0.0.0 to _sphinxbase.so
D: dh_python3 tools:230: invoking: python3.7 -c 'import sysconfig as s;print("__SEP__".join(i or "" for i in s.get_config_vars("SOABI", "MULTIARCH", "INCLUDEPY", "LIBPL", "LDLIBRARY")))'
I: dh_python3 fs:329: renaming _sphinxbase.so to _sphinxbase.cpython-37m-x86_64-linux-gnu.so
I: dh_python3 fs:208: removing dangling symlink: debian/python3-sphinxbase/usr/lib/python3/dist-packages/sphinxbase/_sphinxbase.so.0
D: dh_python3 fs:246: package python3-sphinxbase details = {'requires.txt': set(), 'egg-info': set(), 'nsp.txt': set(), 'shebangs': set(), 'public_vers': {Version('3')}, 'private_dirs': {}, 'compile': True, 'ext_vers': {Version('3.7'), Version('3.6')}, 'ext_no_version': set()}
D: dh_python3 depends:114: generating dependencies for package python3-sphinxbase
D: dh_python3 depends:272: D={'python3:any (>= 3.0~)', 'python3 (<< 3.8)', 'python3:any', 'python3 (>= 3.6~)'}; R=[]; S=[]; E=[], B=[]; RT=[]
-------------- next part --------------
D: dh_python3 dh_python3:161: version: 3.20180927
D: dh_python3 dh_python3:162: argv: ['/usr/bin/dh_python3', '-v']
D: dh_python3 dh_python3:163: options: {'guess_deps': True, 'skip_private': False, 'verbose': True, 'arch': None, 'package': None, 'no_package': None, 'compile_all': False, 'vrange': None, 'regexpr': None, 'accept_upstream_versions': False, 'depends': None, 'depends_section': None, 'recommends': None, 'recommends_section': None, 'suggests': None, 'suggests_section': None, 'requires': None, 'shebang': None, 'ignore_shebangs': False, 'clean_dbg_pkg': True, 'no_ext_rename': False, 'no_shebang_rewrite': False, 'O': None}
D: dh_python3 dh_python3:164: args: []
D: dh_python3 dh_python3:166: supported Python versions: 3.6,3.7 (default=3.6)
D: dh_python3 debhelper:100: skipping package libsphinxbase-doc (missing ${python3:Depends} in Depends)
D: dh_python3 debhelper:100: skipping package libsphinxbase-dev (missing ${python3:Depends} in Depends)
D: dh_python3 debhelper:100: skipping package sphinxbase-utils (missing ${python3:Depends} in Depends)
D: dh_python3 debhelper:100: skipping package libsphinxbase3 (missing ${python3:Depends} in Depends)
D: dh_python3 debhelper:107: skipping package: python-sphinxbase
D: dh_python3 debhelper:100: skipping package swig-sphinxbase (missing ${python3:Depends} in Depends)
D: dh_python3 debhelper:153: source=sphinxbase, binary packages=['python3-sphinxbase']
D: dh_python3 dh_python3:183: processing package python3-sphinxbase...
D: dh_python3 fs:49: moving files from debian/python3-sphinxbase/usr/lib/python3.6/site-packages to debian/python3-sphinxbase/usr/lib/python3/dist-packages/
D: dh_python3 fs:49: moving files from debian/python3-sphinxbase/usr/lib/python3.7/site-packages to debian/python3-sphinxbase/usr/lib/python3/dist-packages/
W: dh_python3 fs:98: Paths differ: debian/python3-sphinxbase/usr/lib/python3.7/site-packages/sphinxbase/_sphinxbase.so.0.0.0 and debian/python3-sphinxbase/usr/lib/python3/dist-packages/sphinxbase/_sphinxbase.so.0.0.0
Traceback (most recent call last):
  File "/usr/bin/dh_python3", line 280, in <module>
    main()
  File "/usr/bin/dh_python3", line 197, in main
    fix_locations(package, interpreter, SUPPORTED, options)
  File "/usr/share/dh-python/dhpython/fs.py", line 50, in fix_locations
    share_files(srcdir, dstdir, interpreter, options)
  File "/usr/share/dh-python/dhpython/fs.py", line 93, in share_files
    share_files(fpath1, fpath2, interpreter, options)
  File "/usr/share/dh-python/dhpython/fs.py", line 101, in share_files
    fromlines = fp1.readlines()
  File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb0 in position 40: ordinal not in range(128)
-------------- next part --------------
--- dh-python-3.20180927/dhpython/fs.py.orig	2018-10-29 00:55:27.492124161 +0100
+++ dh-python-3.20180927/dhpython/fs.py	2018-10-29 00:55:29.032126779 +0100
@@ -24,7 +24,7 @@
 import re
 import sys
 from filecmp import cmp as cmpfile
-from os.path import exists, isdir, islink, join, realpath, split, splitext
+from os.path import lexists, exists, isdir, islink, join, realpath, split, splitext
 from shutil import rmtree
 from stat import ST_MODE, S_IXUSR, S_IXGRP, S_IXOTH
 from dhpython import MULTIARCH_DIR_TPL
@@ -69,7 +69,7 @@
     """Try to move as many files from srcdir to dstdir as possible."""
     for i in os.listdir(srcdir):
         fpath1 = join(srcdir, i)
-        if not exists(fpath1):  # removed in rename_ext
+        if not lexists(fpath1):  # removed in rename_ext
             continue
         if not options.no_ext_rename and splitext(i)[-1] == '.so':
             # try to rename extension here as well (in :meth:`scan` info about


More information about the Pkg-a11y-devel mailing list