Package Details: zerotier-one 1.2.4-1

Git Clone URL: https://aur.archlinux.org/zerotier-one.git (read-only)
Package Base: zerotier-one
Description: Creates virtual Ethernet networks of almost unlimited size.
Upstream URL: https://www.zerotier.com/index.html
Licenses: GPL3
Submitter: strugee
Maintainer: eXeC64
Last Packager: eXeC64
Votes: 22
Popularity: 2.852561
First Submitted: 2014-03-30 08:14
Last Updated: 2017-04-26 21:07

Latest Comments

pqatsi commented on 2017-11-08 09:49

Registered in upstream: https://github.com/zerotier/ZeroTierOne/issues/617

EDIT 10/Nov/2017: Bug fixed in upstream GIT!

pqatsi commented on 2017-11-03 14:55

EDIT: I've commited in a fork of this git in https://github.com/leleobhz/archlinux-zerotier-one - Feel free if you want to push to AUR.

Well,

The support for native miniupnpc suffer same issue I faced when tried to build it in Alpine: https://github.com/leleobhz/aports/blob/master/testing/zerotier-one/miniupnpc-system.patch (Ref.: https://github.com/leleobhz/aports/tree/master/testing/zerotier-one - leleobhz is my user in github)

[root@haslam ~]# grep '.*define.*MINIUPNPC_VERSION.*"2.."' /usr/include/miniupnpc/miniupnpc.h
[root@haslam ~]# grep '.*define.*MINIUPNPC_VERSION.*"2..*"' /usr/include/miniupnpc/miniupnpc.h
#define MINIUPNPC_VERSION "2.0.20170509"


***** Before the patch:

[root@haslam ~]# ldd /usr/bin/zerotier-one
linux-vdso.so.1 (0x0000ffffb5e0f000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x0000ffffb5b01000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x0000ffffb5add000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x0000ffffb5ab0000)
libc.so.6 => /usr/lib/libc.so.6 (0x0000ffffb594c000)
/lib/ld-linux-aarch64.so.1 => /usr/lib/ld-linux-aarch64.so.1 (0x0000ffffb5de3000)
libm.so.6 => /usr/lib/libm.so.6 (0x0000ffffb5894000)
[root@haslam ~]# ps aux | grep zerotier-one
root 335 0.2 1.1 212912 10764 ? Ssl 12:59 0:00 /usr/sbin/zerotier-one
root 2201 0.0 0.0 2612 568 pts/0 S+ 13:05 0:00 grep zerotier-one
[root@haslam ~]#

...

==> Starting build()...
clang++ -march=armv8-a -O2 -pipe -fstack-protector-strong -fno-plt -Wall -Wno-unused-result -Wreorder -fPIE -std=c++
11 -pthread -DNDEBUG -D_FORTIFY_SOURCE=2 -DZT_USE_MINIUPNPC -DMINIUPNP_STATICLIB -DMINIUPNPC_SET_SOCKET_TIMEOUT -DM
INIUPNPC_GET_SRC_ADDR -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DOS_STRING=\"Linux\" -DMINIUPNPC_VERSION_
STRING=\"2.0\" -DUPNP_VERSION_STRING=\"UPnP/1.1\" -DENABLE_STRNATPMPERR -DZT_USE_SYSTEM_NATPMP -DZT_NO_TYPE_PUNNING
-DZT_BUILD_PLATFORM=1 -DZT_BUILD_ARCHITECTURE=4 -DZT_SOFTWARE_UPDATE_DEFAULT="\"disable\"" -D_FORTIFY_SOURCE=2 -c -
o controller/EmbeddedNetworkController.o controller/EmbeddedNetworkController.cpp


**** After the patch:

