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

Re: Build-Depends-Indep, please review

anatoly techtonik <techtonik@gmail.com> writes:

> Hello,
> I've described situation around Build-Depends-Indep at
> http://wiki.debian.org/Build-Depends-Indep
> I hope it will be useful for people who are looking for description of
> this field. However, I am not expert in packaging, and some
> information is obviously missing. If you can fill the blanks, that
> would be awesome.
> Please, CC.

| As a result, it became possible to execute debian/rules with
| 'build-indep' and 'build-arch' targets correspondingly.

No, you can not, at least not in general. That is exactly the
problem. The build-indep and build-arch targets are optional and can't
be detected reliably. So dpkg-buildpackage has to call the build target
even if it only wants to build indep or arch packages. It is only
possible after you manually verified the package does have those
targets, which makes them rather useless.

The more usefull case is calling the binary-indep or binary-arch
targets, which then only depend on build-indep or build-arch
respectively. But since that then builds as (fake)root autobuilders
don't do that without having called build first.

| In practice I can't think of any real world example where this
| scenario can be used. The only useful application may be with
| autobuilders that build a lot of packages from scratch, i.e. in empty
| environment on different systems.

All autobuilders do exactly that. They only build the arch packages and
start from a clean chroot. Installing packages into the build chroot for
each build is a huge drain, esspecially for things like fonts that
get reindexed every time (those 'this might take a while' messages).

| Some people argue that 'build' not necessary calls 'build-indep' or
| 'build-arch', because policy says that it "should call", not "must
| call". I doubt that there are cases when 'build' doesn't call these -
| in this scenario some packages won't be built at all, just because
| autobuilders can't call anything, but 'build'.

I believe there are several cases. And autobuilders can build them just
fine. The secret is to have the binary-% targets depend on build-%
instead of build. The build targets itself can potentially do
nothing. That way build-indep and build-arch are called as needed
although at a later time and as (fake)root. It certainly isn't nice to
do this but it is the only way to make Build-Depends-Indep usefull.

Note: A less ugly case is having build depend on build-arch but not
build-indep. That way autobuilders build as normal user and only the
indep packges are build as (fake)root.


Reply to: