deb: collapse the incremental fork logs into one line
The fork announcement, the base selection and the resume note all described the same thing — building on the previous attempt's tree — in three consecutive lines. One line now carries the record ids, the carried/fresh state, and the selection why only when it deviates from the default pick (a base that did not succeed).
This commit is contained in:
+33
-19
@@ -641,9 +641,6 @@ async fn build_binary_package_impl(
|
||||
)
|
||||
})?;
|
||||
if build_resume {
|
||||
log::info!(
|
||||
"Reusing the build artifacts of the previous attempt (incremental build)"
|
||||
);
|
||||
// Before the overlay mounts (see the function's doc): a
|
||||
// setpriv-era tree handed over here lets the mapped
|
||||
// build identity run the rules; a failed handover makes
|
||||
@@ -830,6 +827,17 @@ fn copy_report<'a>(
|
||||
})
|
||||
}
|
||||
|
||||
/// The staged-tree clause of the incremental-base log line: right
|
||||
/// after a successful fork the record's staged tree exists exactly
|
||||
/// when the base's was carried through the gate.
|
||||
fn fork_tree_clause(record: &session::Session) -> &'static str {
|
||||
if record.has_upper() {
|
||||
"staged tree carried"
|
||||
} else {
|
||||
"fresh staged tree"
|
||||
}
|
||||
}
|
||||
|
||||
/// Resolve the record a build runs in, per the `--incremental` request,
|
||||
/// against the real sessions root and the chroot tarball the bootstrap
|
||||
/// would use today. See [`resolve_record_in`].
|
||||
@@ -889,11 +897,12 @@ fn resolve_record_in(
|
||||
.filter(|s| !session::lock_is_held(&s.lock_path()).unwrap_or(true))
|
||||
.collect();
|
||||
for base in session::rank_base_candidates(candidates) {
|
||||
let why = if base.manifest().last_outcome == session::OUTCOME_SUCCESS {
|
||||
"the newest successful record of the target"
|
||||
} else {
|
||||
"no successful record among the last usable ones; the newest record"
|
||||
};
|
||||
// Only a deviant selection explains itself: forking from
|
||||
// a record that did not succeed is worth a clause, the
|
||||
// default pick is not.
|
||||
let why = (base.manifest().last_outcome != session::OUTCOME_SUCCESS).then_some(
|
||||
"no successful record among the last usable ones; the newest record",
|
||||
);
|
||||
let report = copy_report(view, &base.manifest().id);
|
||||
match session::fork_record_in(
|
||||
records_root,
|
||||
@@ -905,9 +914,14 @@ fn resolve_record_in(
|
||||
report.as_deref(),
|
||||
) {
|
||||
Ok(record) => {
|
||||
let mut notes = Vec::with_capacity(2);
|
||||
notes.extend(why);
|
||||
notes.push(fork_tree_clause(&record));
|
||||
log::info!(
|
||||
"Base of the incremental build: record {} ({why})",
|
||||
base.manifest().id
|
||||
"Incremental base {} -> record {} ({})",
|
||||
base.manifest().id,
|
||||
record.manifest().id,
|
||||
notes.join(", ")
|
||||
);
|
||||
return Ok((record, true));
|
||||
}
|
||||
@@ -939,13 +953,8 @@ fn resolve_record_in(
|
||||
.into()),
|
||||
1 => {
|
||||
let base = matches.remove(0);
|
||||
log::info!(
|
||||
"Base of the incremental build: record {} (pinned by id)",
|
||||
base.manifest().id
|
||||
);
|
||||
let report = copy_report(view, &base.manifest().id);
|
||||
Ok((
|
||||
session::fork_record_in(
|
||||
let record = session::fork_record_in(
|
||||
records_root,
|
||||
&base,
|
||||
host_tree,
|
||||
@@ -953,9 +962,14 @@ fn resolve_record_in(
|
||||
version,
|
||||
cache_tarball_sha256,
|
||||
report.as_deref(),
|
||||
)?,
|
||||
true,
|
||||
))
|
||||
)?;
|
||||
log::info!(
|
||||
"Incremental base {} -> record {} ({})",
|
||||
base.manifest().id,
|
||||
record.manifest().id,
|
||||
fork_tree_clause(&record)
|
||||
);
|
||||
Ok((record, true))
|
||||
}
|
||||
_ => {
|
||||
let found = matches
|
||||
|
||||
@@ -1324,16 +1324,6 @@ pub(crate) fn fork_record_in(
|
||||
)));
|
||||
}
|
||||
}
|
||||
log::info!(
|
||||
"Forked build record {} from record {}: {}",
|
||||
record.manifest().id,
|
||||
base_manifest.id,
|
||||
if carry_upper {
|
||||
"the staged tree (objects included) is carried"
|
||||
} else {
|
||||
"a fresh staged tree; the environment comes from the apt cache"
|
||||
}
|
||||
);
|
||||
Ok(record)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user