Skip to contentSkip to conversation

libmusicbrainz: workaround for build-native/do_configure

PATCH Superseded Tim Orling 2 participants 3 messages Feb 27, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Tim Orling

author
#0 lore raw

PATCH 1/1 libmusicbrainz: workaround for build-native/do_configure

From: Tim Orling <[email protected]>

* drop PR
* default cmake_do_configure deletes build/ which wipes out build-native
* workaround to stash build-native first
* <ugly>hack</ugly>

---
 .../musicbrainz/libmusicbrainz_git.bb              | 49 +++++++++++++++++++++-
 1 file changed, 47 insertions(+), 2 deletions(-)
meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb +47 -2
index f6a8f53..b4d1ad3 100644
@@ -6,7 +6,6 @@ LIC_FILES_CHKSUM = "file://COPYING.txt;md5=fbc093901857fcd118f065f900982c24"
 DEPENDS = "expat neon"
 
 PV = "5.0.1+git${SRCPV}"
-PR = "r1"
 
 SRCREV = "0749dd0a35b4a54316da064475863a4ac6e28e7e"
 SRC_URI = "git://github.com/metabrainz/libmusicbrainz.git \
@@ -30,9 +29,55 @@ do_configure_prepend() {
           -DCMAKE_C_COMPILER=${BUILD_CC} \
           -DCMAKE_CXX_FLAGS=${BUILD_CXXFLAGS} \
           -DCMAKE_CXX_COMPILER=${BUILD_CXX} \
-          ..
+          ${S} 
     make make-c-interface
     cd ..
+
+    # the first thing cmake_do_configure does is delete ${B}
+    # stash it first
+    cp -r build-native ..
+}
+
+# recreate default here, with work around for build-native
+cmake_do_configure() {
+	if [ "${OECMAKE_BUILDPATH}" -o "${OECMAKE_SOURCEPATH}" ]; then
+		bbnote "cmake.bbclass no longer uses OECMAKE_SOURCEPATH and OECMAKE_BUILDPATH.  The default behaviour is now out-of-tree builds with B=WORKDIR/build."
+	fi
+
+	if [ "${S}" != "${B}" ]; then
+		rm -rf ${B}
+		mkdir -p ${B}
+		cd ${B}
+	fi
+
+	# bring build-native back into build/
+	mv ../build-native .
+
+	# Just like autotools cmake can use a site file to cache result that need generated binaries to run
+	if [ -e ${WORKDIR}/site-file.cmake ] ; then
+		OECMAKE_SITEFILE=" -C ${WORKDIR}/site-file.cmake"
+	else
+		OECMAKE_SITEFILE=""
+	fi
+
+	cmake \
+	  ${OECMAKE_SITEFILE} \
+	  ${S} \
+	  -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
+	  -DCMAKE_INSTALL_BINDIR:PATH=${bindir} \
+	  -DCMAKE_INSTALL_SBINDIR:PATH=${sbindir} \
+	  -DCMAKE_INSTALL_LIBEXECDIR:PATH=${libexecdir} \
+	  -DCMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \
+	  -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${sharedstatedir} \
+	  -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=${localstatedir} \
+	  -DCMAKE_INSTALL_LIBDIR:PATH=${libdir} \
+	  -DCMAKE_INSTALL_INCLUDEDIR:PATH=${includedir} \
+	  -DCMAKE_INSTALL_DATAROOTDIR:PATH=${datadir} \
+	  -DCMAKE_INSTALL_SO_NO_EXE=0 \
+	  -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
+	  -DCMAKE_VERBOSE_MAKEFILE=1 \
+	  ${EXTRA_OECMAKE} \
+	  -Wno-dev
 }
 
 EXTRA_OECMAKE = "-DLIB_INSTALL_DIR:PATH=${libdir} \
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 6 lines · Tim Orling

From: Tim Orling <[email protected]>

* drop PR
* default cmake_do_configure deletes build/ which wipes out build-native
* workaround to stash build-native first
* <ugly>hack</ugly>