clang++ -march=armv8-a -O2 -pipe -fstack-protector-strong -fno-plt -Wall -Wno-unused-result -Wreorder -fPIE -std=c++11 -pthread -DNDEBUG -D_FORTIFY_SOURCE=2 -DZT_USE_MINIUPNPC -DZT_USE_SYSTEM_MINIUPNPC -DZT_USE_SYSTEM_NATPMP -DZT_NO_TYPE_PUNNING -DZT_BUILD_PLATFORM=1 -DZT_BUILD_ARCHITECTURE=4 -DZT_SOFTWARE_UPDATE_DEFAULT="\"disable\"" -D_FORTIFY_SOURCE=2 -c -o controller/EmbeddedNetworkController.o controller/EmbeddedNetworkController.cpp

[root@haslam ~]# ldd /usr/bin/zerotier-one
linux-vdso.so.1 (0x0000ffff9dadb000)
libminiupnpc.so.16 => /usr/lib/libminiupnpc.so.16 (0x0000ffff9d96a000)
libnatpmp.so.1 => /usr/lib/libnatpmp.so.1 (0x0000ffff9d958000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x0000ffff9d7a6000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x0000ffff9d782000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x0000ffff9d755000)
libc.so.6 => /usr/lib/libc.so.6 (0x0000ffff9d5f1000)
/lib/ld-linux-aarch64.so.1 => /usr/lib/ld-linux-aarch64.so.1 (0x0000ffff9daaf000)
libm.so.6 => /usr/lib/libm.so.6 (0x0000ffff9d539000)

[root@haslam ~]# ps aux | grep zerotier-one
root 6449 0.8 1.1 213072 10444 ? Ssl 14:51 0:00 /usr/sbin/zerotier-one
root 6468 0.0 0.0 2612 548 pts/0 S+ 14:52 0:00 grep zerotier-one
[root@haslam ~]#

**** Diff:

diff --git a/PKGBUILD b/PKGBUILD
index eb7274a..0c5ec3d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,17 +4,18 @@ pkgname=zerotier-one
pkgver=1.2.4
pkgrel=1
pkgdesc="Creates virtual Ethernet networks of almost unlimited size."
-arch=('i686' 'x86_64' 'armv7h')
+arch=('i686' 'x86_64' 'armv7h' 'aarch64')
url="https://www.zerotier.com/index.html"
license=('GPL3')
groups=()
-depends=("gcc-libs" "http-parser")
-makedepends=("ruby-ronn")
+depends=("gcc-libs" "miniupnpc" "libnatpmp" "http-parser")
+makedepends=("ruby-ronn" "clang" "miniupnpc" "libnatpmp")
source=("${pkgname}-${pkgver}::https://github.com/zerotier/ZeroTierOne/archive/$pkgver.tar.gz")
sha512sums=('82adb110208d24ae2745e3839810afcac87955de050ebfe0517a7dc2a875881dafd40c1b16a041742d8c4d0f6513abcc71d6ea3e06c2fb89b47be2630a500363')

build() {
cd "$srcdir/ZeroTierOne-$pkgver"
+ patch -p1 < $startdir/miniupnpc-system.patch
make
}


***** Patch:

[leonardo@haslam zerotier-one]$ cat miniupnpc-system.patch
--- ZeroTierOne-1.2.4-orig/make-linux.mk
+++ ZeroTierOne-1.2.4/make-linux.mk
@@ -22,7 +22,7 @@
# otherwise build into binary as done on Mac and Windows.
OBJS+=osdep/PortMapper.o
DEFS+=-DZT_USE_MINIUPNPC
-MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2.."' /usr/include/miniupnpc/miniupnpc.h && echo 1)
+MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2..*"' /usr/include/miniupnpc/miniupnpc.h && echo 1)
ifeq ($(MINIUPNPC_IS_NEW_ENOUGH),1)
DEFS+=-DZT_USE_SYSTEM_MINIUPNPC
LDLIBS+=-lminiupnpc

pqatsi commented on 2017-11-03 11:34

" miniupnpc and libnatpmp aren't dependencies to my knowledge. ZeroTier is fully functional for me without having ever installed either of those."

The build system compiles a static version if the system library/headers do not match. I think if the arch mainstream base does Zerotier build system happy, it should be used.

