feat: add metapackage build support and fail-fast custom scripts

- add BuildType::Meta handling in builder and interactive spec output
- allow metapackage specs without sources and expose is_metapackage()
- avoid build deps in install planning for metapackages
- run custom non-function build.sh scripts with `sh -e` to stop on first failure
- add regression test for custom script fail-fast behavior
- apply small cleanup refactors (let-chains/iterator simplifications)
This commit is contained in:
2026-02-25 16:49:36 -06:00
parent 9953d4b2ee
commit d9a30f5d56
13 changed files with 168 additions and 94 deletions
+8 -16
View File
@@ -29,21 +29,13 @@ fn resolve_rootfs_base(rootfs: &Path) -> PathBuf {
}
/// Global repo behavior settings loaded from `repos.toml`.
#[derive(Clone, Debug, Serialize, Deserialize)]
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
pub struct RepoSettings {
/// Prefer binary repos over source repos when both can satisfy a request.
#[serde(default)]
pub prefer_binary: bool,
}
impl Default for RepoSettings {
fn default() -> Self {
Self {
prefer_binary: false,
}
}
}
/// Source repository configuration entry loaded from `repos.toml`.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct SourceRepo {
@@ -425,13 +417,13 @@ impl Config {
}
// Allow overriding repo clone dir via [repo] clone_dir in depot.toml
if let Some(repo_table) = self.build_overrides.get("repo").and_then(|v| v.as_table()) {
if let Some(clone_val) = repo_table.get("clone_dir").and_then(|v| v.as_str()) {
let p = PathBuf::from(clone_val);
// If relative path, make it relative to rootfs
let repo_dir = if p.is_absolute() { p } else { rootfs.join(p) };
self.repo_clone_dir = repo_dir;
}
if let Some(repo_table) = self.build_overrides.get("repo").and_then(|v| v.as_table())
&& let Some(clone_val) = repo_table.get("clone_dir").and_then(|v| v.as_str())
{
let p = PathBuf::from(clone_val);
// If relative path, make it relative to rootfs
let repo_dir = if p.is_absolute() { p } else { rootfs.join(p) };
self.repo_clone_dir = repo_dir;
}
Ok(())