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:
+40
-26
@@ -641,9 +641,6 @@ async fn build_binary_package_impl(
|
|||||||
)
|
)
|
||||||
})?;
|
})?;
|
||||||
if build_resume {
|
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
|
// Before the overlay mounts (see the function's doc): a
|
||||||
// setpriv-era tree handed over here lets the mapped
|
// setpriv-era tree handed over here lets the mapped
|
||||||
// build identity run the rules; a failed handover makes
|
// 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,
|
/// Resolve the record a build runs in, per the `--incremental` request,
|
||||||
/// against the real sessions root and the chroot tarball the bootstrap
|
/// against the real sessions root and the chroot tarball the bootstrap
|
||||||
/// would use today. See [`resolve_record_in`].
|
/// 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))
|
.filter(|s| !session::lock_is_held(&s.lock_path()).unwrap_or(true))
|
||||||
.collect();
|
.collect();
|
||||||
for base in session::rank_base_candidates(candidates) {
|
for base in session::rank_base_candidates(candidates) {
|
||||||
let why = if base.manifest().last_outcome == session::OUTCOME_SUCCESS {
|
// Only a deviant selection explains itself: forking from
|
||||||
"the newest successful record of the target"
|
// a record that did not succeed is worth a clause, the
|
||||||
} else {
|
// default pick is not.
|
||||||
"no successful record among the last usable ones; the newest record"
|
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);
|
let report = copy_report(view, &base.manifest().id);
|
||||||
match session::fork_record_in(
|
match session::fork_record_in(
|
||||||
records_root,
|
records_root,
|
||||||
@@ -905,9 +914,14 @@ fn resolve_record_in(
|
|||||||
report.as_deref(),
|
report.as_deref(),
|
||||||
) {
|
) {
|
||||||
Ok(record) => {
|
Ok(record) => {
|
||||||
|
let mut notes = Vec::with_capacity(2);
|
||||||
|
notes.extend(why);
|
||||||
|
notes.push(fork_tree_clause(&record));
|
||||||
log::info!(
|
log::info!(
|
||||||
"Base of the incremental build: record {} ({why})",
|
"Incremental base {} -> record {} ({})",
|
||||||
base.manifest().id
|
base.manifest().id,
|
||||||
|
record.manifest().id,
|
||||||
|
notes.join(", ")
|
||||||
);
|
);
|
||||||
return Ok((record, true));
|
return Ok((record, true));
|
||||||
}
|
}
|
||||||
@@ -939,23 +953,23 @@ fn resolve_record_in(
|
|||||||
.into()),
|
.into()),
|
||||||
1 => {
|
1 => {
|
||||||
let base = matches.remove(0);
|
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);
|
let report = copy_report(view, &base.manifest().id);
|
||||||
Ok((
|
let record = session::fork_record_in(
|
||||||
session::fork_record_in(
|
records_root,
|
||||||
records_root,
|
&base,
|
||||||
&base,
|
host_tree,
|
||||||
host_tree,
|
identity,
|
||||||
identity,
|
version,
|
||||||
version,
|
cache_tarball_sha256,
|
||||||
cache_tarball_sha256,
|
report.as_deref(),
|
||||||
report.as_deref(),
|
)?;
|
||||||
)?,
|
log::info!(
|
||||||
true,
|
"Incremental base {} -> record {} ({})",
|
||||||
))
|
base.manifest().id,
|
||||||
|
record.manifest().id,
|
||||||
|
fork_tree_clause(&record)
|
||||||
|
);
|
||||||
|
Ok((record, true))
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
let found = matches
|
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)
|
Ok(record)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user