Discussion:
[yocto] Cap'n Proto Recipe Help
Finn Carlsvi
2015-10-13 19:13:58 UTC
Permalink
Hello,

I'm attempting to create a recipe for the Cap'n Proto serialization protocol
<https://lists.yoctoproject.org/pipermail/yocto/>, but am still a beginner
at Yocto.
The only link I have found regarding the subject (so far) is this google
group
<https://groups.google.com/forum/#!msg/capnproto/ZfHEXEVb7KM/hyOOlAKQAF0J>.

I created a standard recipe, linked to the source
https://capnproto.org/capnproto-c++-${PV}.tar.gz
<https://capnproto.org/capnproto-c++-$%7BPV%7D.tar.gz>

Based on the information from the google group link above, I changed the
do_configure:

do_configure() {
export CAPNP=/usr/local/bin/capnp
${S}/configure --with-external-capnp -build=x86_64-linux
--host=arm-poky-linux-gnueabi --target=arm-poky-linux-gnueabi
}

From what I understand, the reason is that I need an installed version of
Cap'n Proto on my Linux host in order to cross compile for ARM

Because external library files are used, I also added the lines:

INSANE_SKIP_${PN} += "install-host-path"
INSANE_SKIP_${PN} += "installed-vs-shipped"

Running *bitbake capnproto* works, but when I add the line:

IMAGE_INSTALL_append = " capnproto"

and try to run* bitbake core-image-base *I get the following error from the
do_rootfs log:

DEBUG: Executing python function rootfs_process_ignore
DEBUG: Python function rootfs_process_ignore finished
DEBUG: Executing python function rootfs_runtime_mapping
DEBUG: Python function rootfs_runtime_mapping finished
DEBUG: Executing python function do_rootfs
NOTE: configuring RPM platform settings
NOTE: configuring RPM system provides
NOTE: configuring RPM DB settings
NOTE: configuring Smart settings
NOTE: Note: adding Smart channel nitrogen6sx (105)
NOTE: Note: adding Smart channel cortexa9hf_vfp_neon_mx6sx (100)
NOTE: Note: adding Smart channel cortexa9hf_vfp_neon (95)
NOTE: Note: adding Smart channel all (90)
NOTE: adding Smart RPM DB channel
NOTE: Note: configuring RPM cross-install scriptlet_wrapper
NOTE: ###### Generate rootfs #######
NOTE: Executing
'/home/finn/yocto/poky/build/tmp/sysroots/x86_64-linux/usr/bin/createrepo
--dbpath
/home/finn/yocto/poky/build/tmp/work/nitrogen6sx-poky-linux-gnueabi/core-image-base/1.0-r0/rpmdb/cortexa9hf_vfp_neon_mx6sx
--update -q
/home/finn/yocto/poky/build/tmp/deploy/rpm/cortexa9hf_vfp_neon_mx6sx' ...
NOTE: Executing
'/home/finn/yocto/poky/build/tmp/sysroots/x86_64-linux/usr/bin/createrepo
--dbpath
/home/finn/yocto/poky/build/tmp/work/nitrogen6sx-poky-linux-gnueabi/core-image-base/1.0-r0/rpmdb/cortexa9hf_vfp_neon
--update -q /home/finn/yocto/poky/build/tmp/deploy/rpm/cortexa9hf_vfp_neon'
...
NOTE: Executing
'/home/finn/yocto/poky/build/tmp/sysroots/x86_64-linux/usr/bin/createrepo
--dbpath
/home/finn/yocto/poky/build/tmp/work/nitrogen6sx-poky-linux-gnueabi/core-image-base/1.0-r0/rpmdb/nitrogen6sx
--update -q /home/finn/yocto/poky/build/tmp/deploy/rpm/nitrogen6sx' ...
NOTE: Installing the following packages: capnproto psplash
packagegroup-base-extended run-postinsts packagegroup-core-boot
locale-base-en-us locale-base-en-gb
alsa-conf-1.0.28-***@cortexa9hf_vfp_neon_mx6sx
alsa-conf-base-1.0.28-***@cortexa9hf_vfp_neon_mx6sx
alsa-lib-1.0.28-***@cortexa9h .........
DEBUG: Python function do_rootfs finished
ERROR: Function failed: do_rootfs

I noticed that I have the cross compiled version of capnproto (capnp) in
the images folder in my work directory, but the packages-split/capnproto
directory is empy.

Thanks for any help, as soon as get it working I'd like to make it
available to others.

/ Finn
Burton, Ross
2015-10-13 19:26:07 UTC
Permalink
Post by Finn Carlsvi
I noticed that I have the cross compiled version of capnproto (capnp) in
the images folder in my work directory, but the packages-split/capnproto
directory is empy.
Sharing the recipe makes helping a lot easier. Have a look in the
work/deploy-* directories to see what packages were actually created.

But FYI, upstream software which needs to build and run software to build
are generally a pain to package.

Ross
Finn Carlsvi
2015-10-13 19:55:48 UTC
Permalink
Thanks Ross,

