From 89219140986c22084071b8269a40ac21782bcecd Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Mon, 29 Jun 2020 14:24:06 -0700 Subject: [PATCH 01/11] force use of vendored modules --- CMakeLists.txt | 2 +- vendor/modules.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ab76c312..fe383db20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -265,7 +265,7 @@ if(NOT PACKAGE_STATIC) zerotier ALL BYPRODUCTS ${CMAKE_BINARY_DIR}/zerotier SOURCES ${go_src} - COMMAND ${CMAKE_COMMAND} -E env ${GOARCH} ${GOARM} CGO_ENABLED=1 CGO_CFLAGS=\"-O3\" CGO_LDFLAGS=\"$ $ $ $ ${GO_EXTRA_LIBRARIES}\" ${GO} build ${GOFLAGS} -o ${CMAKE_BINARY_DIR}/${GO_EXE_NAME} ${CMAKE_SOURCE_DIR}/cmd/zerotier/zerotier.go + COMMAND ${CMAKE_COMMAND} -E env ${GOARCH} ${GOARM} CGO_ENABLED=1 CGO_CFLAGS=\"-O3\" CGO_LDFLAGS=\"$ $ $ $ ${GO_EXTRA_LIBRARIES}\" ${GO} build -mod=vendor ${GOFLAGS} -o ${CMAKE_BINARY_DIR}/${GO_EXE_NAME} ${CMAKE_SOURCE_DIR}/cmd/zerotier/zerotier.go COMMENT "Compiling Go Code..." ) add_dependencies(zerotier zt_osdep zt_core zt_controller zt_service_io_core) diff --git a/vendor/modules.txt b/vendor/modules.txt index d10ed15e6..a368c55e1 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -4,6 +4,6 @@ github.com/Microsoft/go-winio/pkg/guid # github.com/hectane/go-acl v0.0.0-20190604041725-da78bae5fc95 github.com/hectane/go-acl github.com/hectane/go-acl/api -# golang.org/x/sys v0.0.0-20200523222454-059865788121 +# golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 golang.org/x/sys/internal/unsafeheader golang.org/x/sys/windows From 696c77f5c8cc8cd6a15a4325e4d3119a5306af10 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Mon, 29 Jun 2020 14:50:52 -0700 Subject: [PATCH 02/11] no static builds for armel no support in Alpine, can't build it --- Jenkinsfile | 10 ++++------ dockerbuild/Makefile | 1 - 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c0ba7e1f2..e8ec200d3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -113,7 +113,7 @@ def buildStaticBinaries() { def dist = ["alpine"] def archs = [] if (params.BUILD_ALL == true) { - archs = ["arm64", "amd64", "i386", "armhf", "armel", "ppc64le", "s390x"] + archs = ["arm64", "amd64", "i386", "armhf", "ppc64le", "s390x"] } else { archs = ["amd64", "i386"] } @@ -132,8 +132,6 @@ def buildStaticBinaries() { def cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1"' if (platform == "i386") { cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1"' - } else if (platform == "armel") { - cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1 -DBUILD_ARM_V5=1"' } else if (platform == "armhf") { cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1 -DBUILD_ARM_V6=1"' } @@ -234,7 +232,7 @@ def packageStatic() { def debianJessie = ["debian-jessie"] def debianJessieArchs = [] if (params.BUILD_ALL == true) { - debianJessieArch = ["armhf", "armel", "amd64", "i386"] + debianJessieArch = ["armhf", "amd64", "i386"] } else { debianJessieArch = ["amd64", "i386"] } @@ -278,7 +276,7 @@ def packageStatic() { def ubuntuTrusty = ["ubuntu-trusty"] def ubuntuTrustyArch = [] if (params.BUILD_ALL == true) { - ubuntuTrustyArch = ["i386", "amd64", "armhf", "arm64", "ppc64le"] + ubuntuTrustyArch = ["i386", "amd64", "arm64", "ppc64le"] } else { ubuntuTrustyArch = ["i386", "amd64"] } @@ -322,7 +320,7 @@ def packageStatic() { def debianWheezy = ["debian-wheezy"] def debianWheezyArchs = [] if (params.BUILD_ALL == true) { - debianWheezyArchs = ["armhf", "armel", "amd64", "i386"] + debianWheezyArchs = ["armhf", "amd64", "i386"] } else { debianWheezyArchs = ["amd64", "i386"] } diff --git a/dockerbuild/Makefile b/dockerbuild/Makefile index bb6444b2b..99158c668 100644 --- a/dockerbuild/Makefile +++ b/dockerbuild/Makefile @@ -8,7 +8,6 @@ alpine: docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-arm64.tar.gz" --platform linux/arm64 -f Dockerfile.alpine . -t ztbuild/alpine-arm64 --load docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-386.tar.gz" --platform linux/386 -f Dockerfile.alpine . -t ztbuild/alpine-i386 --load docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.alpine . -t ztbuild/alpine-amd64 --load - docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.alpine . -t ztbuild/alpine-armel --load docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.alpine . -t ztbuild/alpine-armhf --load docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-ppc64le.tar.gz" --platform linux/ppc64le -f Dockerfile.alpine . -t ztbuild/alpine-ppc64le --load docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-s390x.tar.gz" --platform linux/s390x -f Dockerfile.alpine . -t ztbuild/alpine-s390x --load From aee344fe47b68f756a27a1eb251d91419a3bb03b Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Mon, 29 Jun 2020 15:18:01 -0700 Subject: [PATCH 03/11] kill a couple docker images --- dockerbuild/Makefile | 2 -- 1 file changed, 2 deletions(-) diff --git a/dockerbuild/Makefile b/dockerbuild/Makefile index 99158c668..7d7938e85 100644 --- a/dockerbuild/Makefile +++ b/dockerbuild/Makefile @@ -23,13 +23,11 @@ debian: debian-wheezy debian-jessie debian-buster debian-stretch debian-bullseye debian-wheezy: docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.debian-wheezy . -t ztbuild/debian-wheezy-amd64 --load - docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.debian-wheezy . -t ztbuild/debian-wheezy-armhf --load docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.debian-wheezy . -t ztbuild/debian-wheezy-armel --load docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-386.tar.gz" --platform linux/386 -f Dockerfile.debian-wheezy . -t ztbuild/debian-wheezy-i386 --load debian-jessie: docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.debian-jessie . -t ztbuild/debian-jessie-amd64 --load - docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-armv6l.tar.gz" --platform linux/arm/v7 -f Dockerfile.debian-jessie . -t ztbuild/debian-jessie-armhf --load docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.debian-jessie . -t ztbuild/debian-jessie-armel --load docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-386.tar.gz" --platform linux/386 -f Dockerfile.debian-jessie . -t ztbuild/debian-jessie-i386 --load From 16d27dfddb2dba5b9a081eb9f360ff2e4db8603d Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Mon, 29 Jun 2020 17:09:15 -0700 Subject: [PATCH 04/11] fix buster ld symlink --- dockerbuild/Dockerfile.debian-buster | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerbuild/Dockerfile.debian-buster b/dockerbuild/Dockerfile.debian-buster index 82efb2cd3..2326aee10 100644 --- a/dockerbuild/Dockerfile.debian-buster +++ b/dockerbuild/Dockerfile.debian-buster @@ -13,7 +13,7 @@ RUN if test "$TARGETPLATFORM" = "linux/mips64le"; then \ rm go.tar.gz; \ fi; RUN if test "$TARGETPLATFORM" = "linux/arm/v6"; then \ - ln -s /lib/arm-linux-gnueabi/ld-2.30.so /lib/ld-linux-armhf.so.3; \ + ln -s /lib/arm-linux-gnueabi/ld-2.28.so /lib/ld-linux-armhf.so.3; \ fi; RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build From 46c4a11a7a5eb21717b803375f87e8980371e4ef Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Mon, 29 Jun 2020 17:11:55 -0700 Subject: [PATCH 05/11] fix jessie symlink --- dockerbuild/Dockerfile.debian-jessie | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerbuild/Dockerfile.debian-jessie b/dockerbuild/Dockerfile.debian-jessie index 40129e68e..f0c60777a 100644 --- a/dockerbuild/Dockerfile.debian-jessie +++ b/dockerbuild/Dockerfile.debian-jessie @@ -14,7 +14,7 @@ RUN curl -s -k $go_pkg_url -o go.tar.gz && \ tar -C /usr/local -xzf go.tar.gz && \ rm go.tar.gz RUN if test "$TARGETPLATFORM" = "linux/arm/v6"; then \ - ln -s /lib/arm-linux-gnueabi/ld-2.30.so /lib/ld-linux-armhf.so.3; \ + ln -s /lib/arm-linux-gnueabi/ld-2.19.so /lib/ld-linux-armhf.so.3; \ fi; RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build From 0589c4ab6a667f6bc8d16d11acc474c03d0e6242 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Mon, 29 Jun 2020 17:12:52 -0700 Subject: [PATCH 06/11] fix stretch symlink --- dockerbuild/Dockerfile.debian-stretch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerbuild/Dockerfile.debian-stretch b/dockerbuild/Dockerfile.debian-stretch index 139df1bc2..5f5b58ea4 100644 --- a/dockerbuild/Dockerfile.debian-stretch +++ b/dockerbuild/Dockerfile.debian-stretch @@ -20,7 +20,7 @@ WORKDIR /cmake-3.17.3 RUN ./bootstrap && make -j8 && make install WORKDIR / RUN if test "$TARGETPLATFORM" = "linux/arm/v6"; then \ - ln -s /lib/arm-linux-gnueabi/ld-2.30.so /lib/ld-linux-armhf.so.3; \ + ln -s /lib/arm-linux-gnueabi/ld-2.24.so /lib/ld-linux-armhf.so.3; \ fi; RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build From 623213ea0b65e87dc9f2479bec2d6ffa4f27e453 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Mon, 29 Jun 2020 17:13:56 -0700 Subject: [PATCH 07/11] fix wheezy symlink --- dockerbuild/Dockerfile.debian-wheezy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerbuild/Dockerfile.debian-wheezy b/dockerbuild/Dockerfile.debian-wheezy index 3a1e109b6..5b036f823 100644 --- a/dockerbuild/Dockerfile.debian-wheezy +++ b/dockerbuild/Dockerfile.debian-wheezy @@ -18,7 +18,7 @@ RUN curl -s -k $go_pkg_url -o go.tar.gz && \ tar -C /usr/local -xzf go.tar.gz && \ rm go.tar.gz RUN if test "$TARGETPLATFORM" = "linux/arm/v6"; then \ - ln -s /lib/arm-linux-gnueabi/ld-2.30.so /lib/ld-linux-armhf.so.3; \ + ln -s /lib/arm-linux-gnueabi/ld-2.13.so /lib/ld-linux-armhf.so.3; \ fi; RUN groupadd -g 1000 jenkins-build && useradd -u 1000 -g 1000 jenkins-build From 722a50f7beb82c010d647ad0e8d39e0f020c8bce Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Mon, 29 Jun 2020 17:15:18 -0700 Subject: [PATCH 08/11] armel image build shortcut --- dockerbuild/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dockerbuild/Makefile b/dockerbuild/Makefile index 7d7938e85..66307aa00 100644 --- a/dockerbuild/Makefile +++ b/dockerbuild/Makefile @@ -143,3 +143,9 @@ x86: docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.ubuntu-eoan . -t ztbuild/ubuntu-eoan-amd64 --load docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-386.tar.gz" --platform linux/386 -f Dockerfile.ubuntu-eoan . -t ztbuild/ubuntu-eoan-i386 --load docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" --platform linux/amd64 -f Dockerfile.kali-rolling . -t ztbuild/kali-rolling-amd64 --load + +armel: + docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.debian-buster . -t ztbuild/debian-buster-armel --load + docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.debian-stretch . -t ztbuild/debian-stretch-armel --load + docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.debian-bullseye . -t ztbuild/debian-bullseye-armel --load + docker buildx build --build-arg go_pkg_url="https://dl.google.com/go/go${GO_VERSION}.linux-armv6l.tar.gz" --platform linux/arm/v6 -f Dockerfile.debian-sid . -t ztbuild/debian-sid-armel --load From b482064a552c044ea62708025b4c0457d5bef82a Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Tue, 30 Jun 2020 09:59:18 -0700 Subject: [PATCH 09/11] reenable some temporarily disabled stuff --- Jenkinsfile | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e8ec200d3..7140c3d42 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -365,12 +365,12 @@ def packageStatic() { def buildDebianNative() { def tasks = [:] - def buster = ["debian-buster" , "debian-stretch"] - def busterArchs = [] + def debian = ["debian-buster" , "debian-stretch", "debian-sid", "debian-bullseye"] + def debianArchs = [] if (params.BUILD_ALL) { - busterArchs = ["s390x", "ppc64le", "i386", "armhf", "armel", "arm64", "amd64"] + debianArchs = ["s390x", "ppc64le", "i386", "armhf", "armel", "arm64", "amd64"] } else { - busterArchs = ["amd64", "i386"] + debianArchs = ["amd64", "i386"] } def build = { distro, arch -> @@ -408,19 +408,8 @@ def buildDebianNative() { return myNode } - tasks << getTasks(buster, busterArchs, build) - - // 32-bit arm and CMake don't get along right now on Sid/Bullseye - def sid = ["debian-sid", "debian-bullseye"] - def sidArchs = [] - if (params.BUILD_ALL) { - busterArchs = ["s390x", "ppc64le", "i386", /*"armhf", "armel",*/ "arm64", "amd64", "mips64le"] - } else { - busterArchs = ["amd64", "i386"] - } - - tasks << getTasks(sid, sidArchs, build) - + tasks << getTasks(debian, debianArchs, build) + // bash is broken when running under QEMU-s390x on Xenial def xenial = ["ubuntu-xenial"] def xenialArchs = [] @@ -429,7 +418,7 @@ def buildDebianNative() { } else { xenialArchs = ["i386", "amd64"] } - //tasks << getTasks(xenial, xenialArchs, build) + tasks << getTasks(xenial, xenialArchs, build) def ubuntu = ["ubuntu-bionic", "ubuntu-eoan"] def ubuntuArchs = [] From 115187204f512828d3f1a03ebf7eeaf119ad2cbd Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Tue, 30 Jun 2020 10:04:19 -0700 Subject: [PATCH 10/11] remove debug output --- Jenkinsfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7140c3d42..4351df0b4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -391,7 +391,6 @@ def buildDebianNative() { cmakeFlags = 'CMAKE_ARGS="-DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V6=1"' } - sh 'whoami' dir("build") { sh "${cmakeFlags} make setup" dir("build") { From 536be73006809d220fa4c313b8d4d7ae0e458d72 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Tue, 30 Jun 2020 11:06:33 -0700 Subject: [PATCH 11/11] s390x all static --- Jenkinsfile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4351df0b4..490fe7771 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -198,7 +198,7 @@ def packageStatic() { }) if (params.BUILD_ALL == true) { - def clefos7 = ["clefos"] + def s390xStatics = ["clefos", "debian-buster", "debian-sid", "debian-bullseye", "debian-stretch", "ubuntu-bionic", "ubuntu-eoan", "ubuntu-focal"] def clefos7Arch = ["s390x"] tasks << getTasks(clefos7, clefos7Arch, { distro, arch -> def myNode = { @@ -208,12 +208,16 @@ def packageStatic() { checkout scm } def runtime = docker.image("ztbuild/${distro}-${arch}:latest") + def pkgFormat = "DEB" + if (distro == "clefos") { + pkgFormat = "RPM" + } runtime.inside { dir("build/") { unstash "static-${arch}" sh "mkdir -p build" sh "mv zerotier-static-${arch} build/zerotier && chmod +x build/zerotier" - sh 'CMAKE_ARGS="-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=RPM" make setup' + sh "CMAKE_ARGS=\"-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=${pkgFormat}\" make setup" dir("build") { sh 'make package -j4 VERBOSE=1' } @@ -368,7 +372,7 @@ def buildDebianNative() { def debian = ["debian-buster" , "debian-stretch", "debian-sid", "debian-bullseye"] def debianArchs = [] if (params.BUILD_ALL) { - debianArchs = ["s390x", "ppc64le", "i386", "armhf", "armel", "arm64", "amd64"] + debianArchs = ["ppc64le", "i386", "armhf", "armel", "arm64", "amd64"] } else { debianArchs = ["amd64", "i386"] } @@ -422,7 +426,7 @@ def buildDebianNative() { def ubuntu = ["ubuntu-bionic", "ubuntu-eoan"] def ubuntuArchs = [] if (params.BUILD_ALL == true) { - ubuntuArchs = ["i386", "amd64", "armhf", "arm64", "ppc64le", "s390x"] + ubuntuArchs = ["i386", "amd64", "armhf", "arm64", "ppc64le"] } else { ubuntuArchs = ["i386", "amd64"] } @@ -431,7 +435,7 @@ def buildDebianNative() { def ubuntuFocal = ["ubuntu-focal"] def ubuntuFocalArchs = [] if (params.BUILD_ALL == true) { - ubuntuFocalArchs = ["amd64", "arm64", "ppc64le", "s390x"] + ubuntuFocalArchs = ["amd64", "arm64", "ppc64le"] } else { ubuntuFocalArchs = ["amd64"] }