Skip to contentSkip to conversation

postgresql.inc: Fix do_configure error (could not find Python.h)

PATCH In review Mario Domenech Goulart 3 participants 4 messages Oct 16, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 postgresql.inc: Fix do_configure error (could not find Python.h)

Fixes:

| checking for Python.h... no
| configure: error: header file <Python.h> is required for Python
| NOTE: The following config.log files may provide further information.
| WARNING: exit code 1 from a shell command.
| NOTE: .../tmp/work/armv5e-poky-linux-gnueabi/postgresql/9.4.8-r0.0/build/config.log
| ERROR: configure failed
---
 meta-oe/recipes-support/postgresql/postgresql.inc | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
meta-oe/recipes-support/postgresql/postgresql.inc +2 -6
index 9592c79..454624c 100644
@@ -40,6 +40,8 @@ export LDFLAGS_SL = "${LDFLAGS}"
 
 inherit autotools pkgconfig perlnative pythonnative useradd update-rc.d systemd
 
+CFLAGS += "-I${STAGING_INCDIR}/${PYTHON_DIR}"
+
 SYSTEMD_SERVICE_${PN} = "postgresql.service"
 SYSTEMD_AUTO_ENABLE_${PN} = "disable"
 
@@ -109,12 +111,6 @@ python populate_packages_prepend() {
 }
 
 do_configure() {
-    # do_configure_prepend
-    # make sure configure finds python includdirs with these envs
-    export \
-           STAGING_INCDIR=${STAGING_INCDIR} \
-           STAGING_LIBDIR=${STAGING_LIBDIR}
-
     # do_configure
     autotools_do_configure
 
Signature · 1 line
2.1.4
#1 lore raw
Quoted 31 lines · Mario Domenech Goulart

Fixes:

| checking for Python.h... no
| configure: error: header file <Python.h> is required for Python
| NOTE: The following config.log files may provide further information.
| WARNING: exit code 1 from a shell command.
| NOTE: .../tmp/work/armv5e-poky-linux-gnueabi/postgresql/9.4.8-r0.0/build/config.log
| ERROR: configure failed
---
 meta-oe/recipes-support/postgresql/postgresql.inc | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
meta-oe/recipes-support/postgresql/postgresql.inc +2 -0
index 9592c79..454624c 100644
@@ -40,6 +40,8 @@ export LDFLAGS_SL = "${LDFLAGS}"
 
 inherit autotools pkgconfig perlnative pythonnative useradd update-rc.d systemd
 
+CFLAGS += "-I${STAGING_INCDIR}/${PYTHON_DIR}"
+
 SYSTEMD_SERVICE_${PN} = "postgresql.service"
 SYSTEMD_AUTO_ENABLE_${PN} = "disable"
 
@@ -109,12 +111,6 @@ python populate_packages_prepend() {
 }
 

meta-oe/recipes-support/postgresql/postgresql.inc python populate_packages_prepend() { · line 116

Quoted 10 lines
meta-oe/recipes-support/postgresql/postgresql.inc +0 -6
 do_configure() {
-    # do_configure_prepend
-    # make sure configure finds python includdirs with these envs
-    export \
-           STAGING_INCDIR=${STAGING_INCDIR} \
-           STAGING_LIBDIR=${STAGING_LIBDIR}
-
     # do_configure
     autotools_do_configure
 

Why is this needed? I just built the existing recipe in a bare build without any problems. Perhaps I'm missing something?

Also, would it not be better to just add python to DEPENDS?

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#2 lore raw

Hi Gary,

Quoted 31 lines · On Sun, 16 Oct 2016 15:43:02 +0200 Gary Thomas <[email protected]> wrote:
Quoted 30 lines · Mario Domenech Goulart

Fixes:

| checking for Python.h... no
| configure: error: header file <Python.h> is required for Python
| NOTE: The following config.log files may provide further information.
| WARNING: exit code 1 from a shell command.
| NOTE: .../tmp/work/armv5e-poky-linux-gnueabi/postgresql/9.4.8-r0.0/build/config.log
| ERROR: configure failed
---
 meta-oe/recipes-support/postgresql/postgresql.inc | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
meta-oe/recipes-support/postgresql/postgresql.inc +2 -0
index 9592c79..454624c 100644
@@ -40,6 +40,8 @@ export LDFLAGS_SL = "${LDFLAGS}"
 
 inherit autotools pkgconfig perlnative pythonnative useradd update-rc.d systemd
 
+CFLAGS += "-I${STAGING_INCDIR}/${PYTHON_DIR}"
+
 SYSTEMD_SERVICE_${PN} = "postgresql.service"
 SYSTEMD_AUTO_ENABLE_${PN} = "disable"
 
@@ -109,12 +111,6 @@ python populate_packages_prepend() {
 }
 
Quoted 14 lines

meta-oe/recipes-support/postgresql/postgresql.inc python populate_packages_prepend() { · line 116

Quoted 11 lines
meta-oe/recipes-support/postgresql/postgresql.inc +0 -6
 do_configure() {
-    # do_configure_prepend
-    # make sure configure finds python includdirs with these envs
-    export \
-           STAGING_INCDIR=${STAGING_INCDIR} \
-           STAGING_LIBDIR=${STAGING_LIBDIR}
-
     # do_configure
     autotools_do_configure
 

Why is this needed? I just built the existing recipe in a bare build without any problems. Perhaps I'm missing something?

Maybe I'm running into a race condition. Now I tried again and could not reproduce the Python issue (tried both master and krogoth). However, in both master and krogoth I get the following error after cleaning sstate for postgresql, removing $TMPDIR and building postgresql again:

| checking for tclsh... no
| checking for tcl... no
| checking for tclsh8.6... no
| checking for tclsh86... no
| checking for tclsh8.5... no
| checking for tclsh85... no
| checking for tclsh8.4... no
| checking for tclsh84... no
| checking for tclsh8.3... no
| checking for tclsh83... no
| configure: error: Tcl shell not found
| WARNING: exit code 1 from a shell command.

When I could reproduce the issue, I checked the sysroot directory and Python.h was in ${STAGING_INCDIR}/${PYTHON_DIR}, not in ${STAGING_INCDIR}. ${STAGING_INCDIR}/${PYTHON_DIR} was not in the compiler's include path and the code included Python.h with "#include <Python.h>".

Naturally, it is possible that _I_ am missing something.

Quoted 1 line

Also, would it not be better to just add python to DEPENDS?

Python gets added to DEPENDS via PACKAGECONFIG.

All the best.
Mario

Signature · 1 line
http://parenteses.org/mario
#3 lore raw
Quoted 56 lines · Mario Domenech Goulart

Hi Gary,

Quoted 31 lines · On Sun, 16 Oct 2016 15:43:02 +0200 Gary Thomas <[email protected]> wrote:
Quoted 30 lines · Mario Domenech Goulart

Fixes:

| checking for Python.h... no
| configure: error: header file <Python.h> is required for Python
| NOTE: The following config.log files may provide further information.
| WARNING: exit code 1 from a shell command.
| NOTE: .../tmp/work/armv5e-poky-linux-gnueabi/postgresql/9.4.8-r0.0/build/config.log
| ERROR: configure failed
---
 meta-oe/recipes-support/postgresql/postgresql.inc | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
meta-oe/recipes-support/postgresql/postgresql.inc +2 -0
index 9592c79..454624c 100644
@@ -40,6 +40,8 @@ export LDFLAGS_SL = "${LDFLAGS}"
 
 inherit autotools pkgconfig perlnative pythonnative useradd update-rc.d systemd
 
+CFLAGS += "-I${STAGING_INCDIR}/${PYTHON_DIR}"
+
 SYSTEMD_SERVICE_${PN} = "postgresql.service"
 SYSTEMD_AUTO_ENABLE_${PN} = "disable"
 
@@ -109,12 +111,6 @@ python populate_packages_prepend() {
 }
 
Quoted 14 lines

meta-oe/recipes-support/postgresql/postgresql.inc python populate_packages_prepend() { · line 116

Quoted 11 lines
meta-oe/recipes-support/postgresql/postgresql.inc +0 -6
 do_configure() {
-    # do_configure_prepend
-    # make sure configure finds python includdirs with these envs
-    export \
-           STAGING_INCDIR=${STAGING_INCDIR} \
-           STAGING_LIBDIR=${STAGING_LIBDIR}
-
     # do_configure
     autotools_do_configure
 

Why is this needed? I just built the existing recipe in a bare build without any problems. Perhaps I'm missing something?

Maybe I'm running into a race condition. Now I tried again and could not reproduce the Python issue (tried both master and krogoth). However, in both master and krogoth I get the following error after cleaning sstate for postgresql, removing $TMPDIR and building postgresql again:

Quoted 13 lines
| checking for tclsh... no
| checking for tcl... no
| checking for tclsh8.6... no
| checking for tclsh86... no
| checking for tclsh8.5... no
| checking for tclsh85... no
| checking for tclsh8.4... no
| checking for tclsh84... no
| checking for tclsh8.3... no
| checking for tclsh83... no
| configure: error: Tcl shell not found
| WARNING: exit code 1 from a shell command.

This is a different error probably missing a dependency on tcl, if its missing then add it via a pkgconfig or disable it explicitly with --disable-tcl

Quoted 11 lines

When I could reproduce the issue, I checked the sysroot directory and Python.h was in ${STAGING_INCDIR}/${PYTHON_DIR}, not in ${STAGING_INCDIR}. ${STAGING_INCDIR}/${PYTHON_DIR} was not in the compiler's include path and the code included Python.h with "#include <Python.h>".

Naturally, it is possible that _I_ am missing something.

Quoted 1 line

Also, would it not be better to just add python to DEPENDS?

Python gets added to DEPENDS via PACKAGECONFIG.

That should do the needed bits of adding it to depends. However unless we have some packageconfig or somesuch exposing the subdir for python inside includedir compiler will not find it. It will be interesting to know the commandline from config.log
where its complaining about missing python.h secondly, there could be some mechanism
in postgresql build system to detect it and its not triggering for some reason in failing
case.

Quoted 10 lines

All the best.
Mario
--
http://parenteses.org/mario
--
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel