Python packaging for Fedora/CentOS requires /usr/bin/python which doesn't exist

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Python packaging for Fedora/CentOS requires /usr/bin/python which doesn't exist

Kristoffer Grönlund
Hi,

I'm having a problem with packaging crmsh for RH distros on OBS: It
seems that the rpm packages end up requiring /usr/bin/python which does
not exist on those distributions:

https://github.com/ClusterLabs/crmsh/issues/161

I can't see any direct requirement in the spec file which would do this
other than requiring python itself. I've looked at using the newer
python rpm macros for crmsh, but since it's a Makefile-based build with
some strange requirements, Python 2 only packaging a binary with extra
files etc., it's not straight-forward.

Any tips or help would be very much welcome :)

The packaging is here:

https://build.opensuse.org/package/show/network:ha-clustering:Stable/crmsh

Cheers,
Kristoffer

--
// Kristoffer Grönlund
// [hidden email]
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Python packaging for Fedora/CentOS requires /usr/bin/python which doesn't exist

jan matejek-4
On 9.8.2017 12:25, Kristoffer Grönlund wrote:

> Hi,
>
> I'm having a problem with packaging crmsh for RH distros on OBS: It
> seems that the rpm packages end up requiring /usr/bin/python which does
> not exist on those distributions:
>
> https://github.com/ClusterLabs/crmsh/issues/161
>
> I can't see any direct requirement in the spec file which would do this
> other than requiring python itself.

You get automatic requirements on shebang interpreters, i.e., what is listed after "#!" at start of
your script.

We're actually moving away from using /usr/bin/python. Would it help if you changed it to
/usr/bin/python2 ?

regards
m.
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Python packaging for Fedora/CentOS requires /usr/bin/python which doesn't exist

Neal Gompa
On Wed, Aug 9, 2017 at 12:20 PM, jan matejek <[hidden email]> wrote:

> On 9.8.2017 12:25, Kristoffer Grönlund wrote:
>> Hi,
>>
>> I'm having a problem with packaging crmsh for RH distros on OBS: It
>> seems that the rpm packages end up requiring /usr/bin/python which does
>> not exist on those distributions:
>>
>> https://github.com/ClusterLabs/crmsh/issues/161
>>
>> I can't see any direct requirement in the spec file which would do this
>> other than requiring python itself.
>
> You get automatic requirements on shebang interpreters, i.e., what is listed after "#!" at start of
> your script.
>
> We're actually moving away from using /usr/bin/python. Would it help if you changed it to
> /usr/bin/python2 ?

For what it's worth, we're moving away from /usr/bin/python in Fedora
as well. We recommend using /usr/bin/python2 or /usr/bin/python3 for
the version of python it should be used with.

--
真実はいつも一つ!/ Always, there's only one truth!
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Python packaging for Fedora/CentOS requires /usr/bin/python which doesn't exist

Kristoffer Grönlund
Neal Gompa <[hidden email]> writes:

> On Wed, Aug 9, 2017 at 12:20 PM, jan matejek <[hidden email]> wrote:
>> On 9.8.2017 12:25, Kristoffer Grönlund wrote:
>>> Hi,
>>>
>>> I'm having a problem with packaging crmsh for RH distros on OBS: It
>>> seems that the rpm packages end up requiring /usr/bin/python which does
>>> not exist on those distributions:
>>>
>>> https://github.com/ClusterLabs/crmsh/issues/161
>>>
>>> I can't see any direct requirement in the spec file which would do this
>>> other than requiring python itself.
>>
>> You get automatic requirements on shebang interpreters, i.e., what is listed after "#!" at start of
>> your script.
>>
>> We're actually moving away from using /usr/bin/python. Would it help if you changed it to
>> /usr/bin/python2 ?
>
> For what it's worth, we're moving away from /usr/bin/python in Fedora
> as well. We recommend using /usr/bin/python2 or /usr/bin/python3 for
> the version of python it should be used with.

Thank you, your recommendations seems to have put me on the right
track. I managed to clean up the binary requirements, but something
weird is happening when I change the shebang to /usr/bin/python2: The
rpm ends up still depending on /usr/bin/python. Could it be because
/usr/bin/python2 is a symlink to /usr/bin/python in the build
environment or something like that?

Cheers,
Kristoffer

>
> --
> 真実はいつも一つ!/ Always, there's only one truth!
>

