mirror of
https://github.com/codewhale-hq/Codewhale.git
synced 2026-11-09 09:59:45 -10:00
chore(budgets): gate the Linux-only bwrap probe by cfg; record restore's stat
Pre-push budgets on the batch 7+8 head: - dead code 261 > 260: the bwrap probe and its verdict carried cfg_attr(not(linux), allow(dead_code)). The probe and its deadline are now cfg(linux, not ohos) like their only caller; the pure verdict is cfg(any(test, linux)) for its platform-neutral tests. Back to 259. - blocking calls: snapshot/repo.rs 19 > 18. The Windows transition check (ancestor_is_not_a_directory) stats ancestors inside restore, which is synchronous code already run under the repository write lock beside the file's 18 existing std::fs sites; the budget records it. --update also tightened files that are now clean (lib.rs, compaction/last_round.rs and the retired crates/mcp stdio client and test support). Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: CodeWhale Bot <[email protected]>
This commit is contained in:
1 parent
0989ccb307
commit
dcf3a9c29d
2 files changed
+5
-23
No files matched your search
@@ -604,15 +604,13 @@ fn no_wrapper_reason() -> String {
|
||||
|
||||
/// How long the bwrap probe may take. A working bwrap runs
|
||||
/// `<runtime> --version` in well under a second, even on a loaded CI runner.
|
||||
#[cfg(all(target_os = "linux", not(target_env = "ohos")))]
|
||||
const BWRAP_PROBE_DEADLINE: Duration = Duration::from_secs(10);
|
||||
|
||||
/// Run the finished bwrap wrapper around `<runtime> --version` (`command`),
|
||||
/// with no environment, to learn whether bwrap works on this host: it may be
|
||||
/// installed yet unable to create its namespaces. Blocking.
|
||||
#[cfg_attr(
|
||||
not(all(target_os = "linux", not(target_env = "ohos"))),
|
||||
allow(dead_code)
|
||||
)]
|
||||
#[cfg(all(target_os = "linux", not(target_env = "ohos")))]
|
||||
fn probe_bwrap(command: &[String], cwd: &Path) -> Result<(), String> {
|
||||
use std::io::Read as _;
|
||||
use wait_timeout::ChildExt as _;
|
||||
@@ -652,10 +650,7 @@ fn probe_bwrap(command: &[String], cwd: &Path) -> Result<(), String> {
|
||||
/// it ran, otherwise the reason `/plugin` and doctor show — bwrap's first
|
||||
/// line of stderr (or the exit status), and a hint when that line is about
|
||||
/// the user namespace bwrap could not create. Pure.
|
||||
#[cfg_attr(
|
||||
not(all(target_os = "linux", not(target_env = "ohos"))),
|
||||
allow(dead_code)
|
||||
)]
|
||||
#[cfg(any(test, all(target_os = "linux", not(target_env = "ohos"))))]
|
||||
fn bwrap_probe_verdict(succeeded: bool, status: &str, stderr: &str) -> Result<(), String> {
|
||||
if succeeded {
|
||||
return Ok(());
|
||||
|
||||
@@ -62,12 +62,6 @@
|
||||
"crates/localization/build.rs": {
|
||||
"std_fs": 3
|
||||
},
|
||||
"crates/mcp/src/stdio_client.rs": {
|
||||
"thread_sleep": 2
|
||||
},
|
||||
"crates/mcp/src/test_support.rs": {
|
||||
"std_fs": 3
|
||||
},
|
||||
"crates/memory/src/main.rs": {
|
||||
"std_fs": 1
|
||||
},
|
||||
@@ -151,9 +145,6 @@
|
||||
"crates/tui/src/commands/user_registry.rs": {
|
||||
"std_fs": 2
|
||||
},
|
||||
"crates/tui/src/compaction/last_round.rs": {
|
||||
"std_fs": 1
|
||||
},
|
||||
"crates/tui/src/composer_history.rs": {
|
||||
"thread_sleep": 1
|
||||
},
|
||||
@@ -253,10 +244,6 @@
|
||||
"crates/tui/src/integrations/dsh/receipt.rs": {
|
||||
"std_fs": 5
|
||||
},
|
||||
"crates/tui/src/lib.rs": {
|
||||
"path_canonicalize": 2,
|
||||
"std_fs": 42
|
||||
},
|
||||
"crates/tui/src/mcp.rs": {
|
||||
"std_fs": 1
|
||||
},
|
||||
@@ -403,7 +390,7 @@
|
||||
},
|
||||
"crates/tui/src/snapshot/repo.rs": {
|
||||
"path_canonicalize": 4,
|
||||
"std_fs": 18,
|
||||
"std_fs": 19,
|
||||
"thread_sleep": 1
|
||||
},
|
||||
"crates/tui/src/tools/git.rs": {
|
||||
@@ -587,7 +574,7 @@
|
||||
"path_canonicalize": 2
|
||||
},
|
||||
"crates/tui/src/voice.rs": {
|
||||
"std_fs": 6
|
||||
"std_fs": 3
|
||||
},
|
||||
"crates/tui/src/working_set.rs": {
|
||||
"path_canonicalize": 1,
|
||||
|
||||
Reference in new issue
Block a user