Ill test here in my Raspberry Pi 3 in aarch64.

pqatsi commented on 2017-11-01 19:49

@eXeC64

I did not installed base-devel group, just these packages I cited in my diff.

About clang, the zerotier developer prefers clang for a performance and compliance and just a pacman -Sy clang installed everything needed, so I think worth depend of clang. Also, as in README.md of zerotier project:

"Linux makefiles automatically detect and prefer clang/clang++ if present as it produces smaller and slightly faster binaries in most cases. You can override by supplying CC and CXX variables on the make command line."

So I think - specially considering aarch64 platform - a good idea the clang adoption.

In production cases, a iperf with 4 process passing over a zerotier network bring me almost 70mbps with near 40% of mean of cpu loads. So any optimization I think its wellcome.

eXeC64 commented on 2017-11-01 19:00

@pqatsi
fakeroot & make are provided by the base-devel group, which are a global dependency of AUR, so don't need to be specified. clang isn't provided by base-devel, but the zerotier build automatically falls back to gcc if clang isn't installed.

Does this build on aarch for you without clang installed? If so, I can just add the 'aarch' architecture directly. If not, I can specify makedepends_aarch64.

pqatsi commented on 2017-10-30 19:56

Sucessfully compiled in aarch64 - Raspberry PI 3 with following diff:

[leonardo@haslam zerotier-one]$ git diff
diff --git a/PKGBUILD b/PKGBUILD
index eb7274a..29a3f8b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,12 +4,12 @@ pkgname=zerotier-one
pkgver=1.2.4
pkgrel=1
pkgdesc="Creates virtual Ethernet networks of almost unlimited size."
-arch=('i686' 'x86_64' 'armv7h')
+arch=('i686' 'x86_64' 'armv7h' 'aarch64')
url="https://www.zerotier.com/index.html"
license=('GPL3')
groups=()
depends=("gcc-libs" "http-parser")
-makedepends=("ruby-ronn")
+makedepends=("ruby-ronn" "clang" "fakeroot" "make")
source=("${pkgname}-${pkgver}::https://github.com/zerotier/ZeroTierOne/archive/$pkgver.tar.gz")
sha512sums=('82adb110208d24ae2745e3839810afcac87955de050ebfe0517a7dc2a875881dafd40c1b16a041742d8c4d0f6513abcc71d6ea3e06c2fb89b47be2630a500363')

Its possible to allow the clang makedepends and the aarch64?

CMagnuson commented on 2017-10-05 01:24

Just installed with a fully updated arch linux and the install didn't give me any errors when installed via sudo aura -A zerotier-one

pkmorrison commented on 2017-09-26 17:35

Build Failed

[identity] Serialize and deserialize (ASCII no private): PASS
[certificate] Generating identity to act as authority... b99e476afe
[certificate] Generating identities A and B... 3fc4403b45, 7a67fb400d
[certificate] Generating certificates A and B...
[certificate] Signing certificates A and B with authority...
[certificate] A agrees with B and B with A... yes, yes.
[certificate] Generating two certificates that should not agree...
[certificate] A agrees with B and B with A... no, no.
[phy] Creating phy endpoint...
[phy] Binding UDP listen socket to 127.0.0.1/60002... FAILED.

SOMETHING FAILED!
==> ERROR: A failure occurred in check().
Aborting...
==> ERROR: Makepkg was unable to build zerotier-one.
==> Restart building zerotier-one ? [y/N]
==> -------------------------------------
==>

dmilinevskyi commented on 2017-07-08 02:09

Could you please export `CC=gcc` and `CXX=g++` for make? The build system of `zerotier-one` prefers clang if it's available while some default makepkg options are not compatible with it (-fvar-tracking-assignments).

kseistrup commented on 2017-05-07 19:05

Building fails on e.g. RPi2 because “gcc -dumpmachine” says “armv7l-unknown-linux-gnueabihf”, and the make-linux.mk file only looks for “armv7-*”.

All comments