[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Computing Build-Depends at build time (and other updates to debian/control)?



Christoph Egger wrote:
> Josh Triplett <josh@joshtriplett.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
> > versions.
> >
> > 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.

That last part seems like exactly the problem.  If I can only run the
process as part of a maintainer build, then I might as well just run the
packaging tool and have it update the hardcoded Build-Depends in
debian/control.  I don't want the rebuild of debian/control to occur in
advance and show up in the Debian diff; build and clean should never
leave the package source changed.  (For that matter, generated files
shouldn't appear in version control.)  Hence wanting to compute control
(or just Build-Depends) at package build time, and define a subset
Build-Depends for the tools needed for that computation.


Reply to: