summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/pipeline/mod.rs16
-rw-r--r--src/pipeline/publish.rs2
-rw-r--r--src/pipeline/steps.rs2
-rw-r--r--src/sandbox/loopback.rs2
-rw-r--r--src/sandbox/remote.rs2
-rw-r--r--src/sandbox/wire.rs12
-rw-r--r--tests/architecture-budget.json12
7 files changed, 24 insertions, 24 deletions
diff --git a/src/pipeline/mod.rs b/src/pipeline/mod.rs
index 0bd8f92..e7ee34e 100644
--- a/src/pipeline/mod.rs
+++ b/src/pipeline/mod.rs
@@ -14,7 +14,7 @@ use crate::error::{Error, Result};
use crate::sandbox::{Sandbox, SandboxBackend};
#[derive(Debug, Clone)]
-pub struct SourceIdentity {
+pub(crate) struct SourceIdentity {
pub aur_commit: String,
pub recipe_hash: String,
pub upstream_pins_json: String,
@@ -25,7 +25,7 @@ pub struct SourceIdentity {
}
impl SourceIdentity {
- pub fn from_candidate(c: &CandidateRow, snapshot: &SnapshotRow) -> Self {
+ pub(crate) fn from_candidate(c: &CandidateRow, snapshot: &SnapshotRow) -> Self {
Self {
aur_commit: snapshot.aur_commit.clone(),
recipe_hash: snapshot.recipe_hash.clone(),
@@ -36,7 +36,7 @@ impl SourceIdentity {
pkgrel: c.pkgrel.clone(),
}
}
- pub fn from_release(r: &ReleaseRow) -> Self {
+ pub(crate) fn from_release(r: &ReleaseRow) -> Self {
Self {
aur_commit: r.aur_commit.clone(),
recipe_hash: r.recipe_hash.clone(),
@@ -53,7 +53,7 @@ impl SourceIdentity {
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
-pub struct CollectedPkg {
+pub(crate) struct CollectedPkg {
pub name: String,
pub version: String,
pub arch: String,
@@ -69,7 +69,7 @@ pub struct CollectedPkg {
}
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
-pub struct Collect {
+pub(crate) struct Collect {
pub packages: Vec<CollectedPkg>,
}
@@ -91,7 +91,7 @@ pub struct Ctx {
pub db: Db,
pub build: builds::BuildRow,
pub pb: Pkgbase,
- pub src: SourceIdentity,
+ pub(crate) src: SourceIdentity,
pub staging: PathBuf,
pub srcdir: PathBuf,
pub collect_path: PathBuf,
@@ -155,7 +155,7 @@ impl Ctx {
self.backend.acquire(&spec)
}
- pub fn log_line(&self, line: &str) {
+ pub(crate) fn log_line(&self, line: &str) {
use std::io::Write;
if let Some(parent) = self.log.parent() {
let _ = std::fs::create_dir_all(parent);
@@ -286,7 +286,7 @@ pub fn enqueue_manual_rebuild(cfg: &Config, db: &Db, pkgbase: &str) -> Result<St
Ok(id)
}
-pub enum StepResult {
+pub(crate) enum StepResult {
Done(Option<String>),
Skipped(String),
Blocked(Vec<String>),
diff --git a/src/pipeline/publish.rs b/src/pipeline/publish.rs
index 190fb65..4e72d35 100644
--- a/src/pipeline/publish.rs
+++ b/src/pipeline/publish.rs
@@ -218,7 +218,7 @@ fn commit_release(ctx: &Ctx, collect: &Collect) -> Result<i64> {
})
}
-pub fn sweep_render_dirs(arch_dir: &Path) {
+pub(crate) fn sweep_render_dirs(arch_dir: &Path) {
let Ok(entries) = std::fs::read_dir(arch_dir) else {
return;
};
diff --git a/src/pipeline/steps.rs b/src/pipeline/steps.rs
index ba3a08e..be4ebf3 100644
--- a/src/pipeline/steps.rs
+++ b/src/pipeline/steps.rs
@@ -7,7 +7,7 @@ use crate::pipeline::{Collect, CollectedPkg, Ctx, StepResult};
use crate::sandbox::Cmd;
use crate::watch::sources;
-pub fn run_step(ctx: &Ctx, step: &str) -> Result<StepResult> {
+pub(crate) fn run_step(ctx: &Ctx, step: &str) -> Result<StepResult> {
match step {
"materialize" => materialize(ctx),
"plan" => plan(ctx),
diff --git a/src/sandbox/loopback.rs b/src/sandbox/loopback.rs
index 1173562..7847fdc 100644
--- a/src/sandbox/loopback.rs
+++ b/src/sandbox/loopback.rs
@@ -37,7 +37,7 @@ impl SandboxBackend for LoopbackBackend {
}
}
-pub struct LoopbackSandbox {
+pub(crate) struct LoopbackSandbox {
id: String,
blobs: PathBuf,
cfg: Config,
diff --git a/src/sandbox/remote.rs b/src/sandbox/remote.rs
index 51ec047..2f5a1b7 100644
--- a/src/sandbox/remote.rs
+++ b/src/sandbox/remote.rs
@@ -71,7 +71,7 @@ impl SandboxBackend for RemoteBackend {
}
}
-pub struct RemoteSandbox {
+pub(crate) struct RemoteSandbox {
cfg: Config,
id: String,
ttl: std::time::Duration,
diff --git a/src/sandbox/wire.rs b/src/sandbox/wire.rs
index a0d06ca..ae89d6d 100644
--- a/src/sandbox/wire.rs
+++ b/src/sandbox/wire.rs
@@ -2,11 +2,11 @@ use std::io::{self, BufRead, Write};
use serde::{Deserialize, Serialize};
-pub const MAX_FRAME_BYTES: u32 = 2 * 1024 * 1024 * 1024;
+pub(crate) const MAX_FRAME_BYTES: u32 = 2 * 1024 * 1024 * 1024;
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "t", rename_all = "snake_case")]
-pub enum Frame {
+pub(crate) enum Frame {
/// agent → hub, first frame on every connection: the outbound rendezvous.
Hello { token: String, agent_id: String, profiles: Vec<String> },
/// hub → agent: rendezvous accepted; `ttl_secs` arms the agent's watchdog.
@@ -35,7 +35,7 @@ pub enum Frame {
Destroy {},
}
-pub fn write_frame(w: &mut impl Write, f: &Frame) -> io::Result<()> {
+pub(crate) fn write_frame(w: &mut impl Write, f: &Frame) -> io::Result<()> {
let body = serde_json::to_vec(f)
.map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))?;
if body.len() as u64 > MAX_FRAME_BYTES as u64 {
@@ -46,7 +46,7 @@ pub fn write_frame(w: &mut impl Write, f: &Frame) -> io::Result<()> {
w.flush()
}
-pub fn read_frame(r: &mut impl BufRead) -> io::Result<Option<Frame>> {
+pub(crate) fn read_frame(r: &mut impl BufRead) -> io::Result<Option<Frame>> {
let mut len = [0u8; 4];
match r.read_exact(&mut len) {
Ok(()) => {}
@@ -64,11 +64,11 @@ pub fn read_frame(r: &mut impl BufRead) -> io::Result<Option<Frame>> {
Ok(Some(f))
}
-pub fn hex_bytes(b: &[u8]) -> String {
+pub(crate) fn hex_bytes(b: &[u8]) -> String {
hex::encode(b)
}
-pub fn unhex(s: &str) -> io::Result<Vec<u8>> {
+pub(crate) fn unhex(s: &str) -> io::Result<Vec<u8>> {
hex::decode(s).map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))
}
diff --git a/tests/architecture-budget.json b/tests/architecture-budget.json
index 5559831..0b4d82a 100644
--- a/tests/architecture-budget.json
+++ b/tests/architecture-budget.json
@@ -188,14 +188,14 @@
"test": 3
},
"pipeline": {
- "dead": 15,
- "deadonly": 9,
+ "dead": 6,
+ "deadonly": 0,
"glob": 0,
"largest": 481,
"largest_file": "src/pipeline/steps.rs",
"lines": 1339,
"priv": 2,
- "pub": 30,
+ "pub": 21,
"test": 6
},
"pkginfo": {
@@ -243,14 +243,14 @@
"test": 5
},
"sandbox": {
- "dead": 23,
- "deadonly": 8,
+ "dead": 15,
+ "deadonly": 0,
"glob": 0,
"largest": 347,
"largest_file": "src/sandbox/kata.rs",
"lines": 1175,
"priv": 3,
- "pub": 35,
+ "pub": 27,
"test": 15
},
"shims": {