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

Bug#683786: apt-get cross build dependency resolution of arch:all, m-a:none packages



Hi Johannes,

first of all: Thanks for the detailed report!

On Sat, Aug 4, 2012 at 1:03 AM, Johannes Schauer <j.schauer@email.de> wrote:
> The following packages build-depend on a architecture:all, M-A: none
> package. Dose3 correctly detected that they cannot satisfy the cross
> build dependencies because they are not marked M-A: foreign. Apt decides

You mean the right thing, but for anyone else reading it:
Meant is that the arch:all package isn't marked as M-A:foreign.
And the "following packages" are all M-A: none packages itself with "normal"
(aka no specific architecture or same, any, or whatever behind a colon)
dependencies on the arch:all packages.


> to ignore that and doesnt install them at all. Apt seems to completely
> ignore that build dependency

That is actually exactly what happens - and doesn't only effect M-A.
In line 3090 of cmdline/apt-get.cc in DoBuildDep() you can find a call to
TryToInstallBuildDep method there the boolean return is checked and based
on that it is decided if the try was successful or not (and if not we fail).

The problem is just that the returnvalue will always be 'true' as the method
has an optional AllowFail parameter which defaults to true and isn't specified
on this line (calling blame suggests that someone named David messed it up
while reworking the commandline parsing before squeeze… bad David… [0])

Horrible, isn't it? But a question is still open:

> So we see that apt sometimes decides to use arch:all, M-A: none packages
> to satisfy foreign build dependencies.
>
> Then why do the following scenarios not work as expected:

The reason is simply that the mistake above has only an effect on purely
virtual packages (= packages without a version) and not for packages which
simple do not exist. So this isn't even limited to :all packages, but :any
packages as well, as long as they do not exist for the host architecture, but
have (host-arch) packages depending on them (which is just less likely).

You can verify this by trying:
apt-cache showpkg po-debconf:armel texi2html:armel

You will see that a po-debconf:armel package exists because an :any package
depends on it, while texi2html:armel doesn't exist (= nothing depends on it)


The fix is simply to add a ", false" to the end of the parameter list on the
previously mentioned line. Bonuspoints for adding on line 3007 to the check
if the package exists also a check if the package has at least one version
("|| Pkg->VersionList == 0").

Both by itself has the desired effect - an error - but:
"Make assurance double sure!" ;)
(patch with a simple testcase attached)

> Case 2
> ------
>
> The following packages also build-depend on a architecture:all, M-A:
> none package. Since the packages are not M-A: foreign, they should not
> be used to satisfy the build-dependencies for cross building. Apt
> chooses to install them anyways:
>
> {package}->{dependency that dose3 detected to be unsatisfiable but apt installs}
>
> gzip    -> mingw-w64

gzip Build-Depends-Indep: mingw-w64, so that mingw-w64:build is installed
is fine as we don't need to cross-build arch:all packages. Looks for me like
a bug in dose3 instead.
(I can't reproduce other examples in that group)


> Maybe there is a connection to bug#666772 ?

No, and given that dpkg-maintainers haven't agreed to this plan yet,
i guess it can be considered a "no", but Steve wanted to pursue this further.
After all, it is not that important for wheezy, as APT and dpkg are far from
the only places needing support for it, so it will only work out for jessie -
if at all anyway (as other tools have no M-A support at all in wheezy).


Best regards

David Kalnischkies

[0] completely unrelated coincident (of course):
The Big Bang Theory S03E11 was (re)aired here yesterday. Last scene:
Sheldon: "I blame Penny."
Penny: "I blame Penny, too. Bad Penny."

Attachment: apt-683786-build-dep-on-virtual-packages.diff
Description: Binary data


Reply to: