[Edgy] python-distutils class assumes pycentral if DEB_PYTHON_SYSTEM not defined

Bug #53568 reported by Sami Haahtinen
4
Affects Status Importance Assigned to Milestone
cdbs (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

python-distutils.mk.in has tests that will default to pycentral if DEB_PYTHON_SYSTEM is not defined.

Even if building without pysupport and pycentral is not recommended anymore, there are cases where this option is required.

Revision history for this message
Sami Haahtinen (ressu) wrote :

Adding a patch to wrap 2 cases of incomplete tests inside ifdef DEB_PYTHON_SYSTEM clauses.

Revision history for this message
Jérémie Corbier (jcorbier) wrote :

Thanks for your bug report. Please take a closer look at python-distutils.mk.in and especially at the beginning of the file (starting from line 51):

--- 8< ---
ifeq (pysupport, $(DEB_PYTHON_SYSTEM))
(...)
else
  ifeq (pycentral, $(DEB_PYTHON_SYSTEM))
(...)
  else
    ifneq (, $(DEB_PYTHON_SYSTEM))
      $(error unsupported Python system: $(DEB_PYTHON_SYSTEM) (select either pysupport or pycentral))
    else
(...)
      ifneq (, $(cdbs_use_xs_field))
        $(error Your package uses the new Python policy; you must set DEB_PYTHON_SYSTEM to "pysupport" or "pycentral".)
      endif
(...)
    endif # unknown method
  endif # pycentral
endif # pysupport
--- 8< ---

Therefore if you try to build a package following the new python policy (e.g. if there's a debian/pycompat file) and without defining DEB_PYTHON_SYSTEM the build will fail. If cdbs can't find a clue about whether the package follows the new or the old policy and if DEB_PYTHON_SYSTEM is not defined then the package will be built following the old policy (and it will display a big fat warning ;))

Changed in cdbs:
status: Unconfirmed → Rejected
Revision history for this message
Sami Haahtinen (ressu) wrote : Re: [Bug 53568] Re: [Edgy] python-distutils class assumes pycentral if DEB_PYTHON_SYSTEM not defined

Jérémie Corbier wrote:
> Therefore if you try to build a package following the new python policy
> (e.g. if there's a debian/pycompat file) and without defining
> DEB_PYTHON_SYSTEM the build will fail. If cdbs can't find a clue about
> whether the package follows the new or the old policy and if
> DEB_PYTHON_SYSTEM is not defined then the package will be built
> following the old policy (and it will display a big fat warning ;))

Actually, this is wrong.

It will display a big fat warning (as it should) and it attempts to
build without the new system, but even still it will call dh_pycentral.
if you take a look at the patch, it will become quite obvious why this
happens. The cdbs makefile only tests if DEB_PYTHON_SYSTEM matches
pysupport and assumes that pycentral is the only other logical choice
without taking in to account that there might be cases where this if
clauses are hit without DEB_PYTHON_SYSTEM being defined.

So, even if cdbs is supposed to fall back to building with the old
system, it will build with an uninitialized pycentral support instead.

- s

Revision history for this message
Jérémie Corbier (jcorbier) wrote :

Nope. It doesn't work like that. Your patch modifies the new policy part of python-distutils.mk:

--- 8< ---
ifndef DEB_PYTHON_SYSTEM
#### old policy method ####
(...)
else
#### new policy methods ####
(... patch applies here ...)
endif
--- 8< ---

And this part can only be reached if either pysupport or pycentral is used.

Revision history for this message
Sami Haahtinen (ressu) wrote :

Jérémie Corbier wrote:
> And this part can only be reached if either pysupport or pycentral is
> used.

Hmm..

I must be loosing it here. For some reason i can't reproduce this
anymore either. Or it might be that it was a bug in my packaging that i
hit without realizing it. Oh well.

Sorry for bugging you (pun intended ;)

- S

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.