summaryrefslogtreecommitdiffstats
path: root/src/sandbox
diff options
context:
space:
mode:
authoraur-build <aur-build@localhost>2026-11-20 23:39:07 +0000
committeraur-build <aur-build@localhost>2026-11-20 23:39:07 +0000
commitdebb8af0ef0e72048b9df5fed40071745ea40c6b (patch)
tree7cb37ad58cf8268b8e24530a384af95c8bd51b32 /src/sandbox
parentc295510e2bb0ee61234536c832dad87a45977fc8 (diff)
downloadaur-build-debb8af0ef0e72048b9df5fed40071745ea40c6b.tar.gz
aur-build-debb8af0ef0e72048b9df5fed40071745ea40c6b.zip
sandbox,http,review,watch: keep six more test-only types out of the release build
Diffstat (limited to 'src/sandbox')
-rw-r--r--src/sandbox/mod.rs27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/sandbox/mod.rs b/src/sandbox/mod.rs
index 6c90f7f..ded76f0 100644
--- a/src/sandbox/mod.rs
+++ b/src/sandbox/mod.rs
@@ -73,13 +73,30 @@ impl SandboxSpec {
}
}
-#[derive(Debug, Clone)]
-pub struct SandboxInfo {
- pub id: String,
- pub profile: String,
- pub warm: bool,
+/// The real definition. The module is private, so this `pub`
+/// is not a nameable path from outside; the alias below is the
+/// only way to reach it, and the alias is what carries the
+/// feature-conditional visibility.
+mod sandbox_info {
+ #[derive(Debug, Clone)]
+ pub struct SandboxInfo {
+ pub id: String,
+ pub profile: String,
+ pub warm: bool,
+ }
}
+/// The return type of `SandboxBackend::status`. No production module outside `sandbox` names it; the backend tests do.
+///
+/// `pub` only under `test-support`. Production reaches the type
+/// through its own module and never names it from outside; the
+/// outside reader that needs the name is a test.
+#[cfg(feature = "test-support")]
+pub use sandbox_info::SandboxInfo;
+
+#[cfg(not(feature = "test-support"))]
+pub(crate) use sandbox_info::SandboxInfo;
+
pub trait Sandbox: Send + Sync {
fn id(&self) -> &str;
fn run(&self, cmd: &Cmd, on_log: &mut dyn FnMut(&[u8])) -> Result<Exit>;