Skip to contentSkip to conversation

capnproto: new package

PATCH Superseded Koen Martens 2 participants 5 messages Jul 12, 2017 – Jul 22, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 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 +
 .../0001-Do-not-use-execinfo-h-with-uclibc.patch   | 36 ++++++++++++++++++++++
 package/capnproto/Config.in                        | 22 +++++++++++++
 package/capnproto/capnproto.hash                   |  2 ++
 package/capnproto/capnproto.mk                     | 22 +++++++++++++
 6 files changed, 84 insertions(+)
 create mode 100644 package/capnproto/0001-Do-not-use-execinfo-h-with-uclibc.patch
 create mode 100644 package/capnproto/Config.in
 create mode 100644 package/capnproto/capnproto.hash
 create mode 100644 package/capnproto/capnproto.mk
DEVELOPERS +1 -0
index f392838..f5e041e 100644
@@ -1024,6 +1024,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 db943df..3166791 100644
@@ -1377,6 +1377,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-Do-not-use-execinfo-h-with-uclibc.patch new file +36 -0
new file mode 100644
index 0000000..dddc923
@@ -0,0 +1,36 @@
+From: Koen Martens <[email protected]>
+Date: Thu, 11 Jul 2017 20:44:18 +0200
+Subject: [PATCH] Do not use execinfo.h with uclibc
+
+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).
+
+uClibc also defines __UCLIBC__ in features.h, so we
+check for that macro to be defined and skip the
+features that depend on execinfo.h when it is
+defined.
+
+This patch has been submitted upstream.
+
+Because the directory structure of the release tarball
+is different from the git repository, this patch has
+not been generated with git format-patch.
+
+https://github.com/capnproto/capnproto/pull/511
+
+Signed-off-by: Koen Martens <[email protected]>
+diff --git a/src/kj/exception.c++ b/src/kj/exception.c++
+index 218f1db..d10ce8d 100644
+--- a/src/kj/exception.c++
++++ b/src/kj/exception.c++
+@@ -33,7 +33,7 @@
+ #endif
+ #include "io.h"
+ 
+-#if (__linux__ && __GLIBC__) || __APPLE__
++#if (__linux__ && __GLIBC__ && !__UCLIBC__) || __APPLE__
+ #define KJ_HAS_BACKTRACE 1
+ #include <execinfo.h>
+ #endif
package/capnproto/Config.in new file +22 -0
new file mode 100644
index 0000000..ef0e380
@@ -0,0 +1,22 @@
+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
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_USE_MMU
+	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 w/ C++, threads"
+	depends on !BR2_HOST_GCC_AT_LEAST_4_8 || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 || \
+		!BR2_INSTALL_LIBSTDCPP || \
+		!BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_USE_MMU
package/capnproto/capnproto.hash new file +2 -0
new file mode 100644
index 0000000..451baaa
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256	8082040cd8c3b93c0e4fc72f2799990c72fdcf21c2b5ecdae6611482a14f1a04	capnproto-c++-0.6.1.tar.gz
package/capnproto/capnproto.mk new file +22 -0
new file mode 100644
index 0000000..6221d4e
@@ -0,0 +1,22 @@
+################################################################################
+#
+# 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_AUTORECONF = YES
+CAPNPROTO_CONF_OPTS = --with-external-capnp
+CAPNPROTO_DEPENDENCIES = host-autoconf host-capnproto
+
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+CAPNPROTO_CONF_ENV += LIBS=-latomic
+endif
+
+$(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/1 capnproto: new package

Quoted 8 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

No takers?

- koen

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

PATCH v2 1/1 capnproto: new package

Quoted 9 lines · Koen Martens
Quoted 6 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.

Quoted 4 lines
Quoted 2 lines

https://capnproto.org/index.html

No takers?

Not going to be accepted i guess. No problem, we'll maintain it in our private branch then. Would've been nice to have had a short note though that it isn't going to be merged.

- koen

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

PATCH v2 1/1 capnproto: new package

In reply to Koen Martens

Koen, All,

On 2017-07-22 08:16 +0200, Koen Martens spake thusly:

Quoted 3 lines

Not going to be accepted i guess. No problem, we'll maintain it in our private branch then. Would've been nice to have had a short note though that it isn't going to be merged.

That's not that it won't be accepted, it's just that we have a *lot* of pending patches, and we can't handle everything on a whim:
https://patchwork.ozlabs.org/project/buildroot/list/

At the time of writing, that's 237 pending patches...

On 2017-07-12 18:21 +0200, Koen Martens spake thusly:

Quoted 5 lines

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.

No need in the commit log to repeat the help text. Instead, the commit log should explain the packaging in Buildroot.

For example, the commit log should explain why the host variant is needed. You exoplained it in the previous review, but for posterity in the git log we need it.

Quoted 2 lines

https://capnproto.org/index.html

Empty line before your SoB line, pelase. And the url ius not needed, since it is in the help text anyway.

[--SNIP--]

Quoted 9 lines
package/capnproto/0001-Do-not-use-execinfo-h-with-uclibc.patch new file +3 -0
new file mode 100644
index 0000000..dddc923
@@ -0,0 +1,36 @@
+From: Koen Martens <[email protected]>
+Date: Thu, 11 Jul 2017 20:44:18 +0200
+Subject: [PATCH] Do not use execinfo.h with uclibc

package/capnproto/0001-Do-not-use-execinfo-h-with-uclibc.patch line 13

Quoted 10 lines
package/capnproto/0001-Do-not-use-execinfo-h-with-uclibc.patch new file +10 -0
+
+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).
+
+uClibc also defines __UCLIBC__ in features.h, so we
+check for that macro to be defined and skip the
+features that depend on execinfo.h when it is
+defined.

