update rust to 1.93 (#1865)

This commit is contained in:
KKRainbow
2026-02-04 09:48:43 +08:00
committed by GitHub
parent aebb7facfa
commit c58140fb47
12 changed files with 81 additions and 82 deletions
+3 -3
View File
@@ -186,7 +186,7 @@ jobs:
fi fi
if [[ $OS =~ ^ubuntu.*$ && $TARGET =~ ^mips.*$ ]]; then if [[ $OS =~ ^ubuntu.*$ && $TARGET =~ ^mips.*$ ]]; then
cargo +nightly-2025-09-01 build -r --target $TARGET -Z build-std=std,panic_abort --package=easytier --features=jemalloc cargo +nightly-2026-02-02 build -r --target $TARGET -Z build-std=std,panic_abort --package=easytier --features=jemalloc
else else
if [[ $OS =~ ^windows.*$ ]]; then if [[ $OS =~ ^windows.*$ ]]; then
SUFFIX=.exe SUFFIX=.exe
@@ -228,8 +228,8 @@ jobs:
rustup set auto-self-update disable rustup set auto-self-update disable
rustup install 1.89 rustup install 1.93
rustup default 1.89 rustup default 1.93
export CC=clang export CC=clang
export CXX=clang++ export CXX=clang++
+4 -4
View File
@@ -31,8 +31,8 @@ fi
# see https://github.com/rust-lang/rustup/issues/3709 # see https://github.com/rust-lang/rustup/issues/3709
rustup set auto-self-update disable rustup set auto-self-update disable
rustup install 1.89 rustup install 1.93
rustup default 1.89 rustup default 1.93
# mips/mipsel cannot add target from rustup, need compile by ourselves # mips/mipsel cannot add target from rustup, need compile by ourselves
if [[ $OS =~ ^ubuntu.*$ && $TARGET =~ ^mips.*$ ]]; then if [[ $OS =~ ^ubuntu.*$ && $TARGET =~ ^mips.*$ ]]; then
@@ -44,8 +44,8 @@ if [[ $OS =~ ^ubuntu.*$ && $TARGET =~ ^mips.*$ ]]; then
ar x libgcc.a _ctzsi2.o _clz.o _bswapsi2.o ar x libgcc.a _ctzsi2.o _clz.o _bswapsi2.o
ar rcs libctz.a _ctzsi2.o _clz.o _bswapsi2.o ar rcs libctz.a _ctzsi2.o _clz.o _bswapsi2.o
rustup toolchain install nightly-2025-09-01-x86_64-unknown-linux-gnu rustup toolchain install nightly-2026-02-02-x86_64-unknown-linux-gnu
rustup component add rust-src --toolchain nightly-2025-09-01-x86_64-unknown-linux-gnu rustup component add rust-src --toolchain nightly-2026-02-02-x86_64-unknown-linux-gnu
# https://github.com/rust-lang/rust/issues/128808 # https://github.com/rust-lang/rust/issues/128808
# remove it after Cargo or rustc fix this. # remove it after Cargo or rustc fix this.
+3 -3
View File
@@ -26,7 +26,7 @@ Thank you for your interest in contributing to EasyTier! This document provides
#### Required Tools #### Required Tools
- Node.js v21 or higher - Node.js v21 or higher
- pnpm v9 or higher - pnpm v9 or higher
- Rust toolchain (version 1.89) - Rust toolchain (version 1.93)
- LLVM and Clang - LLVM and Clang
- Protoc (Protocol Buffers compiler) - Protoc (Protocol Buffers compiler)
@@ -79,8 +79,8 @@ sudo apt install -y bridge-utils
2. Install dependencies: 2. Install dependencies:
```bash ```bash
# Install Rust toolchain # Install Rust toolchain
rustup install 1.89 rustup install 1.93
rustup default 1.89 rustup default 1.93
# Install project dependencies # Install project dependencies
pnpm -r install pnpm -r install
+3 -3
View File
@@ -34,7 +34,7 @@
#### 必需工具 #### 必需工具
- Node.js v21 或更高版本 - Node.js v21 或更高版本
- pnpm v9 或更高版本 - pnpm v9 或更高版本
- Rust 工具链(版本 1.89 - Rust 工具链(版本 1.93
- LLVM 和 Clang - LLVM 和 Clang
- ProtocProtocol Buffers 编译器) - ProtocProtocol Buffers 编译器)
@@ -87,8 +87,8 @@ sudo apt install -y bridge-utils
2. 安装依赖: 2. 安装依赖:
```bash ```bash
# 安装 Rust 工具链 # 安装 Rust 工具链
rustup install 1.89 rustup install 1.93
rustup default 1.89 rustup default 1.93
# 安装项目依赖 # 安装项目依赖
pnpm -r install pnpm -r install
+1 -1
View File
@@ -8,7 +8,7 @@ repository = "https://github.com/EasyTier/EasyTier"
authors = ["kkrainbow"] authors = ["kkrainbow"]
keywords = ["vpn", "p2p", "network", "easytier"] keywords = ["vpn", "p2p", "network", "easytier"]
categories = ["network-programming", "command-line-utilities"] categories = ["network-programming", "command-line-utilities"]
rust-version = "1.89.0" rust-version = "1.93.0"
license-file = "LICENSE" license-file = "LICENSE"
readme = "README.md" readme = "README.md"
+1 -1
View File
@@ -8,7 +8,7 @@ edition = "2021"
authors = ["kkrainbow"] authors = ["kkrainbow"]
keywords = ["vpn", "p2p", "network", "easytier"] keywords = ["vpn", "p2p", "network", "easytier"]
categories = ["network-programming", "command-line-utilities"] categories = ["network-programming", "command-line-utilities"]
rust-version = "1.89.0" rust-version = "1.93.0"
license-file = "LICENSE" license-file = "LICENSE"
readme = "README.md" readme = "README.md"
+7 -6
View File
@@ -636,12 +636,13 @@ impl ConfigLoader for TomlConfigLoader {
fn get_id(&self) -> uuid::Uuid { fn get_id(&self) -> uuid::Uuid {
let mut locked_config = self.config.lock().unwrap(); let mut locked_config = self.config.lock().unwrap();
if locked_config.instance_id.is_none() { match locked_config.instance_id {
let id = uuid::Uuid::new_v4(); Some(id) => id,
locked_config.instance_id = Some(id); None => {
id let id = uuid::Uuid::new_v4();
} else { locked_config.instance_id = Some(id);
*locked_config.instance_id.as_ref().unwrap() id
}
} }
} }
+8 -10
View File
@@ -484,18 +484,14 @@ impl StunNatTypeDetectResult {
if self.public_ips().len() != 1 if self.public_ips().len() != 1
|| self.usable_stun_resp_count() <= 1 || self.usable_stun_resp_count() <= 1
|| self.max_port() - self.min_port() > 15 || self.max_port() - self.min_port() > 15
|| self.extra_bind_test.is_none()
|| self
.extra_bind_test
.as_ref()
.unwrap()
.mapped_socket_addr
.is_none()
{ {
NatType::Symmetric NatType::Symmetric
} else { } else if let Some(extra_bind_mapped) = self
let extra_bind_test = self.extra_bind_test.as_ref().unwrap(); .extra_bind_test
let extra_port = extra_bind_test.mapped_socket_addr.unwrap().port(); .as_ref()
.and_then(|extra| extra.mapped_socket_addr)
{
let extra_port = extra_bind_mapped.port();
let max_port_diff = extra_port.saturating_sub(self.max_port()); let max_port_diff = extra_port.saturating_sub(self.max_port());
let min_port_diff = self.min_port().saturating_sub(extra_port); let min_port_diff = self.min_port().saturating_sub(extra_port);
@@ -506,6 +502,8 @@ impl StunNatTypeDetectResult {
} else { } else {
NatType::Symmetric NatType::Symmetric
} }
} else {
NatType::Symmetric
} }
} else { } else {
NatType::Unknown NatType::Unknown
+3 -6
View File
@@ -1377,12 +1377,9 @@ impl PeerManager {
.config .config
.get_proxy_cidrs() .get_proxy_cidrs()
.into_iter() .into_iter()
.map(|x| { .map(|x| match x.mapped_cidr {
if x.mapped_cidr.is_none() { None => x.cidr.to_string(),
x.cidr.to_string() Some(mapped) => format!("{}->{}", x.cidr, mapped),
} else {
format!("{}->{}", x.cidr, x.mapped_cidr.unwrap())
}
}) })
.collect(), .collect(),
hostname: self.global_ctx.get_hostname(), hostname: self.global_ctx.get_hostname(),
+45 -44
View File
@@ -2214,54 +2214,55 @@ impl PeerRouteServiceImpl {
ret, sync_route_info_req, session, self.global_ctx.network, next_last_sync_succ_timestamp ret, sync_route_info_req, session, self.global_ctx.network, next_last_sync_succ_timestamp
); );
if let Err(e) = &ret { match ret.as_ref() {
tracing::error!( Err(e) => {
?ret, tracing::error!(
?my_peer_id, ?ret,
?dst_peer_id, ?my_peer_id,
?e, ?dst_peer_id,
"sync_route_info failed" ?e,
); "sync_route_info failed"
session );
.need_sync_initiator_info session
.store(true, Ordering::Relaxed); .need_sync_initiator_info
} else { .store(true, Ordering::Relaxed);
let resp = ret.as_ref().unwrap(); }
if resp.error.is_some() { Ok(resp) => {
let err = resp.error.unwrap(); if let Some(err) = resp.error {
if err == Error::DuplicatePeerId as i32 { if err == Error::DuplicatePeerId as i32 {
if !self.global_ctx.get_feature_flags().is_public_server { if !self.global_ctx.get_feature_flags().is_public_server {
panic!("duplicate peer id"); panic!("duplicate peer id");
}
} else {
tracing::error!(?ret, ?my_peer_id, ?dst_peer_id, "sync_route_info failed");
session
.need_sync_initiator_info
.store(true, Ordering::Relaxed);
} }
} else { } else {
tracing::error!(?ret, ?my_peer_id, ?dst_peer_id, "sync_route_info failed"); session.rpc_tx_count.fetch_add(1, Ordering::Relaxed);
session session
.need_sync_initiator_info .dst_is_initiator
.store(true, Ordering::Relaxed); .store(resp.is_initiator, Ordering::Relaxed);
session.update_dst_session_id(resp.session_id);
if let Some(peer_infos) = &peer_infos {
session.update_dst_saved_peer_info_version(peer_infos, dst_peer_id);
}
if let Some(conn_info) = &conn_info {
session.update_dst_saved_conn_info_version(conn_info, dst_peer_id);
}
if let Some(foreign_network) = &foreign_network {
session
.update_dst_saved_foreign_network_version(foreign_network, dst_peer_id);
}
session.update_last_sync_succ_timestamp(next_last_sync_succ_timestamp);
} }
} else {
session.rpc_tx_count.fetch_add(1, Ordering::Relaxed);
session
.dst_is_initiator
.store(resp.is_initiator, Ordering::Relaxed);
session.update_dst_session_id(resp.session_id);
if let Some(peer_infos) = &peer_infos {
session.update_dst_saved_peer_info_version(peer_infos, dst_peer_id);
}
// Update session saved versions based on the connection info format used
if let Some(conn_info) = &conn_info {
session.update_dst_saved_conn_info_version(conn_info, dst_peer_id);
}
if let Some(foreign_network) = &foreign_network {
session.update_dst_saved_foreign_network_version(foreign_network, dst_peer_id);
}
session.update_last_sync_succ_timestamp(next_last_sync_succ_timestamp);
} }
} }
false false
+1 -1
View File
@@ -29,7 +29,7 @@
allowUnfree = true; allowUnfree = true;
}; };
}; };
rustVersion = "1.89.0"; rustVersion = "1.93.0";
makeRust = makeRust =
features: features:
let let
+2
View File
@@ -1,3 +1,5 @@
#![allow(dead_code)]
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
#[derive(Debug, Deserialize, Serialize)] #[derive(Debug, Deserialize, Serialize)]