I've just noticed libmusicbraniz failing like this:

NOTE: recipe libmusicbrainz-5.0.1+gitAUTOINC+0749dd0a35-r1: task do_configure: Started
ERROR: Function failed: do_configure (log file is located at /home/jenkins/oe/shr-core-branches/shr-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/libmusicbrainz/5.0.1+gitAUTOINC+0749dd0a35-r1/temp/log.do_configure.2213)
ERROR: Logfile of failure stored in: /home/jenkins/oe/shr-core-branches/shr-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/libmusicbrainz/5.0.1+gitAUTOINC+0749dd0a35-r1/temp/log.do_configure.2213 Log data follows:

| DEBUG: Executing python function sysroot_cleansstate
| DEBUG: Python function sysroot_cleansstate finished
| DEBUG: SITE files ['endian-little', 'bit-32', 'arm-common', 'common-linux', 'common-glibc', 'arm-linux', 'arm-linux-gnueabi', 'common']
| DEBUG: Executing shell function autotools_preconfigure
| DEBUG: Shell function autotools_preconfigure finished
| DEBUG: Executing shell function do_configure
| fatal: Not a git repository (or any parent up to mount parent /home/jenkins/oe/shr-core-branches/shr-core)
| Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
| WARNING: exit code 128 from a shell command.
| ERROR: Function failed: do_configure (log file is located at /home/jenkins/oe/shr-core-branches/shr-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/libmusicbrainz/5.0.1+gitAUTOINC+0749dd0a35-r1/temp/log.do_configure.2213)

NOTE: recipe libmusicbrainz-5.0.1+gitAUTOINC+0749dd0a35-r1: task do_configure: Failed

Is it fix for this problem? or have you seen this?

Quoted 11 lines
---
 .../musicbrainz/libmusicbrainz_git.bb              | 49 +++++++++++++++++++++-
 1 file changed, 47 insertions(+), 2 deletions(-)
meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb +0 -0
index f6a8f53..b4d1ad3 100644

meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb LIC_FILES_CHKSUM = "file://COPYING.txt;md5=fbc093901857fcd118f065f900982c24" · line 9

Quoted 4 lines
meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb +0 -1
@@ -6,7 +6,6 @@ LIC_FILES_CHKSUM = "file://COPYING.txt;md5=fbc093901857fcd118f065f900982c24"
 DEPENDS = "expat neon"
 
 PV = "5.0.1+git${SRCPV}"
-PR = "r1"

This would make the whole package version going backwards, so please remove it only when incrementing PV/PE/SRCREV.

Quoted 66 lines
meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb +47 -1
 SRCREV = "0749dd0a35b4a54316da064475863a4ac6e28e7e"
 SRC_URI = "git://github.com/metabrainz/libmusicbrainz.git \
@@ -30,9 +29,55 @@ do_configure_prepend() {
           -DCMAKE_C_COMPILER=${BUILD_CC} \
           -DCMAKE_CXX_FLAGS=${BUILD_CXXFLAGS} \
           -DCMAKE_CXX_COMPILER=${BUILD_CXX} \
-          ..
+          ${S} 
     make make-c-interface
     cd ..
+
+    # the first thing cmake_do_configure does is delete ${B}
+    # stash it first
+    cp -r build-native ..
+}
+
+# recreate default here, with work around for build-native
+cmake_do_configure() {
+	if [ "${OECMAKE_BUILDPATH}" -o "${OECMAKE_SOURCEPATH}" ]; then
+		bbnote "cmake.bbclass no longer uses OECMAKE_SOURCEPATH and OECMAKE_BUILDPATH.  The default behaviour is now out-of-tree builds with B=WORKDIR/build."
+	fi
+
+	if [ "${S}" != "${B}" ]; then
+		rm -rf ${B}
+		mkdir -p ${B}
+		cd ${B}
+	fi
+
+	# bring build-native back into build/
+	mv ../build-native .
+
+	# Just like autotools cmake can use a site file to cache result that need generated binaries to run
+	if [ -e ${WORKDIR}/site-file.cmake ] ; then
+		OECMAKE_SITEFILE=" -C ${WORKDIR}/site-file.cmake"
+	else
+		OECMAKE_SITEFILE=""
+	fi
+
+	cmake \
+	  ${OECMAKE_SITEFILE} \
+	  ${S} \
+	  -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
+	  -DCMAKE_INSTALL_BINDIR:PATH=${bindir} \
+	  -DCMAKE_INSTALL_SBINDIR:PATH=${sbindir} \
+	  -DCMAKE_INSTALL_LIBEXECDIR:PATH=${libexecdir} \
+	  -DCMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \
+	  -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${sharedstatedir} \
+	  -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=${localstatedir} \
+	  -DCMAKE_INSTALL_LIBDIR:PATH=${libdir} \
+	  -DCMAKE_INSTALL_INCLUDEDIR:PATH=${includedir} \
+	  -DCMAKE_INSTALL_DATAROOTDIR:PATH=${datadir} \
+	  -DCMAKE_INSTALL_SO_NO_EXE=0 \
+	  -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
+	  -DCMAKE_VERBOSE_MAKEFILE=1 \
+	  ${EXTRA_OECMAKE} \
+	  -Wno-dev
 }
 
 EXTRA_OECMAKE = "-DLIB_INSTALL_DIR:PATH=${libdir} \
Signature · 6 lines
1.8.3.2

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#2 lore raw
Quoted 24 lines · Martin Jansa
Quoted 6 lines · Tim Orling

From: Tim Orling <[email protected]>

* drop PR
* default cmake_do_configure deletes build/ which wipes out build-native
* workaround to stash build-native first
* <ugly>hack</ugly>

I've just noticed libmusicbraniz failing like this:

NOTE: recipe libmusicbrainz-5.0.1+gitAUTOINC+0749dd0a35-r1: task do_configure: Started
ERROR: Function failed: do_configure (log file is located at /home/jenkins/oe/shr-core-branches/shr-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/libmusicbrainz/5.0.1+gitAUTOINC+0749dd0a35-r1/temp/log.do_configure.2213)
ERROR: Logfile of failure stored in: /home/jenkins/oe/shr-core-branches/shr-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/libmusicbrainz/5.0.1+gitAUTOINC+0749dd0a35-r1/temp/log.do_configure.2213 Log data follows:

| DEBUG: Executing python function sysroot_cleansstate
| DEBUG: Python function sysroot_cleansstate finished
| DEBUG: SITE files ['endian-little', 'bit-32', 'arm-common', 'common-linux', 'common-glibc', 'arm-linux', 'arm-linux-gnueabi', 'common']
| DEBUG: Executing shell function autotools_preconfigure
| DEBUG: Shell function autotools_preconfigure finished
| DEBUG: Executing shell function do_configure
| fatal: Not a git repository (or any parent up to mount parent /home/jenkins/oe/shr-core-branches/shr-core)
| Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
| WARNING: exit code 128 from a shell command.
| ERROR: Function failed: do_configure (log file is located at /home/jenkins/oe/shr-core-branches/shr-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/libmusicbrainz/5.0.1+gitAUTOINC+0749dd0a35-r1/temp/log.do_configure.2213)
Quoted 4 lines

NOTE: recipe libmusicbrainz-5.0.1+gitAUTOINC+0749dd0a35-r1: task do_configure: Failed

Is it fix for this problem? or have you seen this?

No, I have not seen that error. Hunch: that might be caused by the "git clean ..." in do_configure_prepend... It might also be something with jenkins. I'm still running manually (even though I maintain the jenkins server at work... go figure).

The first error I saw was not being able to find CMakeLists.txt so I changed the target for cmake from .. to ${S} After that, the second error was being unable to find build-native/ImportExecutables.cmake, which I fixed by the do_configure hack.

