pub struct ArchPathGuard { /* private fields */ }Expand description
Tracks the output paths one crate’s installer configs have produced across every per-architecture artifact loop, erroring on the first collision.
Implementations§
Source§impl ArchPathGuard
impl ArchPathGuard
Sourcepub fn new() -> Self
pub fn new() -> Self
A fresh guard with no recorded paths. One per crate, shared across all of that crate’s configs.
Sourcepub fn check(
&mut self,
path: &Path,
stage: &str,
artifact: &str,
name_template: &str,
rendered: &str,
crate_name: &str,
) -> Result<()>
pub fn check( &mut self, path: &Path, stage: &str, artifact: &str, name_template: &str, rendered: &str, crate_name: &str, ) -> Result<()>
Record path for this scope; error if a previous call already
produced it.
stage is the config key ("dmgs"), artifact the user-facing noun
("image") — pluralized with a trailing s in the message,
name_template the offending template, rendered the rendered output
name, and crate_name the crate being built.
Sourcepub fn check_conventional(
&mut self,
path: &Path,
stage: &str,
artifact: &str,
rendered: &str,
crate_name: &str,
) -> Result<()>
pub fn check_conventional( &mut self, path: &Path, stage: &str, artifact: &str, rendered: &str, crate_name: &str, ) -> Result<()>
Record path for this scope when the name comes from a stage’s
conventional default filename rather than a user template; error if a
previous call already produced it.
For distro-conventional packagers (deb/rpm/apk), the default filename’s
arch field must stay bare (amd64, never amd64v3), so two amd64
micro-architecture variants of one triple render the same path under the
default. The message names “the conventional default filename” (no fake
template echo) and advises a file_name_template carrying
{{ .Amd64 }} — the only field that disambiguates same-arch variants.