From 17eb51e21596f2adbdd454a782b91dbd1ca511fa Mon Sep 17 00:00:00 2001 From: Matrix Music Bot Dev Date: Thu, 2 Jul 2026 01:25:33 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E5=88=9D=E5=A7=8B=E5=8C=96=20Cargo=20?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=AA=A8=E6=9E=B6=E4=B8=8E=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 工具链:rustup + stable-x86_64-pc-windows-gnu + MinGW gcc 链接器 包含内容: - Cargo.toml(edition 2024,name=matrix-music-bot) - Cargo.lock(dev profile 验证通过) - src/main.rs(hello world 占位,已 cargo build 通过) - .cargo/config.toml(项目级 cargo 配置,指定 MinGW gcc 为链接器) - .gitignore 增补:排除项目根的 plan 副本(正式版在 ~/.claude/plans/) 构建验证:cargo build 在 MinGW gcc 链接器下成功完成(1.56s) 后续 M1.2 将添加:clap(CLI 解析)+ serde/toml(配置文件)+ thiserror/anyhow + tracing(日志)+ tokio(async)+ matrix-sdk(含 E2EE crypto 与 UI timeline) --- .cargo/config.toml | 16 ++++++++++++++++ .gitignore | 9 ++++++++- Cargo.lock | 7 +++++++ Cargo.toml | 6 ++++++ src/main.rs | 3 +++ 5 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .cargo/config.toml create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 src/main.rs diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..1b40f30 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,16 @@ +# Project-local cargo config for matrix-music-bot +# Forces MinGW gcc as the C linker (works with rustls + pure-Rust deps) + +[target.x86_64-pc-windows-gnu] +linker = "C:/msys64/mingw64/bin/gcc.exe" +ar = "C:/msys64/mingw64/bin/ar.exe" + +[build] +# Default target to GNU (avoids accidentally building MSVC) +target = "x86_64-pc-windows-gnu" + +[net] +git-fetch-with-cli = true + +# Note: 如果在国内且 crates.io 慢,可在 Cargo.toml 用 [patch] / [source.crates-io] +# 替换为镜像,或设置环境变量 CARGO_NET_GIT_FETCH_WITH_CLI=true \ No newline at end of file diff --git a/.gitignore b/.gitignore index 108a39a..0a02ef1 100644 --- a/.gitignore +++ b/.gitignore @@ -30,4 +30,11 @@ Thumbs.db logs/ # Cache -.cache/ \ No newline at end of file +.cache/ + +# 重复的 plan 副本(正式版在 C:\Users\Administrator\.claude\plans\) +/lexical-meandering-lighthouse.md + +# Added by cargo + +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..9ead937 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "matrix-music-bot" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..9acaa3c --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "matrix-music-bot" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}