Quoted 14 lines
Quoted 14 lines

---
.../musicbrainz/libmusicbrainz_git.bb | 49 +++++++++++++++++++++-

1 file changed, 47 insertions(+), 2 deletions(-)
meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb +0 -0
index f6a8f53..b4d1ad3 100644
@@ -6,7 +6,6 @@ LIC_FILES_CHKSUM = "file://COPYING.txt;md5=fbc093901857fcd118f065f900982c24"

DEPENDS = "expat neon"

Quoted 6 lines
Quoted 2 lines

PV = "5.0.1+git${SRCPV}"
-PR = "r1"

This would make the whole package version going backwards, so please remove it only when incrementing PV/PE/SRCREV.

Still learning :)
I'll bump it in v2.

Quoted 58 lines
Quoted 58 lines

SRCREV = "0749dd0a35b4a54316da064475863a4ac6e28e7e" SRC_URI = "git://github.com/metabrainz/libmusicbrainz.git \

meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb +47 -1
@@ -30,9 +29,55 @@ do_configure_prepend() {
          -DCMAKE_C_COMPILER=${BUILD_CC} \
          -DCMAKE_CXX_FLAGS=${BUILD_CXXFLAGS} \
          -DCMAKE_CXX_COMPILER=${BUILD_CXX} \
-          ..
+          ${S} 
    make make-c-interface
    cd ..
+
+    # the first thing cmake_do_configure does is delete ${B}
+    # stash it first
+    cp -r build-native ..
+}
+
+# recreate default here, with work around for build-native
+cmake_do_configure() {
+	if [ "${OECMAKE_BUILDPATH}" -o "${OECMAKE_SOURCEPATH}" ]; then
+		bbnote "cmake.bbclass no longer uses OECMAKE_SOURCEPATH and OECMAKE_BUILDPATH.  The default behaviour is now out-of-tree builds with B=WORKDIR/build."
+	fi
+
+	if [ "${S}" != "${B}" ]; then
+		rm -rf ${B}
+		mkdir -p ${B}
+		cd ${B}
+	fi
+
+	# bring build-native back into build/
+	mv ../build-native .
+
+	# Just like autotools cmake can use a site file to cache result that need generated binaries to run
+	if [ -e ${WORKDIR}/site-file.cmake ] ; then
+		OECMAKE_SITEFILE=" -C ${WORKDIR}/site-file.cmake"
+	else
+		OECMAKE_SITEFILE=""
+	fi
+
+	cmake \
+	  ${OECMAKE_SITEFILE} \
+	  ${S} \
+	  -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
+	  -DCMAKE_INSTALL_BINDIR:PATH=${bindir} \
+	  -DCMAKE_INSTALL_SBINDIR:PATH=${sbindir} \
+	  -DCMAKE_INSTALL_LIBEXECDIR:PATH=${libexecdir} \
+	  -DCMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \
+	  -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${sharedstatedir} \
+	  -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=${localstatedir} \
+	  -DCMAKE_INSTALL_LIBDIR:PATH=${libdir} \
+	  -DCMAKE_INSTALL_INCLUDEDIR:PATH=${includedir} \
+	  -DCMAKE_INSTALL_DATAROOTDIR:PATH=${datadir} \
+	  -DCMAKE_INSTALL_SO_NO_EXE=0 \
+	  -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
+	  -DCMAKE_VERBOSE_MAKEFILE=1 \
+	  ${EXTRA_OECMAKE} \
+	  -Wno-dev
 }
 
Quoted 15 lines
Quoted 8 lines
meta-multimedia/recipes-multimedia/musicbrainz/libmusicbrainz_git.bb +0 -0
 EXTRA_OECMAKE = "-DLIB_INSTALL_DIR:PATH=${libdir} \
Signature · 6 lines
1.8.3.2

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 5 lines
Martin 'JaMa' Jansa     jabber: [email protected]
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel

--Tim