I was trying to spare you the wall of text, but your right, it's best to
share the whole recipe. The file name is *capnproto_0.5.3.bb
<http://capnproto_0.5.3.bb>*

############################################################
LICENSE = "Unknown"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=0a5b5b742baf10cc1c158579eba7fb1d
\

file://gtest/LICENSE;md5=cbbd27594afd089daa160d3a16dd515a"

INSANE_SKIP_${PN} += "install-host-path"
INSANE_SKIP_${PN} += "installed-vs-shipped"

SRC_URI = "https://capnproto.org/capnproto-c++-${PV}.tar.gz"
SRC_URI[md5sum] = "d6c91a9129457fe5893302cd92e09324"
SRC_URI[sha256sum] =
"cdb17c792493bdcd4a24bcd196eb09f70ee64c83a3eccb0bc6534ff560536afb"

PACKAGES = "${PN}"

S = "${WORKDIR}/capnproto-c++-${PV}"

inherit cmake

# Specify any options you want to pass to cmake using EXTRA_OECMAKE:
EXTRA_OECMAKE = ""

do_configure() {
export CAPNP=/usr/local/bin/capnp
${S}/configure --with-external-capnp -build=x86_64-linux
--host=arm-poky-linux-gnueabi --target=arm-poky-linux-gnueabi
}
############################################################

Cheers
Finn
Post by Burton, Ross
Post by Finn Carlsvi
I noticed that I have the cross compiled version of capnproto (capnp) in
the images folder in my work directory, but the packages-split/capnproto
directory is empy.
Sharing the recipe makes helping a lot easier. Have a look in the
work/deploy-* directories to see what packages were actually created.
But FYI, upstream software which needs to build and run software to build
are generally a pain to package.
Ross
Burton, Ross
2015-10-13 21:56:44 UTC
Permalink
Post by Finn Carlsvi
INSANE_SKIP_${PN} += "installed-vs-shipped"
You're telling the system not to warn you that you have a do_install() that
installs files that are not getting packaged anywhere.

do_configure() {
Post by Finn Carlsvi
export CAPNP=/usr/local/bin/capnp
${S}/configure --with-external-capnp -build=x86_64-linux
--host=arm-poky-linux-gnueabi --target=arm-poky-linux-gnueabi
}
Here you are overriding all of the magic in cmake.bbclass that makes cmake
actually work. You probably just want to add --with-external-capnp to
EXTRA_OECMAKE and remove your do_configure().

Ross
Finn Carlsvi
2015-10-14 00:57:08 UTC
Permalink
Thanks Ross,

That makes much more sense. I incorporated your edits, however, I used:

EXTRA_OECONF_append = " --with-external-capnp"
instead of EXTRA_OECMAKE, since it was used for the configuration
originally. Am I thinking right about this?

This edit brings me to the following error:

