revert(agc): 撤掉 Rust warning 门禁的 Werror 接线(AGC deny(warnings) + 各 crate 的 [lints])
按决策:不再用编译器把告警变成错误(`deny(warnings)`/`-D warnings`),改为「本地 pre-push + CI 的
基线感知 warning check」(见下一个提交)。本提交只做撤销,不引入新机制。
- revert 9fbab1a92:删掉 `apps/ai-game-creator-shell/src-tauri/src/main.rs` 顶部的
`#![cfg_attr(all(not(test), windows), deny(warnings))]` 及其 9 行说明注释(含 3673f6f92 之后的收窄版本)。
- revert c1ad1a19f:删掉 `server-rs/Cargo.toml` 的 `[workspace.lints.rust] warnings = "deny"`、
27 个成员 crate 的 `[lints] workspace = true`、4 个被 exclude 的独立 crate 与
`apps/desktop-shell/src-tauri`、三个编辑器 bridge 各自的 `[lints.rust] warnings = "deny"`。
**保留**该提交里与门禁无关的清理:`server-rs/crates/api-server/src/llm/mod.rs` 中零引用的
`TEST_AGC_MODEL_DEFAULT_ID`(revert 会把它恢复出来,这里重新删掉,避免新增一条告警)。
- revert 296502333:撤回两处「为让 deny 下的 Linux CI 变绿」而做的 cfg 收窄
(godot `verified_module_path` 的 `#[cfg(any(windows, test))]`、unity `tests/protocol.rs` 的
Windows-only import/helper 的 `#[cfg(all(windows, target_arch = "x86_64"))]`)——它们只服务于 Werror,
撤销后这些文件回到 master 状态,多出来的 Linux 侧告警由基线覆盖。
验证(Windows,取数前 `cargo clean -p genarrative-ai-game-creator-shell`):
- AGC 壳生产口径 bin:EXIT 0 / **14 条告警**(就是上游 `b04aceb57` 等引入的那批,已入册基线);
- `server-rs --workspace --all-targets`:EXIT 0 / 0 告警;
- tip 上 `git grep -n 'deny(warnings)'` 仅剩文档里的历史说明。
This commit is contained in:
@@ -1,13 +1,4 @@
|
||||
#![cfg_attr(all(not(dev), target_os = "windows"), windows_subsystem = "windows")]
|
||||
// AGC 壳的 warning 门禁只作用于「生产口径 + Windows 交付平台」:
|
||||
// - `cfg(not(test))`:`cargo check`(不带 `--all-targets`)与发布构建把 first-party warning 当错误;test harness
|
||||
// 实例不受影响——同一个 bin target 在 `--all-targets` 下会被编第二次,其中 `#[cfg(not(test))] fn main()`
|
||||
// 被排除,`generate_handler!`/`desktop::run()` 链不可达,会产生一批属测试构建产物的假死告警。
|
||||
// - `cfg(windows)`:本壳交付面是 WebView2 / Windows;在 Linux 上大量 Windows 专用实现会被整块编掉
|
||||
// (acl_repair、Windows 策略路径、编辑器 RPC、process session bridge 等),它们留下的未用项是“编译剔除”
|
||||
// 的产物而不是废弃生产代码,不能当缺陷处理(本仓 CI 不在外部注入 RUSTFLAGS/-D warnings)。
|
||||
// 口径与基线见 dev 运维文档「Rust 编译告警门禁」。
|
||||
#![cfg_attr(all(not(test), windows), deny(warnings))]
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "../build_support/godot_bundle.rs"]
|
||||
|
||||
@@ -19,6 +19,3 @@ tauri-plugin-notification = "2.3.3"
|
||||
tauri-plugin-opener = "2.5.4"
|
||||
tauri-plugin-single-instance = { version = "2.4.2", features = ["deep-link"] }
|
||||
tauri-plugin-window-state = "2.4.1"
|
||||
|
||||
[lints.rust]
|
||||
warnings = "deny"
|
||||
|
||||
@@ -56,6 +56,3 @@ tungstenite = { version = "0.28", optional = true, default-features = false, fea
|
||||
|
||||
[build-dependencies]
|
||||
cc = "1"
|
||||
|
||||
[lints.rust]
|
||||
warnings = "deny"
|
||||
|
||||
@@ -17,6 +17,3 @@ tempfile = "3"
|
||||
windows-sys = { version = "0.61", features = ["Win32_Foundation", "Win32_System_Threading", "Win32_System_Diagnostics_ToolHelp", "Win32_System_ProcessStatus", "Win32_UI_WindowsAndMessaging", "Win32_UI_Shell", "Win32_System_Memory"] }
|
||||
|
||||
[workspace]
|
||||
|
||||
[lints.rust]
|
||||
warnings = "deny"
|
||||
|
||||
@@ -343,11 +343,6 @@ pub fn verify_dll_hash(path: &Path, expected: &str) -> Result<(), String> {
|
||||
}
|
||||
|
||||
/// Godot 4.7 的 Windows 编辑器 loader 只允许在同目录派生 ~ 前缀副本。
|
||||
///
|
||||
/// 库内只有 Windows 编辑器探测路径会调用它(`platform.rs` 的 `#[cfg(windows)]` 分支);
|
||||
/// 另由跨平台单测 `official_loader_copy_requires_exact_parent_and_trusted_bytes` 直接覆盖,
|
||||
/// 因此非 Windows 的库构建不编译它,避免 Linux 目标把它判成 dead code。
|
||||
#[cfg(any(windows, test))]
|
||||
pub fn verified_module_path(actual: &Path, descriptor: &Descriptor) -> Result<bool, String> {
|
||||
let key = |p: &Path| {
|
||||
p.to_string_lossy()
|
||||
|
||||
@@ -24,6 +24,3 @@ windows-sys = { version = "0.61", features = ["Win32_Foundation", "Win32_Securit
|
||||
tempfile = "3"
|
||||
|
||||
[workspace]
|
||||
|
||||
[lints.rust]
|
||||
warnings = "deny"
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#[cfg(all(windows, target_arch = "x86_64"))]
|
||||
use editor_adapter_api::EditorAdapter;
|
||||
use serde_json::json;
|
||||
use std::path::PathBuf;
|
||||
use std::time::{Duration, Instant};
|
||||
#[cfg(all(windows, target_arch = "x86_64"))]
|
||||
use unity_editor_bridge::{
|
||||
configure_helper_candidates, disconnect_unity_editor, execute_unity_editor_code_for_project,
|
||||
UnityEditorAdapter,
|
||||
@@ -27,7 +25,6 @@ fn fixture() -> (tempfile::TempDir, PathBuf) {
|
||||
(directory, executable)
|
||||
}
|
||||
|
||||
#[cfg(all(windows, target_arch = "x86_64"))]
|
||||
fn project() -> tempfile::TempDir {
|
||||
let directory = tempfile::tempdir().unwrap();
|
||||
for path in ["Assets", "Packages", "ProjectSettings"] {
|
||||
|
||||
@@ -42,11 +42,6 @@ members = [
|
||||
"crates/tests-support",
|
||||
]
|
||||
|
||||
# 门禁:workspace 内已清零 warning 的成员 crate 一律不许再引入。
|
||||
# 只影响被构建 crate 的 rustc 参数(--deny=warnings),不改 RUSTFLAGS,CI 编译缓存不受影响。
|
||||
[workspace.lints.rust]
|
||||
warnings = "deny"
|
||||
|
||||
[workspace.package]
|
||||
edition = "2024"
|
||||
version = "0.1.0"
|
||||
|
||||
@@ -8,6 +8,3 @@ publish = false
|
||||
[dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
|
||||
[lints.rust]
|
||||
warnings = "deny"
|
||||
|
||||
@@ -11,6 +11,3 @@ serde = { version = "1", features = ["derive"] }
|
||||
|
||||
[dev-dependencies]
|
||||
serde_json = "1"
|
||||
|
||||
[lints.rust]
|
||||
warnings = "deny"
|
||||
|
||||
@@ -69,6 +69,3 @@ png = { workspace = true }
|
||||
base64 = { workspace = true }
|
||||
http-body-util = { workspace = true }
|
||||
reqwest = { workspace = true, features = ["json", "multipart", "rustls-tls"] }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -9,6 +9,3 @@ description = "通用编辑器适配器契约,宿主与插件 native 模块共
|
||||
[dependencies]
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
|
||||
[lints.rust]
|
||||
warnings = "deny"
|
||||
|
||||
@@ -12,6 +12,3 @@ spacetime-types = ["dep:spacetimedb"]
|
||||
serde = { workspace = true }
|
||||
shared-kernel = { workspace = true }
|
||||
spacetimedb = { workspace = true, optional = true }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -16,6 +16,3 @@ reqwest = { workspace = true, features = ["rustls-tls"], optional = true }
|
||||
spacetimedb = { workspace = true, optional = true }
|
||||
platform-oss = { workspace = true, optional = true }
|
||||
shared-kernel = { workspace = true }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -20,6 +20,3 @@ tracing = { workspace = true, optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { workspace = true, features = ["macros", "rt"] }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -13,6 +13,3 @@ serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
shared-kernel = { workspace = true }
|
||||
spacetimedb = { workspace = true, optional = true }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -10,6 +10,3 @@ serde = { workspace = true }
|
||||
sha2 = { workspace = true }
|
||||
shared-kernel = { workspace = true }
|
||||
zip = { workspace = true, features = ["deflate"] }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -18,6 +18,3 @@ time = { workspace = true, features = ["formatting", "parsing"] }
|
||||
shared-contracts = { workspace = true }
|
||||
uuid = { workspace = true }
|
||||
url = { workspace = true }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -20,6 +20,3 @@ uuid = { workspace = true, features = ["v4"] }
|
||||
[dev-dependencies]
|
||||
serde = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -10,6 +10,3 @@ serde_json = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { workspace = true, features = ["macros", "rt", "time"] }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -20,6 +20,3 @@ tokio = { version = "1", features = ["time"], optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "1", features = ["macros", "rt", "time"] }
|
||||
|
||||
[lints.rust]
|
||||
warnings = "deny"
|
||||
|
||||
@@ -17,6 +17,3 @@ urlencoding = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
base64 = { workspace = true }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -23,6 +23,3 @@ urlencoding = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { workspace = true, features = ["macros", "rt"] }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -17,6 +17,3 @@ platform-audio = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { workspace = true, features = ["macros", "rt"] }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
@@ -12,6 +12,3 @@ shared-contracts = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { workspace = true, features = ["macros", "rt"] }
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user