diff options
author | David Kalnischkies <david@kalnischkies.de> | 2021-08-17 00:04:14 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2021-09-04 15:35:15 +0200 |
commit | 017b3d0ae5232628c15324204e607e76487afb99 (patch) | |
tree | 50b9467caa745a2bb14509fc730ab7af42192bc3 | |
parent | 902d114fce257fc1d51c510ac02de42b8ff1ec0e (diff) |
Do not strip M-A for native build-dep resolution
Back than M-A was added to build-dependencies (#558104) only the
qualifiers :native and :any were considered at first which for the
native case behave the same, so stripping was a good idea.
Nowadays we could encounter arch-qualified dependencies, too, through –
or slightly more likely conflicts perhaps – at least in theory as in
practice native build-dep operations in Debian and elsewhere wouldn't
have other architectures available anyhow.
Still, we have full support for all this for the crossbuilding case
which makes active use of this (at least is far more likely to do so),
so it seems better to converge on one edgecase rather than keeping
two in active use and so produce potentially different results for not
specifying -a and -a $native.
-rw-r--r-- | apt-private/private-source.cc | 14 | ||||
-rwxr-xr-x | test/integration/test-bug-632221-cross-dependency-satisfaction | 35 |
2 files changed, 25 insertions, 24 deletions
diff --git a/apt-private/private-source.cc b/apt-private/private-source.cc index def24bd27..7eb5a8f4a 100644 --- a/apt-private/private-source.cc +++ b/apt-private/private-source.cc @@ -568,7 +568,7 @@ bool DoSource(CommandLine &CmdL) /* This function will look at the build depends list of the given source package and install the necessary packages to make it true, or fail. */ static std::vector<pkgSrcRecords::Parser::BuildDepRec> GetBuildDeps(pkgSrcRecords::Parser * const Last, - char const * const Src, bool const StripMultiArch, std::string const &hostArch) + char const * const Src, std::string const &hostArch) { std::vector<pkgSrcRecords::Parser::BuildDepRec> BuildDeps; // FIXME: Can't specify architecture to use for [wildcard] matching, so switch default arch temporary @@ -576,7 +576,7 @@ static std::vector<pkgSrcRecords::Parser::BuildDepRec> GetBuildDeps(pkgSrcRecord { std::string nativeArch = _config->Find("APT::Architecture"); _config->Set("APT::Architecture", hostArch); - bool Success = Last->BuildDepends(BuildDeps, _config->FindB("APT::Get::Arch-Only", false), StripMultiArch); + bool Success = Last->BuildDepends(BuildDeps, _config->FindB("APT::Get::Arch-Only", false), false); _config->Set("APT::Architecture", nativeArch); if (Success == false) { @@ -584,7 +584,7 @@ static std::vector<pkgSrcRecords::Parser::BuildDepRec> GetBuildDeps(pkgSrcRecord return {}; } } - else if (Last->BuildDepends(BuildDeps, _config->FindB("APT::Get::Arch-Only", false), StripMultiArch) == false) + else if (Last->BuildDepends(BuildDeps, _config->FindB("APT::Get::Arch-Only", false), false) == false) { _error->Error(_("Unable to get build-dependency information for %s"), Src); return {}; @@ -637,17 +637,13 @@ static void WriteBuildDependencyPackage(std::ostringstream &buildDepsPkgFile, } bool DoBuildDep(CommandLine &CmdL) { - bool StripMultiArch; std::string hostArch = _config->Find("APT::Get::Host-Architecture"); if (hostArch.empty() == false) { std::vector<std::string> archs = APT::Configuration::getArchitectures(); if (std::find(archs.begin(), archs.end(), hostArch) == archs.end()) return _error->Error(_("No architecture information available for %s. See apt.conf(5) APT::Architectures for setup"), hostArch.c_str()); - StripMultiArch = false; } - else - StripMultiArch = true; auto const nativeArch = _config->Find("APT::Architecture"); std::string const pseudoArch = hostArch.empty() ? nativeArch : hostArch; @@ -777,7 +773,7 @@ bool DoBuildDep(CommandLine &CmdL) auto pseudo = std::string("builddeps:") + pkg.name; WriteBuildDependencyPackage(buildDepsPkgFile, pseudo, pseudoArch, - GetBuildDeps(Last.get(), pkg.name.c_str(), StripMultiArch, hostArch)); + GetBuildDeps(Last.get(), pkg.name.c_str(), hostArch)); pkg.name = std::move(pseudo); pseudoPkgs.push_back(std::move(pkg)); } @@ -802,7 +798,7 @@ bool DoBuildDep(CommandLine &CmdL) std::string const pseudo = std::string("builddeps:") + Src; WriteBuildDependencyPackage(buildDepsPkgFile, pseudo, pseudoArch, - GetBuildDeps(Last, Src.c_str(), StripMultiArch, hostArch)); + GetBuildDeps(Last, Src.c_str(), hostArch)); std::string reltag = *I; size_t found = reltag.find_last_of("/"); if (found == std::string::npos) diff --git a/test/integration/test-bug-632221-cross-dependency-satisfaction b/test/integration/test-bug-632221-cross-dependency-satisfaction index d52652cad..0cf8d353f 100755 --- a/test/integration/test-bug-632221-cross-dependency-satisfaction +++ b/test/integration/test-bug-632221-cross-dependency-satisfaction @@ -232,14 +232,15 @@ configarchitecture 'amd64' 'armel' insertinstalledpackage 'cool' 'amd64' '0.5' insertinstalledpackage 'foreigner' 'armel' '0.5' -testsuccessequal 'Reading package lists... +APT_ON_AMD64='Reading package lists... Building dependency tree... The following NEW packages will be installed: amdboot doxygen libc6 libc6-dev libfwibble-dev libfwibble1 linux-stuff The following packages will be upgraded: - foreigner:armel -1 upgraded, 7 newly installed, 0 to remove and 1 not upgraded. + cool foreigner:armel +2 upgraded, 7 newly installed, 0 to remove and 0 not upgraded. Inst amdboot (1.0 unstable [amd64]) +Inst cool [0.5] (1.0 unstable [amd64]) Inst doxygen (1.0 unstable [amd64]) Inst foreigner:armel [0.5] (1.0 unstable [armel]) Inst libc6 (1.0 unstable [amd64]) @@ -248,13 +249,17 @@ Inst libfwibble1 (1.0 unstable [amd64]) Inst libfwibble-dev (1.0 unstable [amd64]) Inst linux-stuff (1.0 unstable [amd64]) Conf amdboot (1.0 unstable [amd64]) +Conf cool (1.0 unstable [amd64]) Conf doxygen (1.0 unstable [amd64]) Conf foreigner:armel (1.0 unstable [armel]) Conf libc6 (1.0 unstable [amd64]) Conf libc6-dev (1.0 unstable [amd64]) Conf libfwibble1 (1.0 unstable [amd64]) Conf libfwibble-dev (1.0 unstable [amd64]) -Conf linux-stuff (1.0 unstable [amd64])' aptget build-dep apt -s +Conf linux-stuff (1.0 unstable [amd64])' +testsuccessequal "$APT_ON_AMD64" aptget build-dep apt -s +testsuccessequal "Reading package lists... +$APT_ON_AMD64" aptget build-dep apt -s -a amd64 testsuccessequal 'Reading package lists... Reading package lists... @@ -288,19 +293,16 @@ Conf libfwibble-dev:armel (1.0 unstable [armel])' aptget build-dep apt -s -a arm configarchitecture 'armel' 'amd64' -# cool 0.5 is not M-A: allowed, so amd64 is not acceptable -testsuccessequal 'Reading package lists... +APT_ON_ARMEL='Reading package lists... Building dependency tree... -The following packages will be REMOVED: - cool:amd64 The following NEW packages will be installed: - amdboot:amd64 arm-stuff cool doxygen libc6 libc6-dev libfwibble-dev - libfwibble1 -0 upgraded, 8 newly installed, 1 to remove and 1 not upgraded. -Remv cool:amd64 [0.5] + amdboot:amd64 arm-stuff doxygen libc6 libc6-dev libfwibble-dev libfwibble1 +The following packages will be upgraded: + cool:amd64 +1 upgraded, 7 newly installed, 0 to remove and 1 not upgraded. Inst amdboot:amd64 (1.0 unstable [amd64]) Inst arm-stuff (1.0 unstable [armel]) -Inst cool (1.0 unstable [armel]) +Inst cool:amd64 [0.5] (1.0 unstable [amd64]) Inst doxygen (1.0 unstable [armel]) Inst libc6 (1.0 unstable [armel]) Inst libc6-dev (1.0 unstable [armel]) @@ -308,12 +310,15 @@ Inst libfwibble1 (1.0 unstable [armel]) Inst libfwibble-dev (1.0 unstable [armel]) Conf amdboot:amd64 (1.0 unstable [amd64]) Conf arm-stuff (1.0 unstable [armel]) -Conf cool (1.0 unstable [armel]) +Conf cool:amd64 (1.0 unstable [amd64]) Conf doxygen (1.0 unstable [armel]) Conf libc6 (1.0 unstable [armel]) Conf libc6-dev (1.0 unstable [armel]) Conf libfwibble1 (1.0 unstable [armel]) -Conf libfwibble-dev (1.0 unstable [armel])' aptget build-dep apt -s +Conf libfwibble-dev (1.0 unstable [armel])' +testsuccessequal "$APT_ON_ARMEL" aptget build-dep apt -s +testsuccessequal "Reading package lists... +$APT_ON_ARMEL" aptget build-dep apt -s -a armel testsuccessequal 'Reading package lists... Reading package lists... |