Bug#935887: python3-mapproxy: Change default template_dir and fix capabilities for Python >= 3.6.7

Marek Lukács marek.lukacs at gmail.com
Tue Aug 27 20:53:01 BST 2019


Hi Bas,

at the moment I do not have good sandbox for playing with packaging. But I
have checked the source package of mapproxy_1.11.0-3 (Debian Buster apt).

As I have not tested it and I just read it and checked on my filesystem I
get feeling, that something is going wrong during packaging. Looks like the
debain/rules do some tweaks, move files and create symlinks and uses
../python3.7/... names. Than probably something (or task of dh) renames
.../python3.7/... to .../python3/...

I am not good in package maintenance and do not know the correct sequence
it executes during packaging.

I have the possible explanation, what happens:

For me it looks like, it moves /templates/ from
/usr/lib/python3.7/dist-packages into /usr/share/python3-mapproxy and
creates broken link in /usr/lib/python3.7/dist-packages pointing to
(system) /usr/lib/python3.7/dist-packages (I expect that the file is
missing on building machine, so it is broken link). Later dh (or whatever
it is) task which corrects it, it ignores broken links so it will not fix
it, and those broken links remains and for example on my system I see those
links really in /usr/lib/python3.7/dist-packages/mapproxy/...

But as I noticed, I have not tested it, and I do not fully understand to
packaging sequences and tools, so it is only my feeling.

Why I get this feeling:

Check mapproxy-1.11.0/debian/rules, block override_dh_auto_install and
inside this block to following part:

        for V in `py3versions -v -s`; do \
                for F in DejaVuSans.ttf DejaVuSansMono.ttf; do \
                        $(RM)
debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/image/fonts/$$F
; \
                        ln -s /usr/share/fonts/truetype/dejavu/$$F \

debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/image/fonts/$$F
; \
                done ; \
                if [ ! -e
debian/python3-$(PYBUILD_NAME)/usr/share/python3-$(PYBUILD_NAME)/service/templates
]; then \
                        mkdir -p
debian/python3-$(PYBUILD_NAME)/usr/share/python3-$(PYBUILD_NAME)/service ; \
                        mv
debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/service/templates
\

 debian/python3-$(PYBUILD_NAME)/usr/share/python3-$(PYBUILD_NAME)/service/
; \
                else \
                        $(RM) -r
debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/service/templates
; \
                fi ; \
                ln -s /usr/share/python3-$(PYBUILD_NAME)/service/templates \

debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/service/templates
; \
                if [ ! -e
debian/python3-$(PYBUILD_NAME)/usr/share/python3-$(PYBUILD_NAME)/test/schemas
]; then \
                        mkdir -p
debian/python3-$(PYBUILD_NAME)/usr/share/python3-$(PYBUILD_NAME)/test ; \
                        mv
debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/test/schemas
\

 debian/python3-$(PYBUILD_NAME)/usr/share/python3-$(PYBUILD_NAME)/test/ ; \
                else \
                        $(RM) -r
debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/test/schemas
; \
                fi ; \
                ln -s /usr/share/python3-$(PYBUILD_NAME)/test/schemas \

debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/test/schemas
; \
                if [ ! -e
debian/python3-$(PYBUILD_NAME)/usr/share/python3-$(PYBUILD_NAME)/test/system/fixture/cache_data
]; then \
                        mkdir -p
debian/python3-$(PYBUILD_NAME)/usr/share/python3-$(PYBUILD_NAME)/test/system/fixture
; \
                        mv
debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/test/system/fixture/cache_data
\

 debian/python3-$(PYBUILD_NAME)/usr/share/python3-$(PYBUILD_NAME)/test/system/fixture/
; \
                else \
                        $(RM) -r
debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/test/system/fixture/cache_data
; \
                fi ; \
                ln -s
/usr/share/python3-$(PYBUILD_NAME)/test/system/fixture/cache_data \

debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/test/system/fixture/cache_data
; \
        done

For me it looks like it move templates from
debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/service/templates
into
debian/python3-$(PYBUILD_NAME)/usr/share/python3-$(PYBUILD_NAME)/service/templates,
but it creates symlink
debian/python3-$(PYBUILD_NAME)/usr/lib/python$$V/dist-packages/mapproxy/service/templates
pointing to system path
/usr/share/python3-$(PYBUILD_NAME)/service/templates instead expected
debian/usr/share/python3-$(PYBUILD_NAME)/service/templates, so debian is
missing at the beginning ($(PYBUILD_NAME)=mapproxy, $$V=3.7 (result of
py3versions -v -s)).

During build time it creates broken symlink, as system path
/usr/share/python3-$(PYBUILD_NAME)/service/templates does not exists at the
build time.

Same bug is in python2.7 part, but in this case /usr/lib/python2.7 is not
renamed into something else, and if on building system is already installed
older package, than the link is created to existing system files, so later
"dh" task (or what ever it is) correctly do it.

For me it is possible explanation, why it works for font links and
python2.7 and not works for the python3 other links. But again, do not
fully understand packaging, so it is only my guess. My feeling is, that
there is missing debian/ in front of link paths.

For the issue with capabilities I prepared patch
python3.7-capabilities.patch I attached. This patch can be included into
patches and patches/series.

Everything I am writing is about stable package from Debian Buster.

Explanation why I use Python 3.7 instead of 2.7. Since Debian Buster I used
only Python 2.7. For me Debian release is like milestone in my computer
life, so for example with Buster I changed:

iptables > nftables
python-2.7 > python-3.7

I already rewrite almost all my own python scripts and tools into Python
3.7 and using libapache2-mod-wsgi-py3.

For me it is more like personal choice, than rational choice, meaning
switching to Python 3.7. I am fine to patch only my package using dpkg-deb
tool every time you release new package version. After today's experience
and investigation I have lot of notes. :-)

You can close the ticket if you want, as Python 2.7 version works.

And one more tip: I saw in debian/mapproxy.links:
usr/lib/python-mapproxy/mapproxy-seed usr/bin/mapproxy-seed
usr/lib/python-mapproxy/mapproxy-util usr/bin/mapproxy-util

It will be very useful for those using Python 3 to add:
usr/lib/python3-mapproxy/mapproxy-seed usr/bin/mapproxy-seed
usr/lib/python3-mapproxy/mapproxy-util usr/bin/mapproxy-util

Best regards,

Marek



On Tue, Aug 27, 2019 at 6:25 PM Sebastiaan Couwenberg <sebastic at xs4all.nl>
wrote:

> Control: tags -1 - moreinfo
> Control: severity -1 important
>
> I've installed mapproxy on a test server with stretch, it contains the
> symlinks as well:
>
>  # find /usr/lib/python2.7/dist-packages/mapproxy/ -type l -exec ls -l {}
> \;
>  lrwxrwxrwx 1 root root 73 Jan  7  2018
> /usr/lib/python2.7/dist-packages/mapproxy/test/system/fixture/cache_data
> ->
> ../../../../../../../share/python-mapproxy/test/system/fixture/cache_data
>  lrwxrwxrwx 1 root root 49 Jan  7  2018
> /usr/lib/python2.7/dist-packages/mapproxy/test/schemas ->
> ../../../../../share/python-mapproxy/test/schemas
>  lrwxrwxrwx 1 root root 54 Jan  7  2018
> /usr/lib/python2.7/dist-packages/mapproxy/service/templates ->
> ../../../../../share/python-mapproxy/service/templates
>  lrwxrwxrwx 1 root root 60 Jan  7  2018
> /usr/lib/python2.7/dist-packages/mapproxy/image/fonts/DejaVuSans.ttf ->
> ../../../../../../share/fonts/truetype/dejavu/DejaVuSans.ttf
>  lrwxrwxrwx 1 root root 64 Jan  7  2018
> /usr/lib/python2.7/dist-packages/mapproxy/image/fonts/DejaVuSansMono.ttf
> -> ../../../../../../share/fonts/truetype/dejavu/DejaVuSansMono.ttf
>
> It as successfully serves the demo with your mapproxy.yaml, both the PNG
> & Capabilities document.
>
> After the upgrade to buster, the demo still works when using the default
> python2.7 packages, python-mapproxy also contains the symlinks:
>
>  # find /usr/lib/python2.7/dist-packages/mapproxy/ -type l -exec ls -l {}
> \;
>  lrwxrwxrwx 1 root root 73 Jan  7  2018
> /usr/lib/python2.7/dist-packages/mapproxy/test/system/fixture/cache_data
> ->
> ../../../../../../../share/python-mapproxy/test/system/fixture/cache_data
>  lrwxrwxrwx 1 root root 49 Jan  7  2018
> /usr/lib/python2.7/dist-packages/mapproxy/test/schemas ->
> ../../../../../share/python-mapproxy/test/schemas
>  lrwxrwxrwx 1 root root 54 Jan  7  2018
> /usr/lib/python2.7/dist-packages/mapproxy/service/templates ->
> ../../../../../share/python-mapproxy/service/templates
>  lrwxrwxrwx 1 root root 60 Jul 31  2018
> /usr/lib/python2.7/dist-packages/mapproxy/image/fonts/DejaVuSans.ttf ->
> ../../../../../../share/fonts/truetype/dejavu/DejaVuSans.ttf
>  lrwxrwxrwx 1 root root 64 Jul 31  2018
> /usr/lib/python2.7/dist-packages/mapproxy/image/fonts/DejaVuSansMono.ttf
> -> ../../../../../../share/fonts/truetype/dejavu/DejaVuSansMono.ttf
>
> python3-mapproxy indeed does not:
>
>  # find /usr/lib/python3/dist-packages/mapproxy/ -type l -exec ls -l {} \;
>  lrwxrwxrwx 1 root root 60 Jul 31  2018
> /usr/lib/python3/dist-packages/mapproxy/image/fonts/DejaVuSans.ttf ->
> ../../../../../../share/fonts/truetype/dejavu/DejaVuSans.ttf
>  lrwxrwxrwx 1 root root 64 Jul 31  2018
> /usr/lib/python3/dist-packages/mapproxy/image/fonts/DejaVuSansMono.ttf
> -> ../../../../../../share/fonts/truetype/dejavu/DejaVuSansMono.ttf
>
> And hence also cannot run the demo successfully.
>
> I've downgraded the severity of this issue since the defaults still work.
>
> While mapproxy 1.11.1 doesn't contain any related changes, it does
> successfully serve the PNG with Python 3 on bullseye (testing). It fails
> with an internal error for the Capabilities document:
>
>  TypeError: Extra position arguments: True at line 169 column 3 in file
>
> /usr/lib/python3/dist-packages/mapproxy/service/templates/wms111capabilities.xml
>
> I'll fix this first in unstable by cherry-picking the commit.
>
> Do you really need to run mapproxy with Python 3 on buster?
>
> If not, we can leave the package as it, just use python-mapproxy on
> buster (which is installed as a dependency of the mapproxy package).
>
> Otherwise I'll need to prepare a stable update with the commit for the
> TypeError and find a fix for the missing symlinks in the python3 package.
>
> Kind Regards,
>
> Bas
>
> --
>  GPG Key ID: 4096R/6750F10AE88D4AF1
> Fingerprint: 8182 DE41 7056 408D 6146  50D1 6750 F10A E88D 4AF1
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20190827/1bb4c16e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: python3.7-capabilities.patch
Type: application/octet-stream
Size: 1831 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20190827/1bb4c16e/attachment-0001.obj>


More information about the Pkg-grass-devel mailing list