* [Buildroot] [PATCH 0/2] Fix check for Python modules for cross-compilation
@ 2014-01-14 21:23 Yann E. MORIN
2014-01-14 21:23 ` [Buildroot] [PATCH 1/2] configure: move python sub-check to configure.ac Yann E. MORIN
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Yann E. MORIN @ 2014-01-14 21:23 UTC (permalink / raw)
To: buildroot
Hello Simon and Peter!
Here are two patches to enhance (fix) the check of Python modules while
cross-compiling.
There is extensive explanations in the commit log of each patch, but it
basically boils down to the fact that we can't check for Python modules
while doing cross-compilation:
- we can't execute the target Python (obviously)
- the host Python may not have the required module(s)
We've stumbled into this issue while building ola with Buildroot:
http://buildroot.org/
If you prefer a pull-request, I can set up a public repo for you to pull
from.
I'm sending those to you two, since I could not find a contact info for
where to send the patches. If I missed it, please be kind enough to
point me to the correct recipient(s) or mailing list.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
^ permalink raw reply [flat|nested] 4+ messages in thread* [Buildroot] [PATCH 1/2] configure: move python sub-check to configure.ac 2014-01-14 21:23 [Buildroot] [PATCH 0/2] Fix check for Python modules for cross-compilation Yann E. MORIN @ 2014-01-14 21:23 ` Yann E. MORIN 2014-01-14 21:23 ` [Buildroot] [PATCH 2/2] configure: add option for user to override checks for Python modules Yann E. MORIN [not found] ` <CAPQm1=O0zZbJR4NWXjop5RH4-KMRTJWM60BiXnw6OHnv5m6T+Q@mail.gmail.com> 2 siblings, 0 replies; 4+ messages in thread From: Yann E. MORIN @ 2014-01-14 21:23 UTC (permalink / raw) To: buildroot From: "Yann E. MORIN" <yann.morin.1998@free.fr> We do not want to re-test the python name for each Python module we want to check for. Even if we only check for one Python module right now, this is good practice overall. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> --- config/ax_python_module.m4 | 5 ----- configure.ac | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/config/ax_python_module.m4 b/config/ax_python_module.m4 index bd70a06..96dd1ab 100644 --- a/config/ax_python_module.m4 +++ b/config/ax_python_module.m4 @@ -25,11 +25,6 @@ AU_ALIAS([AC_PYTHON_MODULE], [AX_PYTHON_MODULE]) AC_DEFUN([AX_PYTHON_MODULE],[ - if test -z $PYTHON; - then - PYTHON="python" - fi - PYTHON_NAME=`basename $PYTHON` AC_MSG_CHECKING($PYTHON_NAME module: $1) $PYTHON -c "import $1" 2>/dev/null if test $? -eq 0; diff --git a/configure.ac b/configure.ac index 1efedf1..5f6f604 100644 --- a/configure.ac +++ b/configure.ac @@ -570,6 +570,10 @@ AM_CONDITIONAL(INSTALL_RDM_TESTS, test "${enable_rdm_tests}" = "yes") if test "${enable_python_libs}" = "yes"; then AM_PATH_PYTHON(2.6) + if test -z $PYTHON; then + PYTHON="python" + fi + PYTHON_NAME=`basename $PYTHON` AX_PYTHON_MODULE("google.protobuf", "fatal") fi -- 1.8.1.2 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH 2/2] configure: add option for user to override checks for Python modules 2014-01-14 21:23 [Buildroot] [PATCH 0/2] Fix check for Python modules for cross-compilation Yann E. MORIN 2014-01-14 21:23 ` [Buildroot] [PATCH 1/2] configure: move python sub-check to configure.ac Yann E. MORIN @ 2014-01-14 21:23 ` Yann E. MORIN [not found] ` <CAPQm1=O0zZbJR4NWXjop5RH4-KMRTJWM60BiXnw6OHnv5m6T+Q@mail.gmail.com> 2 siblings, 0 replies; 4+ messages in thread From: Yann E. MORIN @ 2014-01-14 21:23 UTC (permalink / raw) To: buildroot From: "Yann E. MORIN" <yann.morin.1998@free.fr> The check for google.protobuf is inherently flawed for cross-compilation, as it uses the host Python to check for target modules. In this case, it is not possible to check for a Pyhon modules altogether, and we need to rely on the user to properly tell us whether we do or do not have google.protobuf. This is done by adding am autoconf cache variable: ac_cv_have_pymod_google_protobuf which can be set to: - yes : force the test to be true - no : force the test to be false - (empty) : let the test decide This is then used in AX_PYTHON_MODULE to override the test. Currently, only the google.protobuf Python module is checked for, but the same could be done later on of other Python modules that may be added in the future, of course. Fixes configure-errors like: http://autobuild.buildroot.net/results/e63/e634d5f0cee3967caffaa6e7ada8c0968e3eff63/build-end.log Also fixes some under-quotation in the python module check. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> --- config/ax_python_module.m4 | 11 ++++------- configure.ac | 4 +++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/config/ax_python_module.m4 b/config/ax_python_module.m4 index 96dd1ab..2910e88 100644 --- a/config/ax_python_module.m4 +++ b/config/ax_python_module.m4 @@ -25,20 +25,17 @@ AU_ALIAS([AC_PYTHON_MODULE], [AX_PYTHON_MODULE]) AC_DEFUN([AX_PYTHON_MODULE],[ - AC_MSG_CHECKING($PYTHON_NAME module: $1) $PYTHON -c "import $1" 2>/dev/null if test $? -eq 0; then - AC_MSG_RESULT(yes) - eval AS_TR_CPP(HAVE_PYMOD_$1)=yes + eval AS_TR_CPP([HAVE_PYMOD_$1])=yes else - AC_MSG_RESULT(no) - eval AS_TR_CPP(HAVE_PYMOD_$1)=no + eval AS_TR_CPP([HAVE_PYMOD_$1])=no # if test -n "$2" then - AC_MSG_ERROR(failed to find required module $1) - exit 1 + AC_MSG_ERROR([failed to find required module $1]) fi fi + AC_MSG_RESULT([AS_TR_CPP([HAVE_PYMOD_$1])]) ]) diff --git a/configure.ac b/configure.ac index 5f6f604..5994d06 100644 --- a/configure.ac +++ b/configure.ac @@ -574,7 +574,9 @@ if test "${enable_python_libs}" = "yes"; then PYTHON="python" fi PYTHON_NAME=`basename $PYTHON` - AX_PYTHON_MODULE("google.protobuf", "fatal") + AC_CACHE_CHECK([$PYTHON_NAME module: google.protobuf], + [ac_cv_have_pymod_google_protobuf], + [AX_PYTHON_MODULE([google.protobuf], [fatal])]) fi # Maybe build the logic sniffer tools -- 1.8.1.2 ^ permalink raw reply related [flat|nested] 4+ messages in thread
[parent not found: <CAPQm1=O0zZbJR4NWXjop5RH4-KMRTJWM60BiXnw6OHnv5m6T+Q@mail.gmail.com>]
[parent not found: <02e001cf13e9$7fd5cee0$0700000a@D400>]
* [Buildroot] [PATCH 0/2] Fix check for Python modules for cross-compilation [not found] ` <02e001cf13e9$7fd5cee0$0700000a@D400> @ 2014-01-18 13:18 ` Yann E. MORIN 0 siblings, 0 replies; 4+ messages in thread From: Yann E. MORIN @ 2014-01-18 13:18 UTC (permalink / raw) To: buildroot Peter, Simon, On 2014-01-18 01:06 -0000, Peter Newman spake thusly: > Taking on board what you said, I've put together a small page on our site > about how to contribute: > http://www.openlighting.org/ola/developer-documentation/contributing/ > > As someone a bit external to the project, and a recent contributor, would > you mind just taking a quick look at it to confirm it gives the sort of > information you were looking for before? OK, I was a bit puzzled when browsing the openlightning.org website. Navigating from the homepage down to the contributing section is not straightforward. What is strange here is that he homepage has those shortcuts on the banner[*] : Overview - People - Supporters - History Plus a big button to download OLA. But no info on how to contriute to OLA. I had expected to find something like "contacts" or "Developpers" right on the frontpage. OK, so I hover over "Download OLA": it's not an archive, but point to a page labelled "getting-started". *That* sounds like a good starting point, indeed. *Click* From there on, here's the path I followed: -> Download & Install OLA -> Install From Git - section of "Install on Linux" - no infro on how to contribute Ok, what was this link Peter sent me, BTW? Ah, there is "developer-documentation" in the link. But I can't see a page labelled "developpers" or some such. Hmm.. Wait! The banner does not contain the same items as the homepage does! And there *is* a "Developpers" item, now! Yes, it;s a menu! Yes it has a "Contributing" section. Aha! Good! :-) So it all boils down to the fact that the homepage and the rest of the website does not contain the same items in the banner. I think it would be much more helpful to have the same banner acros the whoel website. After all, this banner should be a way to quickly go to interesting sections. But, hey, the info is there and it took me only a few minutes to find it. So that's not so bad in the end. All the required info I needed is there on that page, so that's good. Thank you for providing this; hopefully, that will make it easier for people to send their contributions. :-) Regards, Yann E. MORIN. [*] Sorry, I'm French and don't know what this part is called in english. I roughly tranlstated from the french "bandeau". -- .-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-01-18 13:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-14 21:23 [Buildroot] [PATCH 0/2] Fix check for Python modules for cross-compilation Yann E. MORIN
2014-01-14 21:23 ` [Buildroot] [PATCH 1/2] configure: move python sub-check to configure.ac Yann E. MORIN
2014-01-14 21:23 ` [Buildroot] [PATCH 2/2] configure: add option for user to override checks for Python modules Yann E. MORIN
[not found] ` <CAPQm1=O0zZbJR4NWXjop5RH4-KMRTJWM60BiXnw6OHnv5m6T+Q@mail.gmail.com>
[not found] ` <02e001cf13e9$7fd5cee0$0700000a@D400>
2014-01-18 13:18 ` [Buildroot] [PATCH 0/2] Fix check for Python modules for cross-compilation Yann E. MORIN
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox