mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] host-python
@ 2016-02-11 13:42 Erwin Rol
  2016-02-15  8:48 ` Michael Olbrich
  0 siblings, 1 reply; 4+ messages in thread
From: Erwin Rol @ 2016-02-11 13:42 UTC (permalink / raw)
  To: ptxdist

Hallo,

The host-python package removes the "python" file after install with the
following reason;

# remove "python" so that it doesn't interfere with the build
# machine's python
#
# the target build proces will only use python with the
# python-$(PYTHON_MAJORMINOR)

But isn't the reason of wanting host-python that the real host python
isn't good enough (wrong version) ?

So I don't really understand the idea behind using host-python and than
"breaking" it so it doesn't get found unless you change every reference
to "python" into "pyhton-2"

Do things break when "python" from host-python is found ?

- Erwin

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] host-python
  2016-02-11 13:42 [ptxdist] host-python Erwin Rol
@ 2016-02-15  8:48 ` Michael Olbrich
  2016-02-15  9:36   ` Erwin Rol
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Olbrich @ 2016-02-15  8:48 UTC (permalink / raw)
  To: ptxdist

Hi,

On Thu, Feb 11, 2016 at 02:42:19PM +0100, Erwin Rol wrote:
> The host-python package removes the "python" file after install with the
> following reason;
> 
> # remove "python" so that it doesn't interfere with the build
> # machine's python
> #
> # the target build proces will only use python with the
> # python-$(PYTHON_MAJORMINOR)
> 
> But isn't the reason of wanting host-python that the real host python
> isn't good enough (wrong version) ?
> 
> So I don't really understand the idea behind using host-python and than
> "breaking" it so it doesn't get found unless you change every reference
> to "python" into "pyhton-2"
> 
> Do things break when "python" from host-python is found ?

This stuff is a bit tricky:

We have the Python 2.x installed in the system by your distribution.
PTXdist does the basic check for this in it's configure script.
This is for any package that uses Python in it's build process but not on
the target and works with any recent Python 2.x version.
If extra modules are needed, they are handled by the host-system-python
package.

Then we have host-python. This is used for anything that is related to
Python on the target. Usually that means packages that install Python
modules on the target.

We could use host-python for everything, but that would mean, that we need
to compile it for basically every BSP and add a lot of host Python modules.
I'd like to avoid that.

In the first case, there are usually scripts with "/usr/bin/env python" as
shebang, so the 'python' used for this should be the first in $PATH.
For the second case we can usually specify the python binary, because we're
building for a specific version.
By deleting the 'python' link for host-python we can handle both cases.

Regards,
Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] host-python
  2016-02-15  8:48 ` Michael Olbrich
@ 2016-02-15  9:36   ` Erwin Rol
  2016-02-15  9:46     ` Michael Olbrich
  0 siblings, 1 reply; 4+ messages in thread
From: Erwin Rol @ 2016-02-15  9:36 UTC (permalink / raw)
  To: ptxdist

On 15-2-2016 9:48, Michael Olbrich wrote:
> Hi,
> 
> On Thu, Feb 11, 2016 at 02:42:19PM +0100, Erwin Rol wrote:
>> The host-python package removes the "python" file after install with the
>> following reason;
>>
>> # remove "python" so that it doesn't interfere with the build
>> # machine's python
>> #
>> # the target build proces will only use python with the
>> # python-$(PYTHON_MAJORMINOR)
>>
>> But isn't the reason of wanting host-python that the real host python
>> isn't good enough (wrong version) ?
>>
>> So I don't really understand the idea behind using host-python and than
>> "breaking" it so it doesn't get found unless you change every reference
>> to "python" into "pyhton-2"
>>
>> Do things break when "python" from host-python is found ?
> 
> This stuff is a bit tricky:

Yep I noticed that, my not deleting python hack broke ptxdist due to
missing imports.

> We have the Python 2.x installed in the system by your distribution.
> PTXdist does the basic check for this in it's configure script.
> This is for any package that uses Python in it's build process but not on
> the target and works with any recent Python 2.x version.
> If extra modules are needed, they are handled by the host-system-python
> package.

