deb: build the tree the caller pointed at before the name search
CI / build (push) Successful in 3m16s
CI / test (push) Skipped
CI / publish (push) Skipped
CI / snap (push) Failing after 7m17s

build_binary_package stages the parent of the requested cwd, then
re-derived the package directory inside the staging area from
package/version name patterns plus the calling process's working
directory. That only works by accident for interactive users sitting
in the package directory: an embedded caller whose tree lives at
<job>/tree matches no pattern, and the process cwd means nothing to
a library consumer — the bc build above failed here even though the
tree was staged correctly.

The pointed-at tree is authoritative anyway: its changelog defined
the package, version and series for this build. Resolve its staged
copy outright when it carries a debian/ tree, keep the pattern
search (with the quirks overrides) as a fallback, and hand the
resolved directory to local::build instead of searching again.
This commit is contained in:
2026-09-22 14:31:25 +02:00
parent 9186bbbe51
commit 7a6337e1cb
2 changed files with 175 additions and 4 deletions
+3 -4
View File
@@ -34,6 +34,7 @@ pub async fn build(
series: &str,
pocket: Option<&str>,
build_root: &str,
package_dir: &Path,
cross: bool,
ppa: &[String],
inject_packages: &[String],
@@ -231,10 +232,8 @@ pub async fn build(
return Err("Could not install essential packages for the build".into());
}
// Find the actual package directory
// Find the actual package directory
let package_dir =
crate::deb::find_package_directory(Path::new(build_root), package, version, series, &ctx)?;
// The package directory was resolved by the caller (the staged copy of
// the tree the user pointed at, or the name-pattern search fallback)
let package_dir_str = package_dir
.to_str()
.ok_or("Invalid package directory path")?;