summaryrefslogtreecommitdiffstats
path: root/src/sandbox
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-21 15:50:41 +0000
committeraur-build <aur-build@localhost>2026-11-21 15:50:41 +0000
commitf5d970494f77d39dadf7c7d5a6a3d70221ca2da2 (patch)
tree13c9943c6e3740e1f829d038f48418097f05da04 /src/sandbox
parent92742f0e5d336547d8d72464e2df0ff1c4f2d337 (diff)
downloadaur-build-f5d970494f77d39dadf7c7d5a6a3d70221ca2da2.tar.gz
aur-build-f5d970494f77d39dadf7c7d5a6a3d70221ca2da2.zip
src,sandbox,http: three more fields nobody read, and the check that missed them
A field scan that printed its first thirty lines missed the rest. Three `pub` fields were written and never read: `SandboxSpec::disk_mb`, copied off `cfg.min_free_disk_mb` into a spec no backend consulted — the dispatcher already checks the disk itself, so the knob stayed live and the plumbing around it was dead; `SandboxInfo::warm`, computed three ways by three backends and read by nobody; and `Server::handle`, a `JoinHandle` stored and never joined, which is what detaching a thread means and so was never load-bearing. All three are gone, their construction sites with them. Four more are written-but-never-read on purpose and now say so where they are declared: `Identity::upstream_pins` and `source_digests` reach the identity digest through `canonical_json`, not through a name; `VirtualClock::_owner` is the lease, and holding it unread is the whole mechanism; the `Ab`/`Ba` pair in `hash`'s canonical-json test exist to be serialized. `the_test_helpers_are_used` only looked at `pub` items, which left the blanket `allow(dead_code)` in `tests/common` exactly as able to hide a private helper as a public one — the objection was fair, and planting `fn planted_private_helper_never_used()` proved it passed while a dead private helper sat in the file. It now scans private declarations too, and fails on both the planted function and a planted struct.
Diffstat (limited to 'src/sandbox')
-rw-r--r--src/sandbox/kata.rs1
-rw-r--r--src/sandbox/loopback.rs1
-rw-r--r--src/sandbox/mod.rs4
-rw-r--r--src/sandbox/remote.rs1
4 files changed, 1 insertions, 6 deletions
diff --git a/src/sandbox/kata.rs b/src/sandbox/kata.rs
index 84a79e4..a54110a 100644
--- a/src/sandbox/kata.rs
+++ b/src/sandbox/kata.rs
@@ -308,7 +308,6 @@ mod kata_backend {
Ok(vec![SandboxInfo {
id: format!("kata@{} via {}", self.addr, self.provisioner.name()),
profile: self.cfg.build_profile.clone(),
- warm: !self.pending.lock().unwrap().is_empty(),
}])
}
}
diff --git a/src/sandbox/loopback.rs b/src/sandbox/loopback.rs
index 9629206..fb5ba00 100644
--- a/src/sandbox/loopback.rs
+++ b/src/sandbox/loopback.rs
@@ -53,7 +53,6 @@ impl SandboxBackend for LoopbackBackend {
Ok(vec![SandboxInfo {
id: "loopback".into(),
profile: self.cfg.build_profile.clone(),
- warm: true,
}])
}
}
diff --git a/src/sandbox/mod.rs b/src/sandbox/mod.rs
index ded76f0..b82647b 100644
--- a/src/sandbox/mod.rs
+++ b/src/sandbox/mod.rs
@@ -64,12 +64,11 @@ pub struct SandboxSpec {
pub profile: String,
pub task: String,
pub ttl: Duration,
- pub disk_mb: u64,
}
impl SandboxSpec {
pub fn new(profile: impl Into<String>, task: impl Into<String>, ttl: Duration) -> Self {
- Self { profile: profile.into(), task: task.into(), ttl, disk_mb: 0 }
+ Self { profile: profile.into(), task: task.into(), ttl }
}
}
@@ -82,7 +81,6 @@ mod sandbox_info {
pub struct SandboxInfo {
pub id: String,
pub profile: String,
- pub warm: bool,
}
}
diff --git a/src/sandbox/remote.rs b/src/sandbox/remote.rs
index 6d369e2..8366e97 100644
--- a/src/sandbox/remote.rs
+++ b/src/sandbox/remote.rs
@@ -98,7 +98,6 @@ impl SandboxBackend for RemoteBackend {
Ok(vec![SandboxInfo {
id: format!("remote@{}", self.addr),
profile: self.cfg.build_profile.clone(),
- warm: !self.queue.is_empty(),
}])
}
}