My real-host (redhat/centos 6) python is to old (2.6), qt5 needs 2.7.

> Then we have host-python. This is used for anything that is related to
> Python on the target. Usually that means packages that install Python
> modules on the target.
> 
> We could use host-python for everything, but that would mean, that we need
> to compile it for basically every BSP and add a lot of host Python modules.
> I'd like to avoid that.
> 
> In the first case, there are usually scripts with "/usr/bin/env python" as
> shebang, so the 'python' used for this should be the first in $PATH.
> For the second case we can usually specify the python binary, because we're
> building for a specific version.
> By deleting the 'python' link for host-python we can handle both cases.

I now tricked it by making a sym-link to the host-python 2.7 exe in the
qt5 build directory and change the QT5_PATH in the qt5.make file. That
way it seems host-python is only picked up when building qt5
(qtwebengine needs it). This probably only works because qt5/webengine
uses the "/usr/bin/env python" construct.

- Erwin




_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] host-python
  2016-02-15  9:36   ` Erwin Rol
@ 2016-02-15  9:46     ` Michael Olbrich
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Olbrich @ 2016-02-15  9:46 UTC (permalink / raw)
  To: ptxdist

On Mon, Feb 15, 2016 at 10:36:53AM +0100, Erwin Rol wrote:
> On 15-2-2016 9:48, Michael Olbrich wrote:
> > Hi,
> > 
> > On Thu, Feb 11, 2016 at 02:42:19PM +0100, Erwin Rol wrote:
> >> The host-python package removes the "python" file after install with the
> >> following reason;
> >>
> >> # remove "python" so that it doesn't interfere with the build
> >> # machine's python
> >> #
> >> # the target build proces will only use python with the
> >> # python-$(PYTHON_MAJORMINOR)
> >>
> >> But isn't the reason of wanting host-python that the real host python
> >> isn't good enough (wrong version) ?
> >>
> >> So I don't really understand the idea behind using host-python and than
> >> "breaking" it so it doesn't get found unless you change every reference
> >> to "python" into "pyhton-2"
> >>
> >> Do things break when "python" from host-python is found ?
> > 
> > This stuff is a bit tricky:
> 
> Yep I noticed that, my not deleting python hack broke ptxdist due to
> missing imports.
> 
> > We have the Python 2.x installed in the system by your distribution.
> > PTXdist does the basic check for this in it's configure script.
> > This is for any package that uses Python in it's build process but not on
> > the target and works with any recent Python 2.x version.
> > If extra modules are needed, they are handled by the host-system-python
> > package.
> 
> My real-host (redhat/centos 6) python is to old (2.6), qt5 needs 2.7.

I see. I would accept a patch for an option to use host-python for
host-system-python.

> > Then we have host-python. This is used for anything that is related to
> > Python on the target. Usually that means packages that install Python
> > modules on the target.
> > 
> > We could use host-python for everything, but that would mean, that we need
> > to compile it for basically every BSP and add a lot of host Python modules.
> > I'd like to avoid that.
> > 
> > In the first case, there are usually scripts with "/usr/bin/env python" as
> > shebang, so the 'python' used for this should be the first in $PATH.
> > For the second case we can usually specify the python binary, because we're
> > building for a specific version.
> > By deleting the 'python' link for host-python we can handle both cases.
> 
> I now tricked it by making a sym-link to the host-python 2.7 exe in the
> qt5 build directory and change the QT5_PATH in the qt5.make file. That
> way it seems host-python is only picked up when building qt5
> (qtwebengine needs it). This probably only works because qt5/webengine
> uses the "/usr/bin/env python" construct.

Actually, that should work with most packages. For some distros 'python' is
python3 and we use the symlink <ptxdist>/bin/python to provice the correct
python version.

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-02-15  9:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-11 13:42 [ptxdist] host-python Erwin Rol
2016-02-15  8:48 ` Michael Olbrich
2016-02-15  9:36   ` Erwin Rol
2016-02-15  9:46     ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox