Skip to contentSkip to conversation

capnproto: new package

PATCH Superseded Koen Martens 3 participants 8 messages Jul 6, 2017 – Jul 7, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 capnproto: new package

Cap'n Proto is an insanely fast data interchange format and capability-based RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster. In fact, in benchmarks, Cap?n Proto is INFINITY TIMES faster than Protocol Buffers.

https://capnproto.org/index.html

---
 DEVELOPERS                            |  1 +
 package/Config.in                     |  1 +
 package/capnproto/0001-execinfo.patch | 85 +++++++++++++++++++++++++++++++++++
 package/capnproto/Config.in           | 16 +++++++
 package/capnproto/capnproto.mk        | 17 +++++++
 5 files changed, 120 insertions(+)
 create mode 100644 package/capnproto/0001-execinfo.patch
 create mode 100644 package/capnproto/Config.in
 create mode 100644 package/capnproto/capnproto.mk
DEVELOPERS +1 -0
index c409f28..6ad12d2 100644
@@ -1023,6 +1023,7 @@ N:	Kevin Joly <[email protected]>
 F:	package/libgphoto2/
 
 N:	Koen Martens <[email protected]>
+F:	package/capnproto/
 F:	package/linuxconsoletools/
 
 N:	Laurent Cans <[email protected]>
package/Config.in +1 -0
index 46c78a0..0619103 100644
@@ -1375,6 +1375,7 @@ menu "Other"
 	source "package/bctoolbox/Config.in"
 	source "package/bdwgc/Config.in"
 	source "package/boost/Config.in"
+	source "package/capnproto/Config.in"
 	source "package/clapack/Config.in"
 	source "package/classpath/Config.in"
 	source "package/cppcms/Config.in"
package/capnproto/0001-execinfo.patch new file +85 -0

85 lines not on this page · raw message

package/capnproto/Config.in new file +16 -0
new file mode 100644
index 0000000..d25ccf7
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_CAPNPROTO
+	bool "capnproto"
+	depends on BR2_HOST_GCC_AT_LEAST_4_8 # C++11
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
+	help
+	  Cap'n Proto is an insanely fast data interchange format
+	  and capability-based RPC system. Think JSON, except
+	  binary. Or think Protocol Buffers, except faster. In
+	  fact, in benchmarks, Cap?n Proto is INFINITY TIMES
+	  faster than Protocol Buffers.
+
+	  https://capnproto.org/index.html
+
+comment "capnproto needs host and target gcc >= 4.8"
+	depends on !BR2_HOST_GCC_AT_LEAST_4_8 || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
+
package/capnproto/capnproto.mk new file +17 -0
new file mode 100644
index 0000000..510a3b2
@@ -0,0 +1,17 @@
+################################################################################
+#
+# capnproto
+#
+################################################################################
+
+CAPNPROTO_VERSION = 0.6.1
+CAPNPROTO_SOURCE = capnproto-c++-$(CAPNPROTO_VERSION).tar.gz
+CAPNPROTO_SITE = https://capnproto.org
+CAPNPROTO_LICENSE = MIT
+CAPNPROTO_LICENSE_FILES = LICENSE.txt
+CAPNPROTO_INSTALL_STAGING = YES
+CAPNPROTO_CONF_OPTS = --with-external-capnp
+CAPNPROTO_DEPENDENCIES = host-capnproto
+
+$(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 capnproto: new package

Hello,

Quoted 9 lines · Koen Martens

Cap'n Proto is an insanely fast data interchange format and capability-based RPC system. Think JSON, except binary. Or think Protocol Buffers, except faster. In fact, in benchmarks, Cap?n Proto is INFINITY TIMES faster than Protocol Buffers.

https://capnproto.org/index.html

Thanks for this contribution, the patch looks mostly good. Only a few comments below.

Quoted 11 lines
package/capnproto/0001-execinfo.patch new file +5 -0
new file mode 100644
index 0000000..85ef716
@@ -0,0 +1,85 @@
+Capnproto assumes that if __GLIBC__ is defined then
+execinfo.h is available. uClibc does not implement
+execinfo.h, but does define __GLIBC__ in features.h
+(documented as an acceptable lie).
+

package/capnproto/0001-execinfo.patch line 15

Quoted 10 lines
package/capnproto/0001-execinfo.patch new file +10 -0
+We add an explicit check for existence of execinfo.h
+to configure and use HAVE_EXECINFO_H in the code
+that includes execinfo.h
+
+A more permanent patch has been submitted upstream
+as a pull-request.
+
+https://github.com/capnproto/capnproto/pull/511
+
+Signed-off-by: Koen Martens <[email protected]>

Since upstream uses Git, we prefer to have a Git-formatted patch, i.e generated with "git format-patch -N". It should also have a proper commit title, i.e a single line at the beginning that summarizes the commit, separated from the rest of the commit log by one empty line.

package/capnproto/0001-execinfo.patch line 32

Quoted 8 lines
package/capnproto/0001-execinfo.patch new file +7 -0
+
+diff -Naur a/config.h.in b/config.h.in
+--- a/config.h.in	2017-06-08 20:03:58.000000000 +0200
++++ b/config.h.in	2017-07-06 12:26:45.559406000 +0200
 
+diff -Naur a/configure b/configure
+--- a/configure	2017-06-08 20:03:58.000000000 +0200
++++ b/configure	2017-07-06 12:26:45.559406000 +0200

Please keep only the modifications on configure.ac and exception.c++, and enable CAPNPROTO_AUTORECONF = YES. This will re-generate the configure script.

Quoted 32 lines
package/capnproto/Config.in new file +16 -0
new file mode 100644
index 0000000..d25ccf7
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_CAPNPROTO
+	bool "capnproto"
+	depends on BR2_HOST_GCC_AT_LEAST_4_8 # C++11
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
+	help
+	  Cap'n Proto is an insanely fast data interchange format
+	  and capability-based RPC system. Think JSON, except
+	  binary. Or think Protocol Buffers, except faster. In
+	  fact, in benchmarks, Cap?n Proto is INFINITY TIMES
+	  faster than Protocol Buffers.
+
+	  https://capnproto.org/index.html
+
+comment "capnproto needs host and target gcc >= 4.8"
+	depends on !BR2_HOST_GCC_AT_LEAST_4_8 || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
+
package/capnproto/capnproto.mk new file +4 -0
new file mode 100644
index 0000000..510a3b2
@@ -0,0 +1,17 @@
+################################################################################
+#
+# capnproto
+#

package/capnproto/capnproto.mk line 14

Quoted 10 lines
package/capnproto/capnproto.mk new file +10 -0
+################################################################################
+
+CAPNPROTO_VERSION = 0.6.1
+CAPNPROTO_SOURCE = capnproto-c++-$(CAPNPROTO_VERSION).tar.gz
+CAPNPROTO_SITE = https://capnproto.org
+CAPNPROTO_LICENSE = MIT
+CAPNPROTO_LICENSE_FILES = LICENSE.txt
+CAPNPROTO_INSTALL_STAGING = YES
+CAPNPROTO_CONF_OPTS = --with-external-capnp
+CAPNPROTO_DEPENDENCIES = host-capnproto

Could you give some details as to why the host capnproto is necessary to build the target capnproto ?

Also, you forgot the hash file for this package.

If possible, make sure to run your new package through utils/check-package and utils/test-pkg.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#7 lore raw

PATCH 1/1 capnproto: new package

In reply to Koen Martens

On 06-07-17 17:40, Koen Martens wrote:
[snip]

package/capnproto/Config.in line 4

Quoted 10 lines
package/capnproto/Config.in new file +4 -0
new file mode 100644
index 0000000..d25ccf7
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_CAPNPROTO
+	bool "capnproto"
+	depends on BR2_HOST_GCC_AT_LEAST_4_8 # C++11
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11

Something tells me that this needs

depends on BR2_INSTALL_LIBSTDCPP

Regards,
Arnout

Quoted 12 lines
package/capnproto/Config.in new file +12 -0
+	help
+	  Cap'n Proto is an insanely fast data interchange format
+	  and capability-based RPC system. Think JSON, except
+	  binary. Or think Protocol Buffers, except faster. In
+	  fact, in benchmarks, Cap?n Proto is INFINITY TIMES
+	  faster than Protocol Buffers.
+
+	  https://capnproto.org/index.html
+
+comment "capnproto needs host and target gcc >= 4.8"
+	depends on !BR2_HOST_GCC_AT_LEAST_4_8 || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
+

[snip]

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#2 lore raw

PATCH 1/1 capnproto: new package

In reply to Thomas Petazzoni
Quoted 27 lines · Thomas Petazzoni

Hello,

Review

Quoted 1 line · Koen Martens
(quoted diff) +0 -0

b/package/capnproto/0001-execinfo.patch

Quoted 17 lines

new file mode 100644
index 0000000..85ef716

package/capnproto/0001-execinfo.patch new file +12 -0
@@ -0,0 +1,85 @@
+Capnproto assumes that if __GLIBC__ is defined then
+execinfo.h is available. uClibc does not implement
+execinfo.h, but does define __GLIBC__ in features.h
+(documented as an acceptable lie).
+
+We add an explicit check for existence of execinfo.h
+to configure and use HAVE_EXECINFO_H in the code
+that includes execinfo.h
+
+A more permanent patch has been submitted upstream
+as a pull-request.
+
Quoted 8 lines

package/capnproto/0001-execinfo.patch line 15

Quoted 3 lines
package/capnproto/0001-execinfo.patch new file +3 -0
+https://github.com/capnproto/capnproto/pull/511
+
+Signed-off-by: Koen Martens <[email protected]>

Since upstream uses Git, we prefer to have a Git-formatted patch, i.e generated with "git format-patch -N". It should also have a proper commit title, i.e a single line at the beginning that summarizes the commit, separated from the rest of the commit log by one empty line.

Sure, except the published tarball is from a subdirectory of the upstream git repo. So creating a git patch with format-patch results in a patch that needs 'patch -p2' to apply in buildroot. I understand this is impossible. What do you prefer i do? Manually modify the patch to remove the subdir that should be stripped?

Quoted 4 lines

package/capnproto/0001-execinfo.patch line 16

Quoted 1 line
package/capnproto/0001-execinfo.patch new file +1 -0
+CAPNPROTO_DEPENDENCIES = host-capnproto

Could you give some details as to why the host capnproto is necessary to build the target capnproto ?

Capnproto provides a compiler to compile capnproto message definitions to c++ code. The library uses capnproto messages itself, and thus needs the capnproto compiler to compile. This obviously must be the host capnproto compiler, because the target compiler will not run on the compiling host.

Is that sufficient detail, or do you want this in the package files somewhere? If so, where?

- Koen

Signature · 1 line
Sent from my Android device with K-9 Mail. Please excuse my brevity.
#3 lore raw

PATCH 1/1 capnproto: new package

Hello,

Quoted 10 lines · Koen Martens
Quoted 4 lines

Since upstream uses Git, we prefer to have a Git-formatted patch, i.e generated with "git format-patch -N". It should also have a proper commit title, i.e a single line at the beginning that summarizes the commit, separated from the rest of the commit log by one empty line.

Sure, except the published tarball is from a subdirectory of the upstream git repo. So creating a git patch with format-patch results in a patch that needs 'patch -p2' to apply in buildroot. I understand this is impossible. What do you prefer i do? Manually modify the patch to remove the subdir that should be stripped?

Gah, OK. Then perhaps a quick comment in the patch description would be nice, like:

[Patch cannot be generated with git format-patch, as the upstream Git repository directory layout doesn't match the tarball directory layout]

Quoted 5 lines
Quoted 4 lines
Quoted 1 line

+CAPNPROTO_DEPENDENCIES = host-capnproto

Could you give some details as to why the host capnproto is necessary to build the target capnproto ?

Quoted 8 lines

Capnproto provides a compiler to compile capnproto message definitions to c++ code. The library uses capnproto messages itself, and thus needs the capnproto compiler to compile. This obviously must be the host capnproto compiler, because the target compiler will not run on the compiling host.

Is that sufficient detail, or do you want this in the package files somewhere? If so, where?

A quick comment above the dependency would be nice, like:

# Needs the capnproto compiler on the host to generate C++ code from

# message definitions

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#4 lore raw

PATCH 1/1 capnproto: new package

Hi,

Quoted 12 lines · Thomas Petazzoni
Quoted 10 lines · Koen Martens
Quoted 4 lines

Since upstream uses Git, we prefer to have a Git-formatted patch, i.e generated with "git format-patch -N". It should also have a proper commit title, i.e a single line at the beginning that summarizes the commit, separated from the rest of the commit log by one empty line.

Sure, except the published tarball is from a subdirectory of the upstream git repo. So creating a git patch with format-patch results in a patch that needs 'patch -p2' to apply in buildroot. I understand this is impossible. What do you prefer i do? Manually modify the patch to remove the subdir that should be stripped?

Quoted 5 lines

Gah, OK. Then perhaps a quick comment in the patch description would be nice, like:

[Patch cannot be generated with git format-patch, as the upstream Git repository directory layout doesn't match the tarball directory layout]

It's a temporary patch anyway, i have an open merge request with upstream.

Anyway, i'm trying to utils/test-pkg capnproto with CAPNPROTO_AUTORECONF = YES, but get failures such as:

/bin/bash:
/home/gmc/br-test-pkg/armv5-ctng-linux-gnueabi/host/bin/autoreconf: No such file or directory

Interestingly, /home/gmc/br-test-pkg/armv5-ctng-linux-gnueabi/host/usr/bin/autoreconf does exist, so with usr/bin instead of bin.

I have a one-line capnproto.conf i feed to test-pkg:

BR2_PACKAGE_CAPNPROTO=y

What am i doing wrong?

- Koen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170707/f686fde5/attachment.asc>

#5 lore raw

PATCH 1/1 capnproto: new package

Hello,

Quoted 6 lines · Koen Martens

It's a temporary patch anyway, i have an open merge request with upstream.

Anyway, i'm trying to utils/test-pkg capnproto with CAPNPROTO_AUTORECONF = YES, but get failures such as:

Quoted 7 lines

/bin/bash:
/home/gmc/br-test-pkg/armv5-ctng-linux-gnueabi/host/bin/autoreconf: No such file or directory

Interestingly, /home/gmc/br-test-pkg/armv5-ctng-linux-gnueabi/host/usr/bin/autoreconf does exist, so with usr/bin instead of bin.

Are you doing completely clean builds here? If you have already done a run of test-pkg before, make sure to clean up the build folders.

We have recently moved $(HOST_DIR)/usr to $(HOST_DIR), and it seems like you have a mix of things before and after this change.

If that still doesn't work after a full rebuild, let us know, there might be a real bug somewhere, though I would assume the autobuilders would have caught such an obvious problem.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#6 lore raw

PATCH 1/1 capnproto: new package

Hi,

Quoted 15 lines · Thomas Petazzoni
Quoted 10 lines · Koen Martens

Anyway, i'm trying to utils/test-pkg capnproto with CAPNPROTO_AUTORECONF = YES, but get failures such as:

/bin/bash:
/home/gmc/br-test-pkg/armv5-ctng-linux-gnueabi/host/bin/autoreconf: No such file or directory

Interestingly, /home/gmc/br-test-pkg/armv5-ctng-linux-gnueabi/host/usr/bin/autoreconf does exist, so with usr/bin instead of bin.

Are you doing completely clean builds here? If you have already done a run of test-pkg before, make sure to clean up the build folders.

Quoted 6 lines

We have recently moved $(HOST_DIR)/usr to $(HOST_DIR), and it seems like you have a mix of things before and after this change.

If that still doesn't work after a full rebuild, let us know, there might be a real bug somewhere, though I would assume the autobuilders would have caught such an obvious problem.

*doh*, indeed I had some old stuff in ~/br-test-pkg, thanks!

- Koen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20170707/24b768f5/attachment.asc>