--
// Kristoffer Grönlund
// [hidden email]
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Python packaging for Fedora/CentOS requires /usr/bin/python which doesn't exist

Neal Gompa
On Mon, Aug 14, 2017 at 4:50 PM, Kristoffer Grönlund <[hidden email]> wrote:

> Neal Gompa <[hidden email]> writes:
>
>> On Wed, Aug 9, 2017 at 12:20 PM, jan matejek <[hidden email]> wrote:
>>> On 9.8.2017 12:25, Kristoffer Grönlund wrote:
>>>> Hi,
>>>>
>>>> I'm having a problem with packaging crmsh for RH distros on OBS: It
>>>> seems that the rpm packages end up requiring /usr/bin/python which does
>>>> not exist on those distributions:
>>>>
>>>> https://github.com/ClusterLabs/crmsh/issues/161
>>>>
>>>> I can't see any direct requirement in the spec file which would do this
>>>> other than requiring python itself.
>>>
>>> You get automatic requirements on shebang interpreters, i.e., what is listed after "#!" at start of
>>> your script.
>>>
>>> We're actually moving away from using /usr/bin/python. Would it help if you changed it to
>>> /usr/bin/python2 ?
>>
>> For what it's worth, we're moving away from /usr/bin/python in Fedora
>> as well. We recommend using /usr/bin/python2 or /usr/bin/python3 for
>> the version of python it should be used with.
>
> Thank you, your recommendations seems to have put me on the right
> track. I managed to clean up the binary requirements, but something
> weird is happening when I change the shebang to /usr/bin/python2: The
> rpm ends up still depending on /usr/bin/python. Could it be because
> /usr/bin/python2 is a symlink to /usr/bin/python in the build
> environment or something like that?
>

Maybe. At least in RHEL/CentOS 7, /usr/bin/python is a symlink to
/usr/bin/python2, which is a symlink to /usr/bin/python2.7, so I doubt it.

You may have something somewhere still declaring "/usr/bin/python" or
"/usr/bin/env python" as a shebang.

Something is wrong if it's generating a dependency of /bin/python,
though. That means something is specifically setting "/bin/python" as
a shebang.

--
真実はいつも一つ!/ Always, there's only one truth!
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Python packaging for Fedora/CentOS requires /usr/bin/python which doesn't exist

Simon Lees-3
In reply to this post by Kristoffer Grönlund


On 15/08/17 06:20, Kristoffer Grönlund wrote:

> Neal Gompa <[hidden email]> writes:
>
>> On Wed, Aug 9, 2017 at 12:20 PM, jan matejek <[hidden email]> wrote:
>>> On 9.8.2017 12:25, Kristoffer Grönlund wrote:
>>>> Hi,
>>>>
>>>> I'm having a problem with packaging crmsh for RH distros on OBS: It
>>>> seems that the rpm packages end up requiring /usr/bin/python which does
>>>> not exist on those distributions:
>>>>
>>>> https://github.com/ClusterLabs/crmsh/issues/161
>>>>
>>>> I can't see any direct requirement in the spec file which would do this
>>>> other than requiring python itself.
>>>
>>> You get automatic requirements on shebang interpreters, i.e., what is listed after "#!" at start of
>>> your script.
>>>
>>> We're actually moving away from using /usr/bin/python. Would it help if you changed it to
>>> /usr/bin/python2 ?
>>
>> For what it's worth, we're moving away from /usr/bin/python in Fedora
>> as well. We recommend using /usr/bin/python2 or /usr/bin/python3 for
>> the version of python it should be used with.
>
> Thank you, your recommendations seems to have put me on the right
> track. I managed to clean up the binary requirements, but something
> weird is happening when I change the shebang to /usr/bin/python2: The
> rpm ends up still depending on /usr/bin/python. Could it be because
> /usr/bin/python2 is a symlink to /usr/bin/python in the build
> environment or something like that?
>
> Cheers,
> Kristoffer
>
Here on this tumbleweed machine /usr/bin/python is a symlink to  python2.7


--

Simon Lees (Simotek)                            http://simotek.net

Emergency Update Team                           keybase.io/simotek
SUSE Linux                           Adelaide Australia, UTC+10:30
GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B


signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Python packaging for Fedora/CentOS requires /usr/bin/python which doesn't exist

Simon Lees-3


