Re: [pkg-fso-maint] Bug#547510: zhone refuse to start

View: New views
6 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: [pkg-fso-maint] Bug#547510: zhone refuse to start

by Joey Hess :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Joachim Breitner wrote:
> it seems that this is actually a bug in dh: It seems to call setup.py
> twice, once for each version of python, including adjusting the shebang
> line. Then, as the the python version tried last ist 2.4, this modified
> script is shipped with the package.
>
> I’m not sure what to do differently, thus I’m CC’ing Joey: Is there
> something wrong with the way we package zhone (a python script, not a
> library)?

dh_auto_* looks at pyversions -r to determine which versions of python
the package is targeting, and builds it for each version to support
C python modules.

joey@gnu:~/tmp/zhone-0-git20090610>pyversions -r
pyversions: missing XS-Python-Version in control file, fall back to debian/pyversions
pyversions: missing debian/pyversions file, fall back to supported versions
python2.4 python2.5

We discussed possible breakage in #520834 but missed the case that python
script shebang lines would be modified like this. This seems to be done
by python2.4 setup.py, but not by python2.5 setup.py. In the latter case
you get #!/usr/bin/python. (Is this a bug in python2.4?)

So I suppose you could work around it by adding the control field listing one
python version, probably 2.5.

--
see shy jo


signature.asc (197 bytes) Download Attachment

Re: [pkg-fso-maint] Bug#547510: zhone refuse to start

by Jakub Wilk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

* Joey Hess <joeyh@...>, 2009-09-23, 14:49:

>> it seems that this is actually a bug in dh: It seems to call setup.py
>> twice, once for each version of python, including adjusting the shebang
>> line. Then, as the the python version tried last ist 2.4, this modified
>> script is shipped with the package.
>>
>> I’m not sure what to do differently, thus I’m CC’ing Joey: Is there
>> something wrong with the way we package zhone (a python script, not a
>> library)?
>
>dh_auto_* looks at pyversions -r to determine which versions of python
>the package is targeting, and builds it for each version to support
>C python modules.
>
>joey@gnu:~/tmp/zhone-0-git20090610>pyversions -r
>pyversions: missing XS-Python-Version in control file, fall back to debian/pyversions
>pyversions: missing debian/pyversions file, fall back to supported versions
>python2.4 python2.5
>
>We discussed possible breakage in #520834 but missed the case that python
>script shebang lines would be modified like this. This seems to be done
>by python2.4 setup.py, but not by python2.5 setup.py. In the latter case
>you get #!/usr/bin/python. (Is this a bug in python2.4?)

Weird, dh should already take care of this:

$ grep shebang -C1 /usr/share/perl5/Debian/Debhelper/Buildsystem/python_distutils.pm
           # We need to to run setup.py with the default python first
           # as distutils/setuptools modifies the shebang lines of scripts.
           # This ensures that #!/usr/bin/python is used and not pythonX.Y

And, when I rebuild zhone from source, /usr/bin/zhone indeed ends up
with the proper #!/usr/bin/python shebang.

--
Jakub Wilk


--
To UNSUBSCRIBE, email to debian-python-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: [pkg-fso-maint] Bug#547510: zhone refuse to start

by Joachim Breitner :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi,

Am Mittwoch, den 23.09.2009, 21:27 +0200 schrieb Jakub Wilk:

> >We discussed possible breakage in #520834 but missed the case that python
> >script shebang lines would be modified like this. This seems to be done
> >by python2.4 setup.py, but not by python2.5 setup.py. In the latter case
> >you get #!/usr/bin/python. (Is this a bug in python2.4?)
>
> Weird, dh should already take care of this:
>
> $ grep shebang -C1 /usr/share/perl5/Debian/Debhelper/Buildsystem/python_distutils.pm
>            # We need to to run setup.py with the default python first
>            # as distutils/setuptools modifies the shebang lines of scripts.
>            # This ensures that #!/usr/bin/python is used and not pythonX.Y
>
> And, when I rebuild zhone from source, /usr/bin/zhone indeed ends up
> with the proper #!/usr/bin/python shebang.
I hope you didn’t try the version -5 I just uploaded :-)

