mirror of
https://github.com/aiclientproxy/proxycast.git
synced 2026-09-24 23:10:56 +08:00
fix: 使用原生 ARM64 runner 修复 Linux ARM64 构建
- 将 Linux ARM64 平台从 ubuntu-22.04 改为 ubuntu-22.04-arm - 简化 Linux 依赖安装步骤,移除交叉编译配置 - 修复测试文件编译错误 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -32,7 +32,8 @@ jobs:
|
||||
- platform: ubuntu-22.04
|
||||
target: x86_64-unknown-linux-gnu
|
||||
name: Linux-x64
|
||||
- platform: ubuntu-22.04
|
||||
# 使用原生 ARM64 runner 而非交叉编译
|
||||
- platform: ubuntu-22.04-arm
|
||||
target: aarch64-unknown-linux-gnu
|
||||
name: Linux-arm64
|
||||
|
||||
@@ -48,39 +49,12 @@ jobs:
|
||||
node-version: '20'
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install Linux dependencies (x64)
|
||||
if: matrix.platform == 'ubuntu-22.04' && matrix.target == 'x86_64-unknown-linux-gnu'
|
||||
- name: Install Linux dependencies
|
||||
if: startsWith(matrix.platform, 'ubuntu')
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
|
||||
|
||||
- name: Install Linux ARM64 cross-compilation dependencies
|
||||
if: matrix.platform == 'ubuntu-22.04' && matrix.target == 'aarch64-unknown-linux-gnu'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
|
||||
|
||||
# 添加 ARM64 架构支持
|
||||
sudo dpkg --add-architecture arm64
|
||||
sudo apt-get update
|
||||
|
||||
# 安装 ARM64 系统库
|
||||
sudo apt-get install -y \
|
||||
libwebkit2gtk-4.1-dev:arm64 \
|
||||
libappindicator3-dev:arm64 \
|
||||
librsvg2-dev:arm64 \
|
||||
libssl-dev:arm64 \
|
||||
libgtk-3-dev:arm64
|
||||
|
||||
# 设置 PKG_CONFIG 环境变量
|
||||
echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
|
||||
echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV
|
||||
|
||||
# 设置 Cargo 环境变量
|
||||
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
|
||||
echo "CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
|
||||
echo "CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++" >> $GITHUB_ENV
|
||||
|
||||
- name: Setup Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
//! 测试 AsterClient 的序列化、反序列化和 URL 格式
|
||||
|
||||
use proxycast_lib::agent::{
|
||||
AsterClient, ChatRequest, ChatResponse, CreateAgentData, CreateAgentRequest,
|
||||
CreateAgentResponse, ModelConfig, SendToAgentRequest, SendToAgentResponse,
|
||||
AsterClient, ChatRequest, ChatResponse, CreateAgentRequest, CreateAgentResponse, ModelConfig,
|
||||
SendToAgentRequest, SendToAgentResponse,
|
||||
};
|
||||
|
||||
#[test]
|
||||
@@ -79,7 +79,8 @@ fn test_chat_request_serialization() {
|
||||
|
||||
let request = ChatRequest {
|
||||
template_id: "chat".to_string(),
|
||||
input: "Hello, world!".to_string(),
|
||||
input: Some("Hello, world!".to_string()),
|
||||
images: None,
|
||||
model_config: Some(config),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user