On 15/08/17 08:12, Simon Lees wrote:

>
>
> On 15/08/17 06:20, Kristoffer Grönlund wrote:
>> Neal Gompa <[hidden email]> writes:
>>
>>> On Wed, Aug 9, 2017 at 12:20 PM, jan matejek <[hidden email]> wrote:
>>>> On 9.8.2017 12:25, Kristoffer Grönlund wrote:
>>>>> Hi,
>>>>>
>>>>> I'm having a problem with packaging crmsh for RH distros on OBS: It
>>>>> seems that the rpm packages end up requiring /usr/bin/python which does
>>>>> not exist on those distributions:
>>>>>
>>>>> https://github.com/ClusterLabs/crmsh/issues/161
>>>>>
>>>>> I can't see any direct requirement in the spec file which would do this
>>>>> other than requiring python itself.
>>>>
>>>> You get automatic requirements on shebang interpreters, i.e., what is listed after "#!" at start of
>>>> your script.
>>>>
>>>> We're actually moving away from using /usr/bin/python. Would it help if you changed it to
>>>> /usr/bin/python2 ?
>>>
>>> For what it's worth, we're moving away from /usr/bin/python in Fedora
>>> as well. We recommend using /usr/bin/python2 or /usr/bin/python3 for
>>> the version of python it should be used with.
>>
>> Thank you, your recommendations seems to have put me on the right
>> track. I managed to clean up the binary requirements, but something
>> weird is happening when I change the shebang to /usr/bin/python2: The
>> rpm ends up still depending on /usr/bin/python. Could it be because
>> /usr/bin/python2 is a symlink to /usr/bin/python in the build
>> environment or something like that?
>>
>> Cheers,
>> Kristoffer
>>
>
> Here on this tumbleweed machine /usr/bin/python is a symlink to  python2.7
>
>
Sorry for my usless answer should have drank my coffee and read the
thread properly

--

Simon Lees (Simotek)                            http://simotek.net

Emergency Update Team                           keybase.io/simotek
SUSE Linux                           Adelaide Australia, UTC+10:30
GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B


