diff options
author | Mark Asselstine <mark.asselstine@windriver.com> | 2017-01-13 16:49:56 -0500 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2017-01-14 19:26:17 -0500 |
commit | b6d051a19770e65bd23bccbd2fc6e948092a6f16 (patch) | |
tree | 6cd71317a88a7f731cf3f55a49c9ded2df4e4ab3 /recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch | |
parent | 9152441483600a4f102320c805e892a4cd0252dd (diff) | |
download | meta-virtualization-b6d051a19770e65bd23bccbd2fc6e948092a6f16.tar.gz |
openvswitch: fix build host contamination
There is only a single PYTHON variable for configure and yet python is
used for the build as well as scripts installed on the target. If we
set a path in PYTHON as we had we end up using this same path during
the build and since it isn't to the sysroot we end up with host
contamination (as demonstrated by python failing to import 'six' on
build hosts without python-six installed.
The best approach is to set PYTHON to "python" when calling configure,
ie. without a path. This will use 'python' from the path during build
time and by ensuring all the installed scripts use '/usr/bin/env' we
can ensure python will be found on the target when the scripts are
run.
Since 'six' is used as part of the build we have to ensure it is
-native'ly buildable and we set all the required build and runtime
dependencies.
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch')
-rw-r--r-- | recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch b/recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch new file mode 100644 index 00000000..6091930e --- /dev/null +++ b/recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From 33769657e951da855b9258eb91fa9838373023ad Mon Sep 17 00:00:00 2001 | ||
2 | From: Mark Asselstine <mark.asselstine@windriver.com> | ||
3 | Date: Fri, 13 Jan 2017 16:12:55 -0500 | ||
4 | Subject: [PATCH] python: make remaining scripts use /usr/bin/env | ||
5 | |||
6 | Unfortunately there is no concept of a host python vs. target python | ||
7 | to facilitate cross compilation. There is only one PYTHON variable and | ||
8 | this is used during building and in the header of python scripts after | ||
9 | installation. The best approach for cross compilation is to thus to | ||
10 | ensure python is in the path and avoid passing a path as part of | ||
11 | PYTHON. To make this function smoothly all installed scripts should | ||
12 | make use of /usr/bin/env to increase the chances of finding python. | ||
13 | |||
14 | Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> | ||
15 | --- | ||
16 | ovsdb/ovsdb-dot.in | 2 +- | ||
17 | ovsdb/ovsdb-idlc.in | 2 +- | ||
18 | utilities/bugtool/ovs-bugtool.in | 2 +- | ||
19 | 3 files changed, 3 insertions(+), 3 deletions(-) | ||
20 | |||
21 | diff --git a/ovsdb/ovsdb-dot.in b/ovsdb/ovsdb-dot.in | ||
22 | index 134ce22..893c408 100755 | ||
23 | --- a/ovsdb/ovsdb-dot.in | ||
24 | +++ b/ovsdb/ovsdb-dot.in | ||
25 | @@ -1,4 +1,4 @@ | ||
26 | -#! @PYTHON@ | ||
27 | +#! /usr/bin/env @PYTHON@ | ||
28 | |||
29 | from datetime import date | ||
30 | import ovs.db.error | ||
31 | diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in | ||
32 | index cd4532e..dceb02f 100755 | ||
33 | --- a/ovsdb/ovsdb-idlc.in | ||
34 | +++ b/ovsdb/ovsdb-idlc.in | ||
35 | @@ -1,4 +1,4 @@ | ||
36 | -#! @PYTHON@ | ||
37 | +#! /usr/bin/env @PYTHON@ | ||
38 | |||
39 | import getopt | ||
40 | import os | ||
41 | diff --git a/utilities/bugtool/ovs-bugtool.in b/utilities/bugtool/ovs-bugtool.in | ||
42 | index bb771b0..152d171 100755 | ||
43 | --- a/utilities/bugtool/ovs-bugtool.in | ||
44 | +++ b/utilities/bugtool/ovs-bugtool.in | ||
45 | @@ -1,4 +1,4 @@ | ||
46 | -#! @PYTHON@ | ||
47 | +#! /usr/bin/env @PYTHON@ | ||
48 | |||
49 | # This library is free software; you can redistribute it and/or | ||
50 | # modify it under the terms of version 2.1 of the GNU Lesser General Public | ||
51 | -- | ||
52 | 2.7.4 | ||
53 | |||