Well, you need to ensure that the default python is run last, since the
last copy of the script is the one that gets installed. (At least that’s
my oberservation.)

Greetings,
Joachim

--
Joachim "nomeata" Breitner
Debian Developer
  nomeata@... | ICQ# 74513189 | GPG-Keyid: 4743206C
  JID: nomeata@... | http://people.debian.org/~nomeata


signature.asc (205 bytes) Download Attachment

Re: [pkg-fso-maint] Bug#547510: zhone refuse to start

by Joey Hess :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Joachim Breitner wrote:

> hi,
>
> Am Mittwoch, den 23.09.2009, 21:27 +0200 schrieb Jakub Wilk:
> > >We discussed possible breakage in #520834 but missed the case that python
> > >script shebang lines would be modified like this. This seems to be done
> > >by python2.4 setup.py, but not by python2.5 setup.py. In the latter case
> > >you get #!/usr/bin/python. (Is this a bug in python2.4?)
> >
> > Weird, dh should already take care of this:
> >
> > $ grep shebang -C1 /usr/share/perl5/Debian/Debhelper/Buildsystem/python_distutils.pm
> >            # We need to to run setup.py with the default python first
> >            # as distutils/setuptools modifies the shebang lines of scripts.
> >            # This ensures that #!/usr/bin/python is used and not pythonX.Y
> >
> > And, when I rebuild zhone from source, /usr/bin/zhone indeed ends up
> > with the proper #!/usr/bin/python shebang.
>
> I hope you didn’t try the version -5 I just uploaded :-)
>
> Well, you need to ensure that the default python is run last, since the
> last copy of the script is the one that gets installed. (At least that’s
> my oberservation.)
Bernd, did you get it backwards when writing the above code?

Build order does not actually matter, but installation order does.
At least in this case, the last python version to run the install
overwrites the script from the other version, so default should be last.

--
see shy jo


signature.asc (197 bytes) Download Attachment

Re: [pkg-fso-maint] Bug#547510: zhone refuse to start

by Bernd Zeimetz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Joey Hess wrote:
> Bernd, did you get it backwards when writing the above code?
>
> Build order does not actually matter, but installation order does.
> At least in this case, the last python version to run the install
> overwrites the script from the other version, so default should be last.

Normally the scripts are not copied a second time, if they exist at the
destination (have a look at winpdb, for example - if you want to build it in a
chroot, don't forget to s/python/python-all/ in the build-deps. So usually - and
in my experience - dh does the right thing as it is now.
The last time we had such an issue it was due to the setup.py doing weird things
(like creating the to-be-installed script on the fly). I didn't have the time to
investigate in zhone, but I'm kinda sure its an issue with its setup.py.


--
 Bernd Zeimetz                            Debian GNU/Linux Developer
 http://bzed.de                                http://www.debian.org
 GPG Fingerprints: 06C8 C9A2 EAAD E37E 5B2C BE93 067A AD04 C93B FF79
                   ECA1 E3F2 8E11 2432 D485 DD95 EB36 171A 6FF9 435F


--
To UNSUBSCRIBE, email to debian-python-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: [pkg-fso-maint] Bug#547510: zhone refuse to start

by Joey Hess :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Bernd Zeimetz wrote:
> Normally the scripts are not copied a second time, if they exist at the
> destination (have a look at winpdb, for example - if you want to build it in a
> chroot, don't forget to s/python/python-all/ in the build-deps. So usually - and
> in my experience - dh does the right thing as it is now.
> The last time we had such an issue it was due to the setup.py doing weird things
> (like creating the to-be-installed script on the fly). I didn't have the time to
> investigate in zhone, but I'm kinda sure its an issue with its setup.py.

I can reproduce the same problem with winpdb if I comment out
the rules file's inclusion of dpatch. The patching changes the
mtime of winpdb.py, and that *somehow* causes setup.py to behave
differently and in a way that dh_auto_install must accidentially
depend on.

--
see shy jo


signature.asc (197 bytes) Download Attachment