In fact, uClibc does have execinfo now, and it also even has backtrace support. It's just that this is configurable and not enabled in the default configuration.

A better check would be to actually detect presence of backtrace at configure time. See for example:

package/jack2/0003-Make-backtrace-support-depends-on-execinfo.h-existen.patch

But...

package/capnproto/0001-Do-not-use-execinfo-h-with-uclibc.patch line 21

Quoted 7 lines
package/capnproto/0001-Do-not-use-execinfo-h-with-uclibc.patch new file +7 -0
+This patch has been submitted upstream.
+
+Because the directory structure of the release tarball
+is different from the git repository, this patch has
+not been generated with git format-patch.
+
+https://github.com/capnproto/capnproto/pull/511

... upstream has applied that patch now, so we can just state we backport an upstream fix (for now):

    https://github.com/capnproto/capnproto/commit/e651ac5febc59e3e2b5d3365ededbe5362756da2
Quoted 20 lines
package/capnproto/0001-Do-not-use-execinfo-h-with-uclibc.patch new file +14 -0
+Signed-off-by: Koen Martens <[email protected]>
+diff --git a/src/kj/exception.c++ b/src/kj/exception.c++
+index 218f1db..d10ce8d 100644
+--- a/src/kj/exception.c++
++++ b/src/kj/exception.c++
+@@ -33,7 +33,7 @@
+ #endif
+ #include "io.h"
+ 
+-#if (__linux__ && __GLIBC__) || __APPLE__
++#if (__linux__ && __GLIBC__ && !__UCLIBC__) || __APPLE__
+ #define KJ_HAS_BACKTRACE 1
+ #include <execinfo.h>
+ #endif
package/capnproto/Config.in new file +0 -0
new file mode 100644
index 0000000..ef0e380

package/capnproto/Config.in line 7

Quoted 7 lines
package/capnproto/Config.in new file +7 -0
@@ -0,0 +1,22 @@
+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
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_USE_MMU

We usually have the dependencies on the hardware features, like the MMU, go first, followed by the software deepndencies (which the user actually can act upon).

Quoted 5 lines
package/capnproto/Config.in new file +5 -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

package/capnproto/Config.in line 22

Quoted 10 lines
package/capnproto/Config.in new file +10 -0
+	  faster than Protocol Buffers.
+
+	  https://capnproto.org/index.html
+
+comment "capnproto needs host and target gcc >= 4.8 w/ C++, threads"
+	depends on !BR2_HOST_GCC_AT_LEAST_4_8 || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 || \
+		!BR2_INSTALL_LIBSTDCPP || \
+		!BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_USE_MMU

Ditto.

Otherwise, that looks good.

Regards,
Yann E. MORIN.

Quoted 43 lines
package/capnproto/capnproto.hash new file +2 -0
new file mode 100644
index 0000000..451baaa
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256	8082040cd8c3b93c0e4fc72f2799990c72fdcf21c2b5ecdae6611482a14f1a04	capnproto-c++-0.6.1.tar.gz
package/capnproto/capnproto.mk new file +22 -0
new file mode 100644
index 0000000..6221d4e
@@ -0,0 +1,22 @@
+################################################################################
+#
+# 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_AUTORECONF = YES
+CAPNPROTO_CONF_OPTS = --with-external-capnp
+CAPNPROTO_DEPENDENCIES = host-autoconf host-capnproto
+
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+CAPNPROTO_CONF_ENV += LIBS=-latomic
+endif
+
+$(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 6 lines
2.7.4

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH v2 1/1 capnproto: new package

Quoted 7 lines · Yann E. MORIN

Koen, All,

On 2017-07-22 08:16 +0200, Koen Martens spake thusly:

Quoted 3 lines

Not going to be accepted i guess. No problem, we'll maintain it in our private branch then. Would've been nice to have had a short note though that it isn't going to be merged.

Quoted 5 lines

That's not that it won't be accepted, it's just that we have a *lot* of pending patches, and we can't handle everything on a whim:
https://patchwork.ozlabs.org/project/buildroot/list/

At the time of writing, that's 237 pending patches...

Ouch, ok, I wasn't aware of that. I guess that's good news though, lots of contributions :)

Thanks for taking the time to review the second version of the patch, i'll have a look at fixing it.

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/20170722/9794a2d9/attachment.asc>