From 432fcb3fc356986867dfd8482f33873c683caca9 Mon Sep 17 00:00:00 2001 From: Mg Pig Date: Sat, 18 Apr 2026 09:06:45 +0800 Subject: [PATCH 1/2] build(nix): add mold to the flake dev shell (#2122) --- .github/workflows/nix.yml | 10 +++++++++- flake.nix | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 4590f6d7..75e1696a 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -6,12 +6,14 @@ on: paths: - "**/*.nix" - "flake.lock" + - "rust-toolchain.toml" pull_request: branches: ["main", "develop"] types: [opened, synchronize, reopened, ready_for_review] paths: - "**/*.nix" - "flake.lock" + - "rust-toolchain.toml" concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -32,5 +34,11 @@ jobs: - name: Magic Nix Cache uses: DeterminateSystems/magic-nix-cache-action@v6 - - name: Check full devShell + - name: Warm up full devShell run: nix develop .#full --command true + + - name: Cargo check in flake environment + run: nix develop .#full --command cargo check + + - name: Cargo build in flake environment + run: nix develop .#full --command cargo build diff --git a/flake.nix b/flake.nix index c33ab483..81650da5 100644 --- a/flake.nix +++ b/flake.nix @@ -67,6 +67,7 @@ rust protobuf clang + mold pkg-config bridge-utils # for three node test ] @@ -98,6 +99,10 @@ KCP_SYS_EXTRA_HEADER_PATH = "${pkgs.libclang.lib}/lib/clang/19/include:${pkgs.glibc.dev}/include"; JEMALLOC_OVERRIDE = "${pkgs.jemalloc}/lib/libjemalloc.so"; } + // pkgs.lib.optionalAttrs pkgs.stdenv.isLinux { + CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER = "clang"; + CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER = "clang"; + } // (if hasFeature "android" then android.envVars else { })); in { From 84430055ab0531aee691c6225f97da45cfa7eddf Mon Sep 17 00:00:00 2001 From: Luna Yao <40349250+ZnqbuZ@users.noreply.github.com> Date: Sat, 18 Apr 2026 05:06:34 +0200 Subject: [PATCH 2/2] remove hashbrown (#2108) --- easytier/Cargo.toml | 1 - easytier/src/peers/graph_algo.rs | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/easytier/Cargo.toml b/easytier/Cargo.toml index b08830c4..9e2d0789 100644 --- a/easytier/Cargo.toml +++ b/easytier/Cargo.toml @@ -165,7 +165,6 @@ network-interface = "2.0" # for ospf route petgraph = "0.8.1" -hashbrown = "0.15.3" ordered_hash_map = "0.5.0" # for wireguard diff --git a/easytier/src/peers/graph_algo.rs b/easytier/src/peers/graph_algo.rs index 63d1d6c9..333bcf5c 100644 --- a/easytier/src/peers/graph_algo.rs +++ b/easytier/src/peers/graph_algo.rs @@ -1,12 +1,10 @@ use core::cmp::Ordering; -use hashbrown::hash_map::{ - Entry::{Occupied, Vacant}, - HashMap, -}; use petgraph::{ algo::Measure, - visit::{EdgeRef as _, IntoEdges, VisitMap as _, Visitable}, + visit::{EdgeRef, IntoEdges, VisitMap, Visitable}, }; +use std::collections::HashMap; +use std::collections::hash_map::Entry::{Occupied, Vacant}; use std::{collections::BinaryHeap, hash::Hash}; /// `MinScored` holds a score `K` and a scored object `T` in