fix(agc): 修 lane B 评审的两处必修项

1. 非 Windows 目标会 E0425:main.rs 去掉 `use command_sandbox::*;` 后,
   command_exec.rs 在 `#[cfg(target_os = "linux")]` 块里裸名使用的
   prepare_command_sandbox_launch / stage_command_sandbox_launch /
   CommandSandboxLaunch / command_sandbox_platform_metadata 失去来源
   (command_exec.rs 靠 `use super::*` 继承 main.rs 的 glob)。改为在
   command_exec.rs 顶部显式 `#[cfg(target_os = "linux")] use crate::command_sandbox::{...}`,
   Windows 口径下不引入新的 unused import。已核对这是全部裸名使用点:
   trampoline/process_session_bridge 均为全限定或自带 import。

2. src/runner/tests.rs 的 `use crate::{unix_timestamp, ProcessSessionRecord};`
   两个名字在文件内各只在 import 行出现一次,整行删除(warning 已消失);
   lane B 已删 ProcessSessionRecord 本体,保留该名字合并后会 E0432。

实测:bin 与 --all-targets 两口径 cargo check 均 EXIT=0;领地 bin 21(不变)、
--all-targets 346→345。Linux 目标本机无法编译验证(缺少 GTK sysroot,
glib-sys/gobject-sys/gio-sys 的 pkg-config 交叉编译失败,与本改动无关),
第 1 项按"显式 import 覆盖全部 4 个裸名"构造性验证。
This commit is contained in:
2026-10-06 16:59:21 +08:00
parent 6621bbad97
commit 3a97ce6b13
2 changed files with 5 additions and 2 deletions
@@ -6,6 +6,11 @@ use std::process::Stdio;
use std::sync::atomic::Ordering;
use tokio::io::AsyncReadExt;
#[cfg(target_os = "linux")]
use crate::command_sandbox::{
command_sandbox_platform_metadata, prepare_command_sandbox_launch, stage_command_sandbox_launch,
CommandSandboxLaunch,
};
#[cfg(target_os = "linux")]
use crate::command_sandbox_trampoline::{LaunchGate, TargetExecState, TargetTerminalState};
@@ -12,8 +12,6 @@ use std::sync::atomic::{AtomicU64, AtomicUsize, Ordering};
use std::sync::{mpsc, Arc, Barrier, Mutex};
use std::time::{Duration, Instant};
use crate::{unix_timestamp, ProcessSessionRecord};
static TEST_DIRECTORY_COUNTER: AtomicU64 = AtomicU64::new(0);
#[test]