Unverified Commit 5e631a30 authored by Connor Baker's avatar Connor Baker Committed by GitHub
Browse files

zerotierone: 1.14.2 -> 1.16.0 (#448725)

parents b54936c1 80b8c01a
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
From f71d88a15f537cbc5ea80ad2922c013553a5caab Mon Sep 17 00:00:00 2001
From 1bc576196d82b801df4e52548808068c4cb9ab9e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
Date: Fri, 21 Jun 2024 14:43:03 +0200
Subject: [PATCH 2/2] darwin: disable link-time optimization
Subject: [PATCH 1/2] darwin: disable link-time optimization
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
@@ -15,18 +15,18 @@ Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/make-mac.mk b/make-mac.mk
index 7af200ad..b388c05a 100644
index e63fb7f88..3cf0be175 100644
--- a/make-mac.mk
+++ b/make-mac.mk
@@ -84,7 +84,7 @@ ifeq ($(ZT_DEBUG),1)
@@ -89,7 +89,7 @@ ifeq ($(ZT_DEBUG),1)
 node/Salsa20.o node/SHA512.o node/C25519.o node/Poly1305.o: CFLAGS = -Wall -O2 -g $(INCLUDES) $(DEFS)
 else
 	CFLAGS?=-Ofast -fstack-protector-strong
 	CFLAGS?=-O3 -fstack-protector-strong
-	CFLAGS+=$(ARCH_FLAGS) -Wall -flto -fPIE -mmacosx-version-min=$(MACOS_VERSION_MIN) -DNDEBUG -Wno-unused-private-field $(INCLUDES) $(DEFS)
+	CFLAGS+=$(ARCH_FLAGS) -Wall -fPIE -mmacosx-version-min=$(MACOS_VERSION_MIN) -DNDEBUG -Wno-unused-private-field $(INCLUDES) $(DEFS)
 	STRIP=strip
 	EXTRA_CARGO_FLAGS=--release
 	RUST_VARIANT=release
-- 
2.44.1
2.51.0
+0 −24
Original line number Diff line number Diff line
From b83e6354de099860bcb1ca3876c222c57de89f0c Mon Sep 17 00:00:00 2001
From: Michael Hoang <enzime@users.noreply.github.com>
Date: Mon, 10 Feb 2025 18:03:12 +0700
Subject: [PATCH] rustfsm: remove unsupported `lints.workspace`

This patch will no longer be necessary when
https://github.com/NixOS/nixpkgs/pull/300532 is merged
---
 fsm/Cargo.toml | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fsm/Cargo.toml b/fsm/Cargo.toml
index 5e9e1c9..3fda704 100644
--- a/fsm/Cargo.toml
+++ b/fsm/Cargo.toml
@@ -17,5 +17,3 @@ rustfsm_trait = { version = "0.1", path = "rustfsm_trait" }
 [package.metadata.workspaces]
 independent = true
 
-[lints]
-workspace = true
-- 
2.46.0
+52 −0
Original line number Diff line number Diff line
From 5c6f3e6c8c33e23b8bb3fe39b9ce26495724af09 Mon Sep 17 00:00:00 2001
From: Daniel Fullmer <danielrf12@gmail.com>
Date: Sat, 4 Oct 2025 19:27:19 -0700
Subject: [PATCH 2/2] Support single arch builds on macOS

Co-Authored-By: Michael Hoang <enzime@users.noreply.github.com>
---
 make-mac.mk | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/make-mac.mk b/make-mac.mk
index 3cf0be175..8da630e90 100644
--- a/make-mac.mk
+++ b/make-mac.mk
@@ -5,7 +5,8 @@ TOPDIR=$(shell pwd)
 INCLUDES=-I$(shell pwd)/rustybits/target -isystem $(TOPDIR)/ext  -I$(TOPDIR)/ext/prometheus-cpp-lite-1.0/core/include -I$(TOPDIR)/ext-prometheus-cpp-lite-1.0/3rdparty/http-client-lite/include -I$(TOPDIR)/ext/prometheus-cpp-lite-1.0/simpleapi/include
 DEFS=
 LIBS=
-ARCH_FLAGS=-arch x86_64 -arch arm64
+ARCH := x86_64 arm64
+ARCH_FLAGS=$(addprefix -arch ,$(ARCH))
 
 CODESIGN=echo
 PRODUCTSIGN=echo
@@ -79,6 +80,7 @@ endif
 # Debug mode -- dump trace output, build binary with -g
 ifeq ($(ZT_DEBUG),1)
 	ZT_TRACE=1
+	ARCH=
 	ARCH_FLAGS=
 	CFLAGS+=-Wall -g $(INCLUDES) $(DEFS) $(ARCH_FLAGS)
 	STRIP=echo
@@ -156,12 +158,12 @@ rustybits/target/libsmeeclient.a:	FORCE
 endif
 
 rustybits/target/libzeroidc.a:	FORCE
-	cd rustybits && MACOSX_DEPLOYMENT_TARGET=$(MACOS_VERSION_MIN) cargo build -p zeroidc --target=x86_64-apple-darwin $(EXTRA_CARGO_FLAGS)
-	cd rustybits && MACOSX_DEPLOYMENT_TARGET=$(MACOS_VERSION_MIN) cargo build -p zeroidc --target=aarch64-apple-darwin $(EXTRA_CARGO_FLAGS)
-	cd rustybits && lipo -create target/x86_64-apple-darwin/$(RUST_VARIANT)/libzeroidc.a target/aarch64-apple-darwin/$(RUST_VARIANT)/libzeroidc.a -output target/libzeroidc.a
+	if [[ "$(ARCH)" == *"x86_64"* ]]; then cd rustybits && MACOSX_DEPLOYMENT_TARGET=$(MACOS_VERSION_MIN) cargo build -p zeroidc --target=x86_64-apple-darwin $(EXTRA_CARGO_FLAGS); fi
+	if [[ "$(ARCH)" == *"arm64"* ]]; then cd rustybits && MACOSX_DEPLOYMENT_TARGET=$(MACOS_VERSION_MIN) cargo build -p zeroidc --target=aarch64-apple-darwin $(EXTRA_CARGO_FLAGS); fi
+	cd rustybits && lipo -create target/*/$(RUST_VARIANT)/libzeroidc.a -output target/libzeroidc.a
 
 central-controller:
-	make ARCH_FLAGS="-arch x86_64" ZT_CONTROLLER=1 one
+	make ARCH=x86_64 ZT_CONTROLLER=1 one
 
 zerotier-idtool: one
 
-- 
2.51.0
+13 −18
Original line number Diff line number Diff line
@@ -12,18 +12,20 @@
  rustc,
  zlib,
  libiconv,
  fetchpatch,
  # enableUnfree enables building the zerotier controller, which is subject to
  # a source-available license that permits non-commercial use
  enableUnfree ? false,
}:

let
  pname = "zerotierone";
  version = "1.14.2";
  version = "1.16.0";

  src = fetchFromGitHub {
    owner = "zerotier";
    repo = "ZeroTierOne";
    tag = version;
    hash = "sha256-D+7/ja5uYzH1iNd+Ti3k+dWOf5GvN4U+GuVBA9gxtTc=";
    hash = "sha256-bFfRz695sbdZJd5DIfF7j8lbEqWHSaIqHq/AfXZgZ4s=";
  };

in
@@ -33,23 +35,13 @@ stdenv.mkDerivation {
  cargoDeps = rustPlatform.fetchCargoVendor {
    inherit src;
    sourceRoot = "${src.name}/rustybits";
    hash = "sha256-CSpm4zBWKhcrM/KXGU6/51NSQ6hzpT44D2J+QETBtpQ=";

    # REMOVEME when https://github.com/NixOS/nixpkgs/pull/300532 is merged
    postBuild = ''
      pushd $out/git/730aadcc02767ae630e88f8f8c788a85d6bc81e6
      patch --verbose -p1 <${./0001-rustfsm-remove-unsupported-lints.workspace.patch}
      popd
    '';
    hash = "sha256-u3gqETbn4I+mtUeSkSym4s+qhA3eDb4Qaq7bl58M+AY=";
  };

  patches = [
    ./0001-darwin-disable-link-time-optimization.patch
    # https://github.com/zerotier/ZeroTierOne/pull/2435
    (fetchpatch {
      url = "https://github.com/zerotier/ZeroTierOne/commit/8f56d484b681ea30cd28e19cab34499acfa6e64d.patch";
      hash = "sha256-UplkX2O4o8XKKTlR3ZsSG9E0y5gVhAagyepqwyGEYmA=";
    })
    ./0002-Support-single-arch-builds-on-macOS.patch
  ];

  postPatch = ''
@@ -112,9 +104,12 @@ stdenv.mkDerivation {
  buildFlags = [
    "all"
    "selftest"
  ];
  ]
  ++ lib.optional enableUnfree "ZT_NONFREE=1";

  # darwin: disabled due to a test which fails to bind to 127.0.0.1 in a sandbox.
  doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform && !stdenv.hostPlatform.isDarwin;

  doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
  checkPhase = ''
    runHook preCheck
    ./zerotier-selftest
@@ -147,7 +142,7 @@ stdenv.mkDerivation {
  meta = with lib; {
    description = "Create flat virtual Ethernet networks of almost unlimited size";
    homepage = "https://www.zerotier.com";
    license = licenses.bsl11;
    license = if enableUnfree then licenses.unfree else licenses.mpl20;
    maintainers = with maintainers; [
      sjmackenzie
      zimbatm