| [ 70%] Built target capnp_tool
| make -f src/capnp/CMakeFiles/capnp-heavy-tests.dir/build.make
src/capnp/CMakeFiles/capnp-heavy-tests.dir/depend
| make[2]: Entering directory
`/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/build'
| /home/finn/yocto/poky/build/tmp/sysroots/x86_64-linux/usr/bin/cmake -E
cmake_progress_report
/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/build/CMakeFiles
14
| [ 71%] Compiling Cap'n Proto schema test-import2.capnp
| cd
/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/build/src/capnp
&& ./capnp compile -o
/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/build/src/capnp/capnpc-c++:/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/build/src/capnp/test_capnp/capnp
--src-prefix
/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/capnproto-c++-0.5.3/src/capnp
-I
/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/capnproto-c++-0.5.3/src/capnp
-I
/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/capnproto-c++-0.5.3/src
/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/capnproto-c++-0.5.3/src/capnp/test-import2.capnp
| ./capnp: 1: ./capnp: Syntax error: word unexpected (expecting ")")
| make[2]: *** [src/capnp/test_capnp/capnp/test-import2.capnp.c++] Error 2
| make[2]: Leaving directory
`/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/build'
| make[1]: *** [src/capnp/CMakeFiles/capnp-heavy-tests.dir/all] Error 2
| make[1]: Leaving directory
`/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/build'
| make: *** [all] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.

From what I gather, Syntax error: word unexpected (expecting ")") means
that the ./capnp is compiled for arm, I need to be running the local
version right?

I tried adding
CAPNP = "/usr/local/bin/capnp"
to the recipe file, but of course that does not make a difference.

This is my updated recipe file:
INSANE_SKIP_${PN} += "install-host-path"

SRC_URI = "https://capnproto.org/capnproto-c++-${PV}.tar.gz"
SRC_URI[md5sum] = "d6c91a9129457fe5893302cd92e09324"
SRC_URI[sha256sum] =
"cdb17c792493bdcd4a24bcd196eb09f70ee64c83a3eccb0bc6534ff560536afb"

PACKAGES = "${PN}"

S = "${WORKDIR}/capnproto-c++-${PV}"

inherit cmake

EXTRA_OECONF_append = " --with-external-capnp"


Thanks again :)
Post by Burton, Ross
Post by Finn Carlsvi
INSANE_SKIP_${PN} += "installed-vs-shipped"
You're telling the system not to warn you that you have a do_install()
that installs files that are not getting packaged anywhere.
do_configure() {
Post by Finn Carlsvi
export CAPNP=/usr/local/bin/capnp
${S}/configure --with-external-capnp -build=x86_64-linux
--host=arm-poky-linux-gnueabi --target=arm-poky-linux-gnueabi
}
Here you are overriding all of the magic in cmake.bbclass that makes cmake
actually work. You probably just want to add --with-external-capnp to
EXTRA_OECMAKE and remove your do_configure().
Ross
Jussi Kukkonen
2015-10-14 08:12:37 UTC
Permalink
Post by Finn Carlsvi
Thanks Ross,
EXTRA_OECONF_append = " --with-external-capnp"
instead of EXTRA_OECMAKE, since it was used for the configuration
originally. Am I thinking right about this?
configure is typically not used when building with cmake** so giving extra
options for it probably won't help. The reason there is a configure file at
all is that the project seems to support both autotools and cmake**. If you
want to continue with cmake, find out how it does the equivalent of
"--with-external-capnp": probably with something like "-DEXTERNALCAPNP" in
EXTRA_OECMAKE. The other alternative is to use autotools instead of cmake
(and add "--with-external-capnp" in EXTRA_OECONF).

I would suggest picking the build system the main developers actually use
or recommend, then figuring out how to build that with the options you need
_outside of yocto_, and then doing the same with a yocto recipe (keeping an
eye on $WORKDIR/temp/log.* so you know what the build/configure is actually
doing).


**) For reasons some people want multiple build systems in their projects.
As if one wasn't painful enough.


- Jussi
Post by Finn Carlsvi
| [ 70%] Built target capnp_tool
| make -f src/capnp/CMakeFiles/capnp-heavy-tests.dir/build.make
src/capnp/CMakeFiles/capnp-heavy-tests.dir/depend
| make[2]: Entering directory
`/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/build'
| /home/finn/yocto/poky/build/tmp/sysroots/x86_64-linux/usr/bin/cmake -E
cmake_progress_report
/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/build/CMakeFiles
14
| [ 71%] Compiling Cap'n Proto schema test-import2.capnp
| cd
/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/build/src/capnp
&& ./capnp compile -o
/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/build/src/capnp/capnpc-c++:/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/build/src/capnp/test_capnp/capnp
--src-prefix
/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/capnproto-c++-0.5.3/src/capnp
-I
/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/capnproto-c++-0.5.3/src/capnp
-I
/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/capnproto-c++-0.5.3/src
/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/capnproto-c++-0.5.3/src/capnp/test-import2.capnp
| ./capnp: 1: ./capnp: Syntax error: word unexpected (expecting ")")
| make[2]: *** [src/capnp/test_capnp/capnp/test-import2.capnp.c++] Error 2
| make[2]: Leaving directory
`/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/build'
| make[1]: *** [src/capnp/CMakeFiles/capnp-heavy-tests.dir/all] Error 2
| make[1]: Leaving directory
`/home/finn/yocto/poky/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/capnproto/0.5.3-r0/build'
| make: *** [all] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
From what I gather, Syntax error: word unexpected (expecting ")") means
that the ./capnp is compiled for arm, I need to be running the local
version right?
I tried adding
CAPNP = "/usr/local/bin/capnp"
to the recipe file, but of course that does not make a difference.
INSANE_SKIP_${PN} += "install-host-path"
SRC_URI = "https://capnproto.org/capnproto-c++-${PV}.tar.gz
<https://capnproto.org/capnproto-c++-$%7BPV%7D.tar.gz>"
SRC_URI[md5sum] = "d6c91a9129457fe5893302cd92e09324"
SRC_URI[sha256sum] =
"cdb17c792493bdcd4a24bcd196eb09f70ee64c83a3eccb0bc6534ff560536afb"
PACKAGES = "${PN}"
S = "${WORKDIR}/capnproto-c++-${PV}"
inherit cmake
EXTRA_OECONF_append = " --with-external-capnp"
Thanks again :)
Post by Burton, Ross
Post by Finn Carlsvi
INSANE_SKIP_${PN} += "installed-vs-shipped"
You're telling the system not to warn you that you have a do_install()
that installs files that are not getting packaged anywhere.
do_configure() {
Post by Finn Carlsvi
export CAPNP=/usr/local/bin/capnp
${S}/configure --with-external-capnp -build=x86_64-linux
--host=arm-poky-linux-gnueabi --target=arm-poky-linux-gnueabi
}
Here you are overriding all of the magic in cmake.bbclass that makes
cmake actually work. You probably just want to add --with-external-capnp
to EXTRA_OECMAKE and remove your do_configure().
Ross
--
_______________________________________________
yocto mailing list
https://lists.yoctoproject.org/listinfo/yocto
Continue reading on narkive:
Search results for '[yocto] Cap'n Proto Recipe Help' (Questions and Answers)
23
replies
I like to write. How often should I write a week?
started 2006-10-20 14:08:51 UTC
books & authors
Loading...