Re: Computing Build-Depends at build time (and other updates to debian/control)?
Josh Triplett <firstname.lastname@example.org> writes:
> Mechanisms like shlibdeps, dh_perl, and other substvars allow packages
> to compute their Depends at build time. This avoids hard-coding
> dependencies, simplifies upgrading the package to new versions, and
> makes transitions much easier.
> Some packages could potentially compute most of their Build-Depends the
> same way. For example, I'm working on a tool ("debcargo") to package
> Rust libraries and applications, which include detailed metadata (via
> Cargo) for dependencies on other Rust libraries. Given a minimal set of
> tools installed (cargo and that packaging tool), I could compute all the
> necessary Depends and Build-Depends on Rust packages, including
> Right now, that packaging tool has to compute the Build-Depends at
> packaging time and embed them in debian/control. (Most likely, I'll
> include comments delimiting the Cargo dependencies, to make it easier to
> update them.)
> What would it take to compute Build-Depends at build time instead, with
> a minimal set of Build-Depends installed to support doing so?
Several packages create their control file from control.in during
maintainer build. You can have debian/control as a make dependency for
the package build target so it gets generated if it's not already
up-to-date. You just need to check it's correct and building on the
buildds does not generate a new/different controlfile.