signature.asc (499 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Python packaging for Fedora/CentOS requires /usr/bin/python which doesn't exist

Adrian Schröter
In reply to this post by Neal Gompa
On Montag, 14. August 2017, 22:54:30 CEST wrote Neal Gompa:

> On Mon, Aug 14, 2017 at 4:50 PM, Kristoffer Grönlund <[hidden email]> wrote:
> > Neal Gompa <[hidden email]> writes:
> >
> >> On Wed, Aug 9, 2017 at 12:20 PM, jan matejek <[hidden email]> wrote:
> >>> On 9.8.2017 12:25, Kristoffer Grönlund wrote:
> >>>> Hi,
> >>>>
> >>>> I'm having a problem with packaging crmsh for RH distros on OBS: It
> >>>> seems that the rpm packages end up requiring /usr/bin/python which does
> >>>> not exist on those distributions:
> >>>>
> >>>> https://github.com/ClusterLabs/crmsh/issues/161
> >>>>
> >>>> I can't see any direct requirement in the spec file which would do this
> >>>> other than requiring python itself.
> >>>
> >>> You get automatic requirements on shebang interpreters, i.e., what is listed after "#!" at start of
> >>> your script.
> >>>
> >>> We're actually moving away from using /usr/bin/python. Would it help if you changed it to
> >>> /usr/bin/python2 ?
> >>
> >> For what it's worth, we're moving away from /usr/bin/python in Fedora
> >> as well. We recommend using /usr/bin/python2 or /usr/bin/python3 for
> >> the version of python it should be used with.
> >
> > Thank you, your recommendations seems to have put me on the right
> > track. I managed to clean up the binary requirements, but something
> > weird is happening when I change the shebang to /usr/bin/python2: The
> > rpm ends up still depending on /usr/bin/python. Could it be because
> > /usr/bin/python2 is a symlink to /usr/bin/python in the build
> > environment or something like that?
> >
>
> Maybe. At least in RHEL/CentOS 7, /usr/bin/python is a symlink to
> /usr/bin/python2, which is a symlink to /usr/bin/python2.7, so I doubt it.
>
> You may have something somewhere still declaring "/usr/bin/python" or
> "/usr/bin/env python" as a shebang.
>
> Something is wrong if it's generating a dependency of /bin/python,
> though. That means something is specifically setting "/bin/python" as
> a shebang.

I could define /usr/bin/python to a specific package given that there
is no definition which exact python version is to be used in RedHat (from
what I read here).

In which distros (or OBS projects) do you have this problem exactly?

--

Adrian Schroeter
email: [hidden email]

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
 
Maxfeldstraße 5                        
90409 Nürnberg
Germany


--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Python packaging for Fedora/CentOS requires /usr/bin/python which doesn't exist

Kristoffer Grönlund
Adrian Schröter <[hidden email]> writes:

>
> I could define /usr/bin/python to a specific package given that there
> is no definition which exact python version is to be used in RedHat (from
> what I read here).
>
> In which distros (or OBS projects) do you have this problem exactly?

CentOS 7 and RHEL 7.

If I build the package locally for openSUSE, I don't get any dependency
on /bin/python, but when it builds through the OBS, it still gets in
there. I'm rewriting all the shebangs to /usr/bin/python now which fixes
it, but there were none referring to /bin/python before: It must be
coming from calling "/usr/bin/env python".

However, rewriting to /usr/bin/python2 doesn't work as there's still a
dependency on /usr/bin/python getting in there somehow. :/

Cheers,
Kristoffer

>
> --
>
> Adrian Schroeter
> email: [hidden email]
>
> SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
>  
> Maxfeldstraße 5                        
> 90409 Nürnberg
> Germany
>
>

--
// Kristoffer Grönlund
// [hidden email]
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Python packaging for Fedora/CentOS requires /usr/bin/python which doesn't exist

Axel Braun-2
In reply to this post by Kristoffer Grönlund
Am Dienstag, 15. August 2017, 08:10:16 CEST schrieb Adrian Schröter:
> On Montag, 14. August 2017, 22:54:30 CEST wrote Neal Gompa:
> > On Mon, Aug 14, 2017 at 4:50 PM, Kristoffer Grönlund <[hidden email]>
wrote:

> > > Neal Gompa <[hidden email]> writes:
> > >> On Wed, Aug 9, 2017 at 12:20 PM, jan matejek <[hidden email]> wrote:
> > >>> On 9.8.2017 12:25, Kristoffer Grönlund wrote:
> > >>>> Hi,
> > >>>>
> > >>>> I'm having a problem with packaging crmsh for RH distros on OBS: It
> > >>>> seems that the rpm packages end up requiring /usr/bin/python which
> > >>>> does
> > >>>> not exist on those distributions:
> > >>>>
> > >>>> https://github.com/ClusterLabs/crmsh/issues/161
> > >>>>
> > >>>> I can't see any direct requirement in the spec file which would do
> > >>>> this
> > >>>> other than requiring python itself.
> > >>>
> > >>> You get automatic requirements on shebang interpreters, i.e., what is
> > >>> listed after "#!" at start of your script.
> > >>>
> > >>> We're actually moving away from using /usr/bin/python. Would it help
> > >>> if you changed it to /usr/bin/python2 ?
> > >>
> > >> For what it's worth, we're moving away from /usr/bin/python in Fedora
> > >> as well. We recommend using /usr/bin/python2 or /usr/bin/python3 for
> > >> the version of python it should be used with.
> > >
> > > Thank you, your recommendations seems to have put me on the right
> > > track. I managed to clean up the binary requirements, but something
> > > weird is happening when I change the shebang to /usr/bin/python2: The
> > > rpm ends up still depending on /usr/bin/python. Could it be because
> > > /usr/bin/python2 is a symlink to /usr/bin/python in the build
> > > environment or something like that?
> >
> > Maybe. At least in RHEL/CentOS 7, /usr/bin/python is a symlink to
> > /usr/bin/python2, which is a symlink to /usr/bin/python2.7, so I doubt it.
> >
> > You may have something somewhere still declaring "/usr/bin/python" or
> > "/usr/bin/env python" as a shebang.
> >
> > Something is wrong if it's generating a dependency of /bin/python,
> > though. That means something is specifically setting "/bin/python" as
> > a shebang.
>
> I could define /usr/bin/python to a specific package given that there
> is no definition which exact python version is to be used in RedHat (from
> what I read here).

You could do some kind of dynamc definition:
PACKAGE_DIR=$(ls -d /usr/lib/python3.* )/site-packages

HTH
Axel

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]