From 4fc6affafafda1aee4cee86294ce7a2b799e2799 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 19 May 2024 19:32:05 +0200 Subject: edsp: solver3: Show some progress Ignore the Solving dependencies... line in the testing framework for compatibility with the existing test cases. --- apt-pkg/edsp.cc | 23 ++++++++++++++++------- test/integration/framework | 1 + 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 589400870..0ffde46c0 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -770,13 +770,22 @@ bool EDSP::ResolveExternal(const char* const solver, pkgDepCache &Cache, { APT::Solver s(Cache.GetCache(), Cache.GetPolicy()); FileFd output; - if (not s.FromDepCache(Cache)) - return false; - if (not s.Solve()) - return false; - if (not s.ToDepCache(Cache)) - return false; - return true; + bool res = true; + if (Progress != NULL) + Progress->OverallProgress(0, 100, 1, _config->FindB("APT::Solver::Upgrade") ? _("Calculating upgrade") : _("Solving dependencies")); + if (res && not s.FromDepCache(Cache)) + res = false; + if (Progress != NULL) + Progress->Progress(10); + if (res && not s.Solve()) + res = false; + if (Progress != NULL) + Progress->Progress(90); + if (res && not s.ToDepCache(Cache)) + res = false; + if (Progress != NULL) + Progress->Done(); + return res; } if (strcmp(solver, "internal") == 0) { diff --git a/test/integration/framework b/test/integration/framework index 98fd7710a..d2ab0d1cd 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -1554,6 +1554,7 @@ cleanup_output() { cat "$1" | sed \ -e '/gpgv: WARNING: This key is not suitable for signing in --compliance=gnupg mode/ d' \ -e '/^profiling:/ d' \ + -e '/Solving dependencies\.\.\./ d' \ | sed -e '/\.\.\.profiling:/ {N;s#\.\.\.profiling:.*\n#...#g}' \ >"$2" } -- cgit v1.2.3-70-g09d2 From 67a8a6470ddb8a603db02c5fab84aa225dc00f8d Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 24 May 2024 13:42:11 +0200 Subject: solver3: Implement APT::Solver::RemoveManual to allow removing manual packages This is mostly going to be useful for the test suite for now, implement a function there to set it up so we can use it to improve test suite correctness. --- apt-pkg/solver3.cc | 7 +++++-- doc/examples/configure-index | 1 + test/integration/framework | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index d43bd5b33..ab66c9501 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -853,6 +853,7 @@ bool APT::Solver::FromDepCache(pkgDepCache &depcache) bool KeepAuto = not _config->FindB("APT::Get::AutomaticRemove"); bool AllowRemove = _config->FindB("APT::Solver::Remove", true); bool AllowInstall = _config->FindB("APT::Solver::Install", true); + bool AllowRemoveManual = _config->FindB("APT::Solver::RemoveManual", false); DefaultRootSetFunc2 rootSet(&cache); for (auto P = cache.PkgBegin(); not P.end(); P++) @@ -863,6 +864,8 @@ bool APT::Solver::FromDepCache(pkgDepCache &depcache) auto state = depcache[P]; auto maybeInstall = state.Install() || (state.Keep() && P->CurrentVer); auto reject = state.Delete() || (depcache[P].Keep() && not P->CurrentVer && depcache[P].Protect()); + auto isAuto = (depcache[P].Flags & pkgCache::Flag::Auto); + auto isOptional = isAuto || (AllowRemoveManual && not depcache[P].Protect()); if (P->SelectedState == pkgCache::State::Hold && not state.Protect()) { if (unlikely(debug >= 1)) @@ -884,14 +887,14 @@ bool APT::Solver::FromDepCache(pkgDepCache &depcache) if (depcache[P].Keep() ? not Install(P, {}) : not Install(depcache.GetCandidateVersion(P), {})) return false; } - else if (maybeInstall && not(depcache[P].Flags & pkgCache::Flag::Auto)) + else if (maybeInstall && not isOptional) { if (unlikely(debug >= 1)) std::cerr << "MANUAL " << P.FullName() << "\n"; if (depcache[P].Keep() ? not Install(P, {}) : not Install(depcache.GetCandidateVersion(P), {})) return false; } - else if (maybeInstall && (KeepAuto || rootSet.InRootSet(P)) && (depcache[P].Flags & pkgCache::Flag::Auto)) + else if (maybeInstall && isOptional && (KeepAuto || rootSet.InRootSet(P) || not isAuto)) { auto Upgrade = depcache.GetCandidateVersion(P) != P.CurrentVer(); if (unlikely(debug >= 1)) diff --git a/doc/examples/configure-index b/doc/examples/configure-index index c27a8f862..6bcf8e354 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -724,6 +724,7 @@ apt::solver::strict-pinning ""; apt::solver::enqueue-common-dependencies ""; apt::solver::upgrade ""; apt::solver::remove ""; +apt::solver::removemanual ""; apt::solver::install ""; apt::keep-downloaded-packages ""; apt::solver ""; diff --git a/test/integration/framework b/test/integration/framework index d2ab0d1cd..ecf5d8703 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -585,6 +585,9 @@ EOF # prefer our apt binaries over the system apt binaries export PATH="${APTCMDLINEBINDIR}:${PATH}:/usr/sbin:/sbin" } +allowremovemanual() { + echo 'APT::Solver::RemoveManual "true";' >> ${TMPWORKINGDIRECTORY}/rootdir/etc/apt/apt.conf.d/allow-remove-manual.conf +} getarchitecture() { if [ "$1" = "native" -o -z "$1" ]; then -- cgit v1.2.3-70-g09d2 From 1fbdc04be7547b8c4bb84f400329415ea0bc60b5 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 19 May 2024 19:31:48 +0200 Subject: test: Run working tests against the 3.0 solver Implement --solver, --only, -skip flags for the test suite, and run the test suite with the broken tests skipped against solver3. --- .gitlab-ci.yml | 9 +++++ test/integration/framework | 8 +++- test/integration/run-tests | 31 +++++++++++++-- test/integration/solver3.broken | 86 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 130 insertions(+), 4 deletions(-) create mode 100644 test/integration/solver3.broken diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fb85a7318..528edf74a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,6 +29,15 @@ test as root: - CTEST_OUTPUT_ON_FAILURE=1 ninja -C build test - unbuffer ./test/integration/run-tests -q -j 4 +test solver3: + stage: test + variables: + APT_CMAKE_BUILD_OPTIONS: '-DWITH_DOC=OFF -DUSE_NLS=OFF' + DEB_BUILD_PROFILES: 'nodoc' + script: + - CTEST_OUTPUT_ON_FAILURE=1 ninja -C build test + - unbuffer ./test/integration/run-tests -q -j 4 --solver 3.0 --skip solver3.broken + test as user: image: i386/debian:testing stage: test diff --git a/test/integration/framework b/test/integration/framework index ecf5d8703..54bc4da07 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -19,6 +19,9 @@ while [ -n "$1" -a -z "$CHECK_ARGS" ]; do elif [ "$1" = '--level' ]; then export MSGLEVEL=$2 shift + elif [ "$1" = '--solver' ]; then + export APT_SOLVER=$2 + shift else echo >&2 "WARNING: Unknown parameter »$1« will be ignored" fi @@ -537,7 +540,10 @@ exec fakeroot gdb --quiet -ex run '${DPKG:-dpkg}' --args '${DPKG:-dpkg}' --root= EOF chmod +x "${TMPWORKINGDIRECTORY}/rootdir/usr/bin/dpkg" "${TMPWORKINGDIRECTORY}/rootdir/usr/bin/gdb-dpkg" echo "Dir::Bin::dpkg \"${TMPWORKINGDIRECTORY}/rootdir/usr/bin/dpkg\";" > rootdir/etc/apt/apt.conf.d/99dpkg - + # Set the solver for the test case. + if [ "$APT_SOLVER" ]; then + echo "APT::Solver \"$APT_SOLVER\";" >> aptconfig.conf + fi { echo 'quiet "0";' echo 'quiet::NoUpdate "true";' diff --git a/test/integration/run-tests b/test/integration/run-tests index c1cc780f0..badc96cc5 100755 --- a/test/integration/run-tests +++ b/test/integration/run-tests @@ -22,6 +22,15 @@ while [ -n "$1" ]; do elif [ "$1" = '-j' ]; then APT_TEST_JOBS=$2 shift + elif [ "$1" = '--solver' ]; then + export APT_SOLVER="$2" + shift + elif [ "$1" = '--skip' ]; then + export APT_SKIP_TEST_FILE="$2" + shift + elif [ "$1" = '--only' ]; then + TESTLIST="$2" + shift elif [ -x "$1" ]; then TESTTORUN="$1" else @@ -52,14 +61,22 @@ if [ -n "$TESTTORUN" ]; then CURRENTTRAP="rm -f \"$OUTPUT\"; $CURRENTTRAP" trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM { - if [ "$MSGLEVEL" -le 1 ]; then + if [ "$APT_SKIP_TEST_FILE" ] && grep -qFx "${TESTTORUN##*/}" "$APT_SKIP_TEST_FILE"; then + if [ "$MSGLEVEL" -le 2 ]; then + printf "${CTEST}Skip Testcase ${CHIGH}${TESTTORUN##*/}${CRESET}" + else + printf "${CTEST}Skip Testcase ${CHIGH}${TESTTORUN##*/}${CRESET}\n" + fi + SKIP='yes' + elif [ "$MSGLEVEL" -le 1 ]; then printf "${TESTTORUN##*/}" elif [ "$MSGLEVEL" -le 2 ]; then printf "${CTEST}Testcase ${CHIGH}${TESTTORUN##*/}${CRESET}: " else printf "${CTEST}Run Testcase ${CHIGH}${TESTTORUN##*/}${CRESET}\n" fi - if ! "$TESTTORUN"; then + + if [ "$SKIP" != "yes" ] && ! "$TESTTORUN"; then FAIL='yes' if [ "$MSGLEVEL" -le 2 ]; then printf >&2 "\n${CHIGH}Running ${TESTTORUN##*/} -> FAILED${CRESET}\n" @@ -96,7 +113,11 @@ ALL=0 FAILED_TESTS="" DIR="$(readlink -f "$(dirname "$0")")" cd "$DIR" -TESTLIST="$(find . -mindepth 1 -maxdepth 1 -regex '^\./test-[^/]*$' | sort)" +if [ -e "$TESTLIST" ]; then + TESTLIST="$(sort < "$TESTLIST" | sed 's#^#./#')" +else + TESTLIST="$(find . -mindepth 1 -maxdepth 1 -regex '^\./test-[^/]*$' | sort)" +fi if [ -n "$APT_TEST_JOBS" ]; then if [ "$MSGCOLOR" != 'NO' ]; then export MSGCOLOR='ALWAYS' @@ -125,6 +146,10 @@ if [ "$MSGLEVEL" -le 1 ]; then printf "${CTEST}Running testcases${CRESET}: " fi for testcase in $TESTLIST; do + if [ "$APT_SKIP_TEST_FILE" ] && grep -qFx "${TESTTORUN##*/}" "$APT_SKIP_TEST_FILE"; then + printf "${CTEST}Skipping Testcase ${CHIGH}${TESTTORUN##*/}${CRESET}\n" + continue + fi if [ "$MSGLEVEL" -le 1 ]; then printf "${testcase##*/}" elif [ "$MSGLEVEL" -le 2 ]; then diff --git a/test/integration/solver3.broken b/test/integration/solver3.broken new file mode 100644 index 000000000..020335238 --- /dev/null +++ b/test/integration/solver3.broken @@ -0,0 +1,86 @@ +test-allow-scores-for-all-dependency-types +test-apt-get-autoremove +test-apt-get-autoremove-kernel-module-providers +test-apt-get-autoremove-real-virtual-provider +test-apt-get-build-dep +test-apt-get-build-dep-barbarian +test-apt-get-build-dep-file +test-apt-get-install-deb +test-apt-get-satisfy +test-apt-get-source-only +test-apt-get-upgrade +test-apt-get-upgrade-by-source +test-apt-install-file-reltag +test-apt-install-order-matters-a-bit +test-apt-move-and-forget-manual-sections +test-apt-never-markauto-sections +test-apt-patterns +test-apt-source-and-build-dep +test-bug-470115-new-and-tighten-recommends +test-bug-549968-install-depends-of-not-installed +test-bug-591882-conkeror +test-bug-596498-trusted-unsigned-repo +test-bug-598669-install-postfix-gets-exim-heavy +test-bug-601961-install-info +test-bug-602412-dequote-redirect +test-bug-604222-new-and-autoremove +test-bug-611729-mark-as-manual +test-bug-612099-multiarch-conflicts +test-bug-612557-garbage-upgrade +test-bug-613420-new-garbage-dependency +test-bug-618848-always-respect-user-requests +test-bug-632221-cross-dependency-satisfaction +test-bug-64141-install-dependencies-for-on-hold +test-bug-657695-resolver-breaks-on-virtuals +test-bug-675449-essential-are-protected +test-bug-683786-build-dep-on-virtual-packages +test-bug-686346-package-missing-architecture +test-bug-709560-set-candidate-release +test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch +test-bug-720597-build-dep-purge +test-bug-723586-any-stripped-in-single-arch +test-bug-735967-lib32-to-i386-unavailable +test-bug-745046-candidate-propagation-fails +test-bug-747261-arch-specific-conflicts +test-bug-753297-upgradable +test-bug-758153-versioned-provides-support +test-bug-767891-force-essential-important +test-bug-769609-triggers-still-pending-after-run +test-bug-796070-downgrade-simulate +test-bug-960705-propagate-protected-to-satisfied-conflict +test-bug-960705-propagate-protected-to-satisfied-depends +test-bug-961266-hold-means-hold +test-bug-lp1562402-nomark-removals-as-keep +test-crossgrades +test-dont-forget-conflicts-via-unknown-architectures +test-dpkg-i-apt-install-fix-broken +test-explore-or-groups-in-markinstall +test-external-dependency-solver-protocol +test-external-installation-planner-protocol +test-handling-broken-orgroups +test-ignore-provides-if-versioned-breaks +test-ignore-provides-if-versioned-conflicts +test-kernel-helper-autoremove +test-method-mirror +test-multiarch-allowed +test-multiarch-barbarian +test-multiarch-foreign +test-not-upgrading-removed-depends +test-parse-all-archs-into-cache +test-phased-updates-new-depends +test-phased-updates-upgrade +test-prefer-higher-priority-providers +test-prevent-markinstall-multiarch-same-versionscrew +test-release-candidate-switching +test-resolve-by-keep-new-recommends +test-resolver-delays-remove-decisions +test-resolver-provider-exchange +test-specific-architecture-dependencies +test-suggests-promoted-to-recommends +test-ubuntu-bug-1130419-prefer-installed-ma-same-siblings +test-ubuntu-bug-1304403-obsolete-priority-standard +test-ubuntu-bug-1974196 +test-ubuntu-bug-1990586 +test-ubuntu-bug-2025462-phased-dist-upgrade +test-ubuntu-bug-614993 +test-unpack-different-version-unpacked -- cgit v1.2.3-70-g09d2 From 0c700522df1c96fd591020e7b3e29bc7e36dec14 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 20 May 2024 13:17:35 +0200 Subject: test: Temporarily ignore autoremovable lists for solver3 We do not show them yet, so let's ignore them so we can focus on getting the rest of the tests to work. --- test/integration/framework | 12 +++++++++++- test/integration/solver3.broken | 1 - 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/test/integration/framework b/test/integration/framework index 54bc4da07..e13888da2 100644 --- a/test/integration/framework +++ b/test/integration/framework @@ -1559,12 +1559,22 @@ downloadfile() { fi } +cleanup_solver3_pipe() { + if [ "$APT_SOLVER" != "3.0" ]; then + cat + else + # FIXME: We do not have support for listing autoremovals yet. + # FIXME: Progress output is different + sed -e '/Solving dependencies\.\.\./ d' \ + -e "/no longer required[.:]$/,/^Use '.* autoremove'/ d" + fi +} cleanup_output() { cat "$1" | sed \ -e '/gpgv: WARNING: This key is not suitable for signing in --compliance=gnupg mode/ d' \ -e '/^profiling:/ d' \ - -e '/Solving dependencies\.\.\./ d' \ | sed -e '/\.\.\.profiling:/ {N;s#\.\.\.profiling:.*\n#...#g}' \ + | cleanup_solver3_pipe \ >"$2" } diff --git a/test/integration/solver3.broken b/test/integration/solver3.broken index 020335238..96238232c 100644 --- a/test/integration/solver3.broken +++ b/test/integration/solver3.broken @@ -60,7 +60,6 @@ test-external-installation-planner-protocol test-handling-broken-orgroups test-ignore-provides-if-versioned-breaks test-ignore-provides-if-versioned-conflicts -test-kernel-helper-autoremove test-method-mirror test-multiarch-allowed test-multiarch-barbarian -- cgit v1.2.3-70-g09d2 From 03f4568283205a26386584002b9ec740c55c9fb7 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 19 May 2024 18:52:20 +0200 Subject: test: Show statistics for parallel tests too This makes things a bit nicer. We also include a list of passed tests here, to use with --only to validate solver3 changes, as well as the list of skipped tests. But too lazy to implement these for the non-parallel case. --- test/integration/run-tests | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/test/integration/run-tests b/test/integration/run-tests index badc96cc5..3100e8e05 100755 --- a/test/integration/run-tests +++ b/test/integration/run-tests @@ -100,6 +100,9 @@ if [ -n "$TESTTORUN" ]; then stty sane || true cat >&2 "$OUTPUT" stty sane || true + if [ "$STATS_FILE" ]; then + flock "$STATS_FILE" -c "echo $TESTTORUN skip=${SKIP:-no} fail=${FAIL:-no} >> \"$STATS_FILE\"" + fi if [ "$FAIL" = 'yes' ]; then exit 1 else @@ -119,6 +122,9 @@ else TESTLIST="$(find . -mindepth 1 -maxdepth 1 -regex '^\./test-[^/]*$' | sort)" fi if [ -n "$APT_TEST_JOBS" ]; then + export STATS_FILE="$(mktemp)" + CURRENTTRAP="rm -f \"$STATS_FILE\"; $CURRENTTRAP" + trap "$CURRENTTRAP" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM if [ "$MSGCOLOR" != 'NO' ]; then export MSGCOLOR='ALWAYS' fi @@ -128,7 +134,26 @@ if [ -n "$APT_TEST_JOBS" ]; then elif command -v parallel.moreutils >/dev/null 2>&1; then parallel=parallel.moreutils fi - exec $parallel -j "$APT_TEST_JOBS" "./$(basename "$0")" -- $(echo "$TESTLIST") + $parallel -j "$APT_TEST_JOBS" "./$(basename "$0")" -- $(echo "$TESTLIST") || true + ALL=$(wc -l < "$STATS_FILE") + SKIP=$(grep -c "skip=yes" "$STATS_FILE" || true) + PASS=$(grep -c "skip=no fail=no" "$STATS_FILE" || true) + FAIL=$(grep -c "fail=yes" "$STATS_FILE" || true) + PASSED_TESTS=$(awk '! /fail=yes/ {print $1}' < "$STATS_FILE" | cut -f2 -d/ | sort | xargs) + SKIPPED_TESTS=$(awk '/fail=skip/ {print $1}' < "$STATS_FILE" | cut -f2 -d/ | sort | xargs) + FAILED_TESTS=$(awk '/fail=yes/ {print $1}' < "$STATS_FILE" | cut -f2 -d/ | sort | xargs) + echo >&2 "Statistics: $ALL tests were run: $PASS successfully and $FAIL failed, $SKIP skipped" + if [ -n "$FAILED_TESTS" ]; then + if [ $PASS -lt $FAIL ]; then + echo >&2 "Passed tests: $PASSED_TESTS" + else + echo >&2 "Failed tests: $FAILED_TESTS" + fi + else + echo >&2 'All tests seem to have been run successfully. What could possibly go wrong?' + fi + # ensure we don't overflow + exit $((FAIL <= 255 ? FAIL : 255)) fi APT_TEST_SIGNINGHOME="$(mktemp --directory --tmpdir 'apt-key-signinghome.XXXXXXXXXX')" -- cgit v1.2.3-70-g09d2 From b5997949909ee9d5e9981c8311aea97c7b2620fd Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 19 May 2024 20:04:47 +0200 Subject: test: Support the 3.0 solver in most existing test cases Highlights: - test-bug-618848-always-respect-user-requests: (Do not) Support 3.0 solver A manually installed package is never removed just because we request the removal of its dependency in solver3. - test-bug-657695-resolver-breaks-on-virtuals: Support 3.0 solver For manually installed packages, solver 3.0 would require some new xserver-xorg-video-driver to Conflict+Replace+Provides the old one (once the logic is implemented), but that does seem reasonable. - test-bug-720597-build-dep-purge: Support 3.0 solver This needs a simple aptmark auto because pkga is removed by the build-dep. But further adjustments are necessary because it weirdly tested for no autoremovable packages before installing pkgc. - test-bug-960705-*: Support 3.0 solver Bit awkward to deal with; notably the protect to conflict doesn't actually work anymore and that is a feature these days. --- test/integration/solver3.broken | 47 ------------------- .../test-apt-get-autoremove-real-virtual-provider | 12 ++++- test/integration/test-apt-get-build-dep | 1 + test/integration/test-apt-get-build-dep-barbarian | 19 +++++--- test/integration/test-apt-get-build-dep-file | 5 +- test/integration/test-apt-get-install-deb | 7 ++- test/integration/test-apt-get-satisfy | 8 +++- test/integration/test-apt-get-source-only | 26 +++++++++++ test/integration/test-apt-get-upgrade | 25 ++++++++++ test/integration/test-apt-never-markauto-sections | 7 +-- ...est-bug-549968-install-depends-of-not-installed | 22 ++++++++- .../test-bug-596498-trusted-unsigned-repo | 13 ++++-- ...test-bug-598669-install-postfix-gets-exim-heavy | 2 + test/integration/test-bug-601961-install-info | 15 +++++- .../integration/test-bug-604222-new-and-autoremove | 26 +++++++++-- .../test-bug-612099-multiarch-conflicts | 1 + test/integration/test-bug-612557-garbage-upgrade | 4 +- .../test-bug-613420-new-garbage-dependency | 1 + .../test-bug-618848-always-respect-user-requests | 13 +++++- .../test-bug-632221-cross-dependency-satisfaction | 11 +++-- ...test-bug-64141-install-dependencies-for-on-hold | 32 +++++++++++++ .../test-bug-657695-resolver-breaks-on-virtuals | 9 ++++ .../test-bug-683786-build-dep-on-virtual-packages | 10 ++-- .../test-bug-686346-package-missing-architecture | 1 + ...bug-712116-dpkg-pre-install-pkgs-hook-multiarch | 4 +- test/integration/test-bug-720597-build-dep-purge | 1 + .../test-bug-723586-any-stripped-in-single-arch | 15 ++++++ .../test-bug-735967-lib32-to-i386-unavailable | 12 ++++- .../test-bug-747261-arch-specific-conflicts | 1 + ...est-bug-769609-triggers-still-pending-after-run | 1 + .../integration/test-bug-796070-downgrade-simulate | 1 + ...60705-propagate-protected-to-satisfied-conflict | 3 +- ...960705-propagate-protected-to-satisfied-depends | 31 ++++++++++++- .../test-bug-lp1562402-nomark-removals-as-keep | 9 ++++ test/integration/test-crossgrades | 1 + .../integration/test-dpkg-i-apt-install-fix-broken | 24 +++++++++- .../test-external-installation-planner-protocol | 1 + test/integration/test-handling-broken-orgroups | 6 ++- .../test-ignore-provides-if-versioned-breaks | 16 +++++-- .../test-ignore-provides-if-versioned-conflicts | 15 ++++-- test/integration/test-multiarch-allowed | 45 +++++++++++++----- test/integration/test-multiarch-foreign | 7 ++- .../integration/test-not-upgrading-removed-depends | 1 + .../test-prefer-higher-priority-providers | 6 ++- .../test-resolver-delays-remove-decisions | 54 ++++++++++++++++++++-- .../test-specific-architecture-dependencies | 7 ++- test/integration/test-ubuntu-bug-1974196 | 15 +++++- .../test-unpack-different-version-unpacked | 14 +++++- 48 files changed, 492 insertions(+), 115 deletions(-) diff --git a/test/integration/solver3.broken b/test/integration/solver3.broken index 96238232c..57ab7ba57 100644 --- a/test/integration/solver3.broken +++ b/test/integration/solver3.broken @@ -1,85 +1,38 @@ test-allow-scores-for-all-dependency-types test-apt-get-autoremove test-apt-get-autoremove-kernel-module-providers -test-apt-get-autoremove-real-virtual-provider -test-apt-get-build-dep -test-apt-get-build-dep-barbarian -test-apt-get-build-dep-file -test-apt-get-install-deb -test-apt-get-satisfy -test-apt-get-source-only -test-apt-get-upgrade test-apt-get-upgrade-by-source test-apt-install-file-reltag test-apt-install-order-matters-a-bit test-apt-move-and-forget-manual-sections -test-apt-never-markauto-sections test-apt-patterns test-apt-source-and-build-dep test-bug-470115-new-and-tighten-recommends -test-bug-549968-install-depends-of-not-installed test-bug-591882-conkeror -test-bug-596498-trusted-unsigned-repo -test-bug-598669-install-postfix-gets-exim-heavy -test-bug-601961-install-info test-bug-602412-dequote-redirect -test-bug-604222-new-and-autoremove test-bug-611729-mark-as-manual -test-bug-612099-multiarch-conflicts -test-bug-612557-garbage-upgrade -test-bug-613420-new-garbage-dependency -test-bug-618848-always-respect-user-requests -test-bug-632221-cross-dependency-satisfaction -test-bug-64141-install-dependencies-for-on-hold -test-bug-657695-resolver-breaks-on-virtuals test-bug-675449-essential-are-protected -test-bug-683786-build-dep-on-virtual-packages -test-bug-686346-package-missing-architecture test-bug-709560-set-candidate-release -test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch -test-bug-720597-build-dep-purge -test-bug-723586-any-stripped-in-single-arch -test-bug-735967-lib32-to-i386-unavailable test-bug-745046-candidate-propagation-fails -test-bug-747261-arch-specific-conflicts test-bug-753297-upgradable test-bug-758153-versioned-provides-support test-bug-767891-force-essential-important -test-bug-769609-triggers-still-pending-after-run -test-bug-796070-downgrade-simulate -test-bug-960705-propagate-protected-to-satisfied-conflict -test-bug-960705-propagate-protected-to-satisfied-depends test-bug-961266-hold-means-hold -test-bug-lp1562402-nomark-removals-as-keep -test-crossgrades test-dont-forget-conflicts-via-unknown-architectures -test-dpkg-i-apt-install-fix-broken test-explore-or-groups-in-markinstall test-external-dependency-solver-protocol -test-external-installation-planner-protocol -test-handling-broken-orgroups -test-ignore-provides-if-versioned-breaks -test-ignore-provides-if-versioned-conflicts test-method-mirror -test-multiarch-allowed test-multiarch-barbarian -test-multiarch-foreign -test-not-upgrading-removed-depends test-parse-all-archs-into-cache test-phased-updates-new-depends test-phased-updates-upgrade -test-prefer-higher-priority-providers test-prevent-markinstall-multiarch-same-versionscrew test-release-candidate-switching test-resolve-by-keep-new-recommends -test-resolver-delays-remove-decisions test-resolver-provider-exchange -test-specific-architecture-dependencies test-suggests-promoted-to-recommends test-ubuntu-bug-1130419-prefer-installed-ma-same-siblings test-ubuntu-bug-1304403-obsolete-priority-standard -test-ubuntu-bug-1974196 test-ubuntu-bug-1990586 test-ubuntu-bug-2025462-phased-dist-upgrade test-ubuntu-bug-614993 -test-unpack-different-version-unpacked diff --git a/test/integration/test-apt-get-autoremove-real-virtual-provider b/test/integration/test-apt-get-autoremove-real-virtual-provider index 4940ab5ff..d5438f8b3 100755 --- a/test/integration/test-apt-get-autoremove-real-virtual-provider +++ b/test/integration/test-apt-get-autoremove-real-virtual-provider @@ -23,10 +23,20 @@ needs-provider4' aptmark showauto testsuccess aptget check -s +testsuccessequal 'Reading package lists... +Building dependency tree... +Reading state information... +Solving dependencies... +The following packages will be REMOVED: + needs-provider1 needs-provider4 +0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded. +Remv needs-provider1 [1] +Remv needs-provider4 [1]' aptget autoremove -s --solver 3.0 + testsuccessequal 'Reading package lists... Building dependency tree... Reading state information... The following packages will be REMOVED: needs-provider4 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. -Remv needs-provider4 [1]' aptget autoremove -s +Remv needs-provider4 [1]' aptget autoremove -s --solver internal diff --git a/test/integration/test-apt-get-build-dep b/test/integration/test-apt-get-build-dep index 403de8f35..f6158a115 100755 --- a/test/integration/test-apt-get-build-dep +++ b/test/integration/test-apt-get-build-dep @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'i386' insertpackage 'stable' 'build-essential' 'i386' '1' diff --git a/test/integration/test-apt-get-build-dep-barbarian b/test/integration/test-apt-get-build-dep-barbarian index 688f7a54b..b8ab1211b 100755 --- a/test/integration/test-apt-get-build-dep-barbarian +++ b/test/integration/test-apt-get-build-dep-barbarian @@ -83,6 +83,7 @@ testsuccessequal "$(installsfoosamey 'amd64' 'i386')" apt build-dep cool-foo -s testsuccessequal "$(installsfoosamey 'i386' 'i386')" apt build-dep bad-amd64-foo -s -a i386 testsuccessequal "$(installsfoosamey 'amd64' 'i386')" apt build-dep bad-armel-foo -s -a i386 testsuccessequal "$(installsfoosamey 'i386' 'i386')" apt build-dep bad-amd64-armel-foo -s -a i386 +testfailuremsg 'E: Conflict: builddeps:bad-amd64-i386-foo:i386=1 -> not foo:i386=1 -> not builddeps:bad-amd64-i386-foo:i386=1 but builddeps:bad-amd64-i386-foo:i386=1' apt build-dep bad-amd64-i386-foo -s -a i386 --solver 3.0 testfailureequal 'Reading package lists... Reading package lists... Building dependency tree... @@ -94,7 +95,8 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:bad-amd64-i386-foo:i386 : Depends: foo:i386 -E: Unable to correct problems, you have held broken packages.' apt build-dep bad-amd64-i386-foo -s -a i386 +E: Unable to correct problems, you have held broken packages.' apt build-dep bad-amd64-i386-foo -s -a i386 --solver internal +testfailuremsg 'E: Conflict: builddeps:bad-amd64-i386-armel-foo:i386=1 -> not foo:i386=1 -> not builddeps:bad-amd64-i386-armel-foo:i386=1 but builddeps:bad-amd64-i386-armel-foo:i386=1' apt build-dep bad-amd64-i386-armel-foo -s -a i386 --solver 3.0 testfailureequal 'Reading package lists... Reading package lists... Building dependency tree... @@ -106,13 +108,14 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:bad-amd64-i386-armel-foo:i386 : Depends: foo:i386 -E: Unable to correct problems, you have held broken packages.' apt build-dep bad-amd64-i386-armel-foo -s -a i386 +E: Unable to correct problems, you have held broken packages.' apt build-dep bad-amd64-i386-armel-foo -s -a i386 --solver internal testsuccessequal "$(installsfoosamey 'amd64' 'armel')" apt build-dep cool-foo -s -a armel testsuccessequal "$(installsfoosamey 'i386' 'armel')" apt build-dep bad-amd64-foo -s -a armel testsuccessequal "$(installsfoosamey 'amd64' 'armel')" apt build-dep bad-armel-foo -s -a armel testsuccessequal "$(installsfoosamey 'i386' 'armel')" apt build-dep bad-amd64-armel-foo -s -a armel testsuccessequal "$(installsfoosamey 'armel' 'armel')" apt build-dep bad-amd64-i386-foo -s -a armel +FAILUREMSG="E: Conflict: builddeps:bad-amd64-i386-armel-foo:armel=1 -> not foo:armel=1 -> not builddeps:bad-amd64-i386-armel-foo:armel=1 but builddeps:bad-amd64-i386-armel-foo:armel=1" FAILURE='Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -124,8 +127,9 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:bad-amd64-i386-armel-foo:armel : Depends: foo:armel E: Unable to correct problems, you have held broken packages.' +testfailuremsg "$FAILUREMSG" apt build-dep bad-amd64-i386-armel-foo -s -a armel --solver 3.0 testfailureequal "Reading package lists... -$FAILURE" apt build-dep bad-amd64-i386-armel-foo -s -a armel +$FAILURE" apt build-dep bad-amd64-i386-armel-foo -s -a armel --solver internal msgmsg 'BarbarianArchitectures' 'cmdline options' rm rootdir/etc/apt/apt.conf.d/99barbarianarchs @@ -134,7 +138,10 @@ testsuccess aptcache gencaches testsuccessequal "$(installsfoosamey 'mipsel' 'armel')" apt build-dep bad-amd64-i386-armel-foo -s -a armel testsuccess aptcache gencaches -o APT::BarbarianArchitectures::=armel testsuccessequal "$(installsfoosamey 'mipsel' 'armel')" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures::=armel -testfailureequal "$FAILURE" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures::=mipsel -testfailureequal "$FAILURE" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures::=mipsel -o APT::BarbarianArchitectures::=armel +testfailuremsg "$FAILUREMSG" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures::=mipsel --solver 3.0 +testfailuremsg "$FAILUREMSG" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures::=mipsel -o APT::BarbarianArchitectures::=armel --solver 3.0 +testfailuremsg "$FAILUREMSG" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures=mipsel,armel --solver 3.0 +testfailureequal "$FAILURE" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures::=mipsel --solver internal +testfailureequal "$FAILURE" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures::=mipsel -o APT::BarbarianArchitectures::=armel --solver internal testfailureequal "Reading package lists... -$FAILURE" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures=mipsel,armel +$FAILURE" apt build-dep bad-amd64-i386-armel-foo -s -a armel -o APT::BarbarianArchitectures=mipsel,armel --solver internal diff --git a/test/integration/test-apt-get-build-dep-file b/test/integration/test-apt-get-build-dep-file index 88bf10b0f..bd30cfcfd 100755 --- a/test/integration/test-apt-get-build-dep-file +++ b/test/integration/test-apt-get-build-dep-file @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'i386' insertpackage 'stable' 'debhelper' 'i386' '7' @@ -158,6 +159,8 @@ testsuccess aptget build-dep --simulate '..' cd ../.. testfailureequal 'E: Must specify at least one package to check builddeps for' aptget build-dep +testfailuremsg 'W: No architecture information available for armel. See apt.conf(5) APT::Architectures for setup +E: Unsatisfiable dependency group builddeps:./foo-1.0:armel=1 -> debhelper:armel' aptget build-dep --simulate ./foo-1.0 -a armel --solver 3.0 testfailureequal "Note, using directory './foo-1.0' to get the build dependencies Reading package lists... Building dependency tree... @@ -170,7 +173,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:./foo-1.0:armel : Depends: debhelper:armel (>= 7) but it is not installable W: No architecture information available for armel. See apt.conf(5) APT::Architectures for setup -E: Unable to correct problems, you have held broken packages." aptget build-dep --simulate ./foo-1.0 -a armel +E: Unable to correct problems, you have held broken packages." aptget build-dep --simulate ./foo-1.0 -a armel --solver internal testfailureequal 'Reading package lists... E: Unable to find a source package for foo' aptget build-dep --simulate foo diff --git a/test/integration/test-apt-get-install-deb b/test/integration/test-apt-get-install-deb index bcf8bae3d..6cbd25c9f 100755 --- a/test/integration/test-apt-get-install-deb +++ b/test/integration/test-apt-get-install-deb @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' 'i386' # regression test for #754904 @@ -31,6 +32,7 @@ done buildsimplenativepackage 'foo' 'i386,amd64' '1.0' +testfailuremsg "E: Conflict: -> foo:amd64=1.0 but foo:i386=1.0 -> not foo:amd64=1.0" aptget install ./incoming/foo_1.0_i386.deb ./incoming/foo_1.0_amd64.deb -s --solver 3.0 testfailureequal "Reading package lists... Building dependency tree... Note, selecting 'foo:i386' instead of './incoming/foo_1.0_i386.deb' @@ -44,7 +46,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: foo:i386 : Conflicts: foo but 1.0 is to be installed foo : Conflicts: foo:i386 but 1.0 is to be installed -E: Unable to correct problems, you have held broken packages." aptget install ./incoming/foo_1.0_i386.deb ./incoming/foo_1.0_amd64.deb -s +E: Unable to correct problems, you have held broken packages." aptget install ./incoming/foo_1.0_i386.deb ./incoming/foo_1.0_amd64.deb -s --solver internal testsuccess apt show foo --with-source ./incoming/foo_1.0_amd64.deb testequal 'Package: foo @@ -175,7 +177,8 @@ echo 'Package: /pkg-/ Pin: release a=experimental Pin-Priority: 501' > rootdir/etc/apt/preferences.d/pinit -testfailuremsg 'E: Unable to correct problems, you have held broken packages.' aptget install -q=0 ./incoming/pkg-last-line-parse_0_all.deb +testfailuremsg 'E: Unsatisfiable dependency group pkg-last-line-parse:amd64=0 -> pkg-as-it-should-be:amd64' aptget install -q=0 ./incoming/pkg-last-line-parse_0_all.deb --solver 3.0 +testfailuremsg 'E: Unable to correct problems, you have held broken packages.' aptget install -q=0 ./incoming/pkg-last-line-parse_0_all.deb --solver internal testsuccess aptget install ./incoming/pkg-as-it-should-be_0_all.deb testsuccess aptget install ./incoming/pkg-last-line-parse_0_all.deb testsuccess aptget install "$(readlink -f ./incoming/pkg-leading-newline_0_all.deb)" diff --git a/test/integration/test-apt-get-satisfy b/test/integration/test-apt-get-satisfy index 267760ffd..fc7e8050e 100755 --- a/test/integration/test-apt-get-satisfy +++ b/test/integration/test-apt-get-satisfy @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'i386' 'amd64' insertpackage 'stable' 'depends' 'i386' '1' @@ -79,6 +80,8 @@ testrun 'External' 'Reading package lists... Building dependency tree... Execute external solver...' --solver apt +testfailuremsg "E: Unsatisfiable dependency group satisfy:command-line:i386=1 -> depends:i386" aptget satisfy --simulate "depends (>= 2)" "Conflicts: conflicts:i386 (>= 1) [i386], conflicts:amd64 (>= 1) [amd64]" --solver 3.0 + testfailureequal "Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -89,8 +92,10 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: satisfy:command-line : Depends: depends (>= 2) but it is not going to be installed -E: Unable to correct problems, you have held broken packages." aptget satisfy --simulate "depends (>= 2)" "Conflicts: conflicts:i386 (>= 1) [i386], conflicts:amd64 (>= 1) [amd64]" +E: Unable to correct problems, you have held broken packages." aptget satisfy --simulate "depends (>= 2)" "Conflicts: conflicts:i386 (>= 1) [i386], conflicts:amd64 (>= 1) [amd64]" --solver internal +if [ "$APT_SOLVER" != "3.0" ]; then +# FIXME: solver3 doesn't produce nice errors in the external solver scenario testfailureequal "Reading package lists... Building dependency tree... Execute external solver... @@ -109,3 +114,4 @@ The following packages have unmet dependencies: satisfy:command-line : Depends: depends (>= 2) but it is not going to be installed Conflicts: conflicts:i386 (>= 1) E: External solver failed with: The following packages have unmet dependencies:" aptget satisfy --simulate "depends (>= 2)" "Conflicts: conflicts:i386 (>= 1) [i386], conflicts:amd64 (>= 1) [amd64]" --solver apt +fi diff --git a/test/integration/test-apt-get-source-only b/test/integration/test-apt-get-source-only index 93d82844c..b974146ff 100755 --- a/test/integration/test-apt-get-source-only +++ b/test/integration/test-apt-get-source-only @@ -29,6 +29,31 @@ DOWNLOADNOTFOO="Need to get 0 B/33 B of source archives. 'file:${APTARCHIVE}/not-foo_1.0.dsc' not-foo_1.0.dsc 15 SHA256:db578a571c87d2555e90245732042845be4f481755f5b2f5786ac7a26bde9f4f 'file:${APTARCHIVE}/not-foo_1.0.tar.gz' not-foo_1.0.tar.gz 18 SHA256:8701846f1cba0ca81c552ac0ec93e2a89ae113cf2872b9cd51b29b4a9ff6b122" +if [ "$APT_SOLVER" = "3.0" ]; then +BUILDDEPFOO="Reading package lists... +Building dependency tree... +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: + +The following packages have unmet dependencies: + builddeps:foo : Depends: foo-bd but it is not installable +E: Unsatisfiable dependency group builddeps:foo:amd64=1 -> foo-bd:amd64" + +BUILDDEPNOTFOO="Reading package lists... +Building dependency tree... +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: + +The following packages have unmet dependencies: + builddeps:not-foo : Depends: not-foo-bd but it is not installable +E: Unsatisfiable dependency group builddeps:not-foo:amd64=1 -> not-foo-bd:amd64" +else BUILDDEPFOO="Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -52,6 +77,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:not-foo : Depends: not-foo-bd but it is not installable E: Unable to correct problems, you have held broken packages." +fi testsuccessequal "$HEADER Picking 'not-foo' as source package instead of 'foo' diff --git a/test/integration/test-apt-get-upgrade b/test/integration/test-apt-get-upgrade index 50a90ce66..9fb2b41d1 100755 --- a/test/integration/test-apt-get-upgrade +++ b/test/integration/test-apt-get-upgrade @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture "i386" # simple case @@ -60,6 +61,30 @@ Inst upgrade-with-new-dep [1.0] (2.0 unstable [all]) Conf new-dep (1.0 stable [all]) Conf upgrade-simple (2.0 unstable [all]) Conf upgrade-with-new-dep (2.0 unstable [all])' +if [ "$APT_SOLVER" = "3.0" ]; then +# FIXME: It would be better if we would keep back the upgrade rather than switch to sysvinit, +# but it's not clear that is reliably possible. +UPGRADENEW="Reading package lists... +Building dependency tree... +Calculating upgrade... +The following NEW packages will be installed: + new-dep sysvinit +The following packages have been kept back: + upgrade-with-conflict +The following packages will be upgraded: + init upgrade-simple upgrade-with-new-dep +3 upgraded, 2 newly installed, 0 to remove and 1 not upgraded. +Inst sysvinit (2 unstable [all]) +Conf sysvinit (2 unstable [all]) +Inst init [1] (2 unstable [all]) +Inst new-dep (1.0 stable [all]) +Inst upgrade-simple [1.0] (2.0 unstable [all]) +Inst upgrade-with-new-dep [1.0] (2.0 unstable [all]) +Conf init (2 unstable [all]) +Conf new-dep (1.0 stable [all]) +Conf upgrade-simple (2.0 unstable [all]) +Conf upgrade-with-new-dep (2.0 unstable [all])" +fi testsuccessequal "$UPGRADENEW" aptget upgrade -s --with-new-pkgs testsuccessequal "$UPGRADENEW" apt upgrade -s diff --git a/test/integration/test-apt-never-markauto-sections b/test/integration/test-apt-never-markauto-sections index b47966e75..a1fc87389 100755 --- a/test/integration/test-apt-never-markauto-sections +++ b/test/integration/test-apt-never-markauto-sections @@ -47,7 +47,8 @@ Remv foreignpkg:i386 [1] Remv nosection [1] Remv texteditor [1]' aptget autoremove mydesktop -s -testequal 'Reading package lists... +testfailuremsg 'E: Conflict: not texteditor:amd64 -> not texteditor:amd64=1 -> not bad-texteditor:amd64=1 -> not mydesktop-core:amd64=1 but mydesktop:amd64 -> mydesktop:amd64=1 -> mydesktop-core:amd64=1' aptget autoremove texteditor -s --solver 3.0 #-o Debug::pkgDepCache::AutoInstall=1 -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 +testsuccessequal 'Reading package lists... Building dependency tree... Reading state information... The following packages will be REMOVED: @@ -55,8 +56,8 @@ The following packages will be REMOVED: 0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded. Remv mydesktop [1] Remv mydesktop-core [1] -Remv texteditor [1]' aptget autoremove texteditor -s #-o Debug::pkgDepCache::AutoInstall=1 -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -testsuccess aptget autoremove texteditor -y +Remv texteditor [1]' aptget autoremove texteditor -s --solver internal #-o Debug::pkgDepCache::AutoInstall=1 -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 +testsuccess aptget autoremove texteditor -y --solver internal testdpkgnotinstalled mydesktop mydesktop-core texteditor testdpkginstalled browser diff --git a/test/integration/test-bug-549968-install-depends-of-not-installed b/test/integration/test-bug-549968-install-depends-of-not-installed index 90ce58a33..39c86cc8d 100755 --- a/test/integration/test-bug-549968-install-depends-of-not-installed +++ b/test/integration/test-bug-549968-install-depends-of-not-installed @@ -25,4 +25,24 @@ The following NEW packages will be installed: coolstuff 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Inst coolstuff (1.0 unstable [all]) -Conf coolstuff (1.0 unstable [all])" aptget install coolstuff extracoolstuff- -o Debug::pkgDepCache::Marker=1 -s +Conf coolstuff (1.0 unstable [all])" aptget install coolstuff extracoolstuff- -o Debug::pkgDepCache::Marker=1 -s --solver internal + +# We check the Markers here as the autoremove nuker will also +# prevent it, but to late - its better to fail earlier +testsuccessequal "Reading package lists... +Building dependency tree... +Package 'extracoolstuff' is not installed, so not removed +Solving dependencies...MANUAL coolstuff:i386 +[0] Install:coolstuff:i386=1.0 () +Delete extracoolstuff:i386 +[0] Reject:extracoolstuff:i386 () +[0] Reject:extracoolstuff:i386=1.0 (not extracoolstuff:i386) +Optional Item (0@0) coolstuff:i386=1.0 -> | extracoolstuff:i386=1.0 + +Recommended packages: + extracoolstuff +The following NEW packages will be installed: + coolstuff +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Inst coolstuff (1.0 unstable [all]) +Conf coolstuff (1.0 unstable [all])" aptget install coolstuff extracoolstuff- -o Debug::APT::Solver=1 -s --solver 3.0 diff --git a/test/integration/test-bug-596498-trusted-unsigned-repo b/test/integration/test-bug-596498-trusted-unsigned-repo index 4d0e3dc89..2cfdc53fc 100755 --- a/test/integration/test-bug-596498-trusted-unsigned-repo +++ b/test/integration/test-bug-596498-trusted-unsigned-repo @@ -15,10 +15,15 @@ aptgetupdate() { rm -rf rootdir/var/lib/apt/ rootdir/var/cache/apt/*.bin ${1:-testwarning} aptget update --allow-insecure-repositories } - -PKGTEXT="$(aptget install cool --assume-no -d | head -n 8)" -DOWNLOG="$(echo "$PKGTEXT" | tail -n 1)" -PKGTEXT="$(echo "$PKGTEXT" | head -n 7)" +PKGSIZE=$(aptcache show cool | awk '/^Size:/ {print $2}') +PKGTEXT="Reading package lists... +Building dependency tree... +The following NEW packages will be installed: + cool +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +Need to get 0 B/$PKGSIZE B of archives. +After this operation, 11.3 kB of additional disk space will be used." +DOWNLOG="Get:1 file:${TMPWORKINGDIRECTORY}/aptarchive unstable/main i386 cool i386 1.0 [$PKGSIZE B]" DEBFILE='rootdir/etc/apt/sources.list.d/apt-test-unstable-*.list' testsuccessequal "$PKGTEXT diff --git a/test/integration/test-bug-598669-install-postfix-gets-exim-heavy b/test/integration/test-bug-598669-install-postfix-gets-exim-heavy index e7e409391..e27ddb2db 100755 --- a/test/integration/test-bug-598669-install-postfix-gets-exim-heavy +++ b/test/integration/test-bug-598669-install-postfix-gets-exim-heavy @@ -7,6 +7,8 @@ setupenvironment configarchitecture "i386" setupaptarchive +testfailuremsg "E: Conflict: -> postfix:i386=2.7.1-1 but exim4-daemon-light:i386 -> exim4-daemon-light:i386=4.72-1 -> not postfix:i386=2.7.1-1" aptget install postfix --solver 3.0 +allowremovemanual testfailureequal "Reading package lists... Building dependency tree... The following packages will be REMOVED: diff --git a/test/integration/test-bug-601961-install-info b/test/integration/test-bug-601961-install-info index 3e135606d..94a5ad2cf 100755 --- a/test/integration/test-bug-601961-install-info +++ b/test/integration/test-bug-601961-install-info @@ -47,4 +47,17 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: findutils : Depends: essentialpkg but it is not going to be installed -E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.' aptget remove essentialpkg --trivial-only +E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.' aptget remove essentialpkg --trivial-only --solver internal + +testfailureequal 'Reading package lists... +Building dependency tree... +Solving dependencies... +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: + +The following packages have unmet dependencies: + findutils : Depends: essentialpkg but it is not going to be installed +E: Conflict: -> findutils:i386 but not essentialpkg:i386 -> not essentialpkg:i386=4.13a.dfsg.1-6 -> not findutils:i386=4.4.2-1+b1 -> not findutils:i386' aptget remove essentialpkg --trivial-only --solver 3.0 diff --git a/test/integration/test-bug-604222-new-and-autoremove b/test/integration/test-bug-604222-new-and-autoremove index 6a251c8f5..a53fcb76b 100755 --- a/test/integration/test-bug-604222-new-and-autoremove +++ b/test/integration/test-bug-604222-new-and-autoremove @@ -93,6 +93,25 @@ E: Trivial Only specified but this is not a trivial operation." aptget install d rm -f rootdir/var/lib/dpkg/status rootdir/var/lib/apt/extended_states +if [ "$APT_SOLVER" = "3.0" ]; then +CONFLICTING='Reading package lists... +Building dependency tree... +Solving dependencies...MANUAL dummy-archive:i386 +[0] Install:dummy-archive:i386=0.invalid.0 () +[0] Install:libavcodec52:i386=4:0.5.2-6 (dummy-archive:i386=0.invalid.0) +[0] Reject:libvtk5-dev:i386=5.4.2-8 (dummy-archive:i386=0.invalid.0 -> libavcodec52:i386=4:0.5.2-6) +Item (1@0) dummy-archive:i386=0.invalid.0 -> | libvtk5-dev:i386=5.4.2-8 | libopenal-dev:i386=1:1.12.854-2 +[0] Install:libopenal-dev:i386=1:1.12.854-2 (dummy-archive:i386=0.invalid.0) + +The following additional packages will be installed: + libavcodec52 libopenal-dev +The following NEW packages will be installed: + dummy-archive libavcodec52 libopenal-dev +0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded. +Need to get 0 B/126 B of archives. +After this operation, 129 kB of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation.' +else CONFLICTING='Reading package lists... Building dependency tree... MarkInstall dummy-archive:i386 < none -> 0.invalid.0 @un puN Ib > FU=1 @@ -108,10 +127,11 @@ The following NEW packages will be installed: Need to get 0 B/126 B of archives. After this operation, 129 kB of additional disk space will be used. E: Trivial Only specified but this is not a trivial operation.' +fi -testfailureequal "$CONFLICTING" aptget install dummy-archive --trivial-only -o Debug::pkgDepCache::Marker=1 -o APT::Get::HideAutoRemove=0 -testfailureequal "$CONFLICTING" aptget install dummy-archive --trivial-only -o Debug::pkgDepCache::Marker=1 -o APT::Get::HideAutoRemove=1 -testfailureequal "$CONFLICTING" aptget install dummy-archive --trivial-only -o Debug::pkgDepCache::Marker=1 -o APT::Get::HideAutoRemove=small +testfailureequal "$CONFLICTING" aptget install dummy-archive --trivial-only -o Debug::pkgDepCache::Marker=1 -o APT::Get::HideAutoRemove=0 -o Debug::APT::Solver=1 +testfailureequal "$CONFLICTING" aptget install dummy-archive --trivial-only -o Debug::pkgDepCache::Marker=1 -o APT::Get::HideAutoRemove=1 -o Debug::APT::Solver=1 +testfailureequal "$CONFLICTING" aptget install dummy-archive --trivial-only -o Debug::pkgDepCache::Marker=1 -o APT::Get::HideAutoRemove=small -o Debug::APT::Solver=1 insertinstalledpackage 'my-metapackage' 'i386' '1' 'Depends: gwenview' insertinstalledpackage 'gwenview' 'i386' '4:15.08.0-1' 'Depends: libkipi-data diff --git a/test/integration/test-bug-612099-multiarch-conflicts b/test/integration/test-bug-612099-multiarch-conflicts index bc573951d..a005127b8 100755 --- a/test/integration/test-bug-612099-multiarch-conflicts +++ b/test/integration/test-bug-612099-multiarch-conflicts @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'i386' 'amd64' buildsimplenativepackage 'libc6' 'i386' '1.0' 'stable' diff --git a/test/integration/test-bug-612557-garbage-upgrade b/test/integration/test-bug-612557-garbage-upgrade index e0ede7847..2a4c952ee 100755 --- a/test/integration/test-bug-612557-garbage-upgrade +++ b/test/integration/test-bug-612557-garbage-upgrade @@ -17,6 +17,8 @@ testsuccess aptmark markauto python-uno openoffice.org-common #aptmark unmarkauto openoffice.org-emailmerge testmarkedauto python-uno openoffice.org-common +# The 3.0 solver does not remove openoffice.org-emailmerge because it is manually installed. +testfailuremsg "E: Conflict: -> openoffice.org-emailmerge:i386 but python-uno:i386=1:3.3.0-2 -> libreoffice-common:i386=1:3.3.0-2 -> not openoffice.org-common:i386=1:3.2.1-11+squeeze2 -> not openoffice.org-emailmerge:i386=1:3.2.1-11+squeeze2 -> not openoffice.org-emailmerge:i386" aptget --trivial-only install python-uno --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Reading state information... @@ -31,7 +33,7 @@ The following packages will be upgraded: 1 upgraded, 1 newly installed, 2 to remove and 0 not upgraded. Need to get 0 B/84 B of archives. After this operation, 53.2 MB disk space will be freed. -E: Trivial Only specified but this is not a trivial operation.' aptget --trivial-only install python-uno +E: Trivial Only specified but this is not a trivial operation.' aptget --trivial-only install python-uno --solver internal testsuccess aptmark markauto openoffice.org-emailmerge testmarkedauto python-uno openoffice.org-common openoffice.org-emailmerge diff --git a/test/integration/test-bug-613420-new-garbage-dependency b/test/integration/test-bug-613420-new-garbage-dependency index 75a653c7e..0d830971f 100755 --- a/test/integration/test-bug-613420-new-garbage-dependency +++ b/test/integration/test-bug-613420-new-garbage-dependency @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture "i386" insertpackage 'unstable' 'libreoffice' 'all' '1:3.3.1~rc1-2' 'Depends: libreoffice-core' diff --git a/test/integration/test-bug-618848-always-respect-user-requests b/test/integration/test-bug-618848-always-respect-user-requests index 225db299c..8b7b17b77 100755 --- a/test/integration/test-bug-618848-always-respect-user-requests +++ b/test/integration/test-bug-618848-always-respect-user-requests @@ -13,6 +13,17 @@ insertpackage 'unstable' 'exim4-daemon-heavy' 'all' '1.0' 'Depends: libdb4.8' setupaptarchive +# This does not work in 3.0 solver: We do not remove manually installed packages. +testfailuremsg "E: Conflict: not libdb4.8:i386 -> not libdb4.8:i386=1.0 -> not exim4-daemon-light:i386=1.0 -> not exim4:i386=1.0 but exim4:i386 -> exim4:i386=1.0" aptget remove libdb4.8 --solver 3.0 -s +allowremovemanual +testsuccessequal "Reading package lists... +Building dependency tree... +The following packages will be REMOVED: + exim4 exim4-daemon-light libdb4.8 +0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded. +Remv exim4 [1.0] +Remv exim4-daemon-light [1.0] +Remv libdb4.8 [1.0]" aptget remove libdb4.8 -s testsuccessequal "Reading package lists... Building dependency tree... MarkDelete libdb4.8:i386 < 1.0 @ii pmK > FU=1 @@ -28,4 +39,4 @@ Remv exim4 [1.0] MarkDelete exim4-daemon-light:i386 < 1.0 @ii K > FU=1 Remv exim4-daemon-light [1.0] MarkDelete libdb4.8:i386 < 1.0 @ii K > FU=1 -Remv libdb4.8 [1.0]" aptget remove libdb4.8 -s -o Debug::pkgDepCache::Marker=1 +Remv libdb4.8 [1.0]" aptget remove libdb4.8 -s -o Debug::pkgDepCache::Marker=1 --solver internal diff --git a/test/integration/test-bug-632221-cross-dependency-satisfaction b/test/integration/test-bug-632221-cross-dependency-satisfaction index 0cf8d353f..90cb8684f 100755 --- a/test/integration/test-bug-632221-cross-dependency-satisfaction +++ b/test/integration/test-bug-632221-cross-dependency-satisfaction @@ -35,6 +35,7 @@ insertsource 'unstable' 'source-specific-armel' 'armel' '1' 'Build-Depends: spec setupaptarchive +testfailuremsg "E: Unsatisfiable dependency group builddeps:forbidden-no:armel=1 -> amdboot:any:any" aptget build-dep forbidden-no -s -a armel --solver 3.0 testfailureequal 'Reading package lists... Reading package lists... Building dependency tree... @@ -46,7 +47,9 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:forbidden-no:armel : Depends: amdboot:any but it is not installable -E: Unable to correct problems, you have held broken packages.' aptget build-dep forbidden-no -s -a armel +E: Unable to correct problems, you have held broken packages.' aptget build-dep forbidden-no -s -a armel --solver internal + +testfailuremsg "E: Unsatisfiable dependency group builddeps:forbidden-same:armel=1 -> libc6:any:any" aptget build-dep forbidden-same -s -a armel --solver 3.0 testfailureequal 'Reading package lists... Reading package lists... Building dependency tree... @@ -58,7 +61,9 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:forbidden-same:armel : Depends: libc6:any but it is not installable -E: Unable to correct problems, you have held broken packages.' aptget build-dep forbidden-same -s -a armel +E: Unable to correct problems, you have held broken packages.' aptget build-dep forbidden-same -s -a armel --solver internal + +testfailuremsg 'E: Unsatisfiable dependency group builddeps:forbidden-foreign:armel=1 -> doxygen:any:any' aptget build-dep forbidden-foreign -s -a armel --solver 3.0 testfailureequal 'Reading package lists... Reading package lists... Building dependency tree... @@ -70,7 +75,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:forbidden-foreign:armel : Depends: doxygen:any but it is not installable -E: Unable to correct problems, you have held broken packages.' aptget build-dep forbidden-foreign -s -a armel +E: Unable to correct problems, you have held broken packages.' aptget build-dep forbidden-foreign -s -a armel --solver internal testsuccessequal 'Reading package lists... Reading package lists... diff --git a/test/integration/test-bug-64141-install-dependencies-for-on-hold b/test/integration/test-bug-64141-install-dependencies-for-on-hold index fe3bde648..2565c949b 100755 --- a/test/integration/test-bug-64141-install-dependencies-for-on-hold +++ b/test/integration/test-bug-64141-install-dependencies-for-on-hold @@ -19,6 +19,38 @@ insertpackage 'unstable' 'libdb4.8' 'native' '4.8.30-3' setupaptarchive +# Solver 3.0 does not remove manual packages +testfailureequal 'Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages have been kept back: + apt +The following packages will be upgraded: + libc6 +1 upgraded, 0 newly installed, 0 to remove and 1 not upgraded. +Need to get 0 B/42 B of archives. +After this operation, 0 B of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation.' aptget dist-upgrade --trivial-only --solver 3.0 + +testfailure aptget dist-upgrade --trivial-only --solver 3.0 -o debug::apt::solver=2 +testsuccess grep -Fx 'Branch failed: Conflict: apt:amd64 -> apt:amd64=0.8.10 -> not oldcrap:amd64=1-1 but oldcrap:amd64 -> oldcrap:amd64=1-1' rootdir/tmp/testfailure.output + +allowremovemanual + +testfailureequal 'Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages will be REMOVED: + oldcrap +The following NEW packages will be installed: + libdb4.8 +The following packages will be upgraded: + apt libc6 +2 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. +Need to get 0 B/126 B of archives. +After this operation, 0 B of additional disk space will be used. +E: Trivial Only specified but this is not a trivial operation.' aptget dist-upgrade --trivial-only + testfailureequal 'Reading package lists... Building dependency tree... Calculating upgrade... diff --git a/test/integration/test-bug-657695-resolver-breaks-on-virtuals b/test/integration/test-bug-657695-resolver-breaks-on-virtuals index 42b85218b..e3ff6d1b5 100755 --- a/test/integration/test-bug-657695-resolver-breaks-on-virtuals +++ b/test/integration/test-bug-657695-resolver-breaks-on-virtuals @@ -16,6 +16,15 @@ insertpackage 'unstable' 'xserver-xorg-core' 'amd64' '2:1.11.3-0ubuntu9' 'Breaks setupaptarchive +testsuccessequal 'Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages have been kept back: + xserver-xorg-core +0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.' aptget dist-upgrade --trivial-only --solver 3.0 + +allowremovemanual + testfailureequal 'Reading package lists... Building dependency tree... Calculating upgrade... diff --git a/test/integration/test-bug-683786-build-dep-on-virtual-packages b/test/integration/test-bug-683786-build-dep-on-virtual-packages index 831e1f831..45e40e20e 100755 --- a/test/integration/test-bug-683786-build-dep-on-virtual-packages +++ b/test/integration/test-bug-683786-build-dep-on-virtual-packages @@ -41,6 +41,7 @@ The following NEW packages will be installed: Inst po-debconf (1 unstable [all]) Conf po-debconf (1 unstable [all])' aptget build-dep dash -s +testfailuremsg 'E: Unsatisfiable dependency group builddeps:dash:armel=1 -> po-debconf:armel' aptget build-dep -aarmel dash -s --solver 3.0 testfailureequal 'Reading package lists... Reading package lists... Building dependency tree... @@ -52,7 +53,9 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:dash:armel : Depends: po-debconf:armel but it is not installable -E: Unable to correct problems, you have held broken packages.' aptget build-dep -aarmel dash -s +E: Unable to correct problems, you have held broken packages.' aptget build-dep -aarmel dash -s --solver internal + +testfailuremsg 'E: Unsatisfiable dependency group builddeps:diffutils:armel=1 -> texi2html:armel' aptget build-dep -aarmel diffutils -s --solver 3.0 testfailureequal 'Reading package lists... Reading package lists... Building dependency tree... @@ -64,7 +67,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:diffutils:armel : Depends: texi2html:armel but it is not installable -E: Unable to correct problems, you have held broken packages.' aptget build-dep -aarmel diffutils -s +E: Unable to correct problems, you have held broken packages.' aptget build-dep -aarmel diffutils -s --solver internal testsuccessequal "Reading package lists... Reading package lists... @@ -75,6 +78,7 @@ The following NEW packages will be installed: Inst libselinux1-dev (1 unstable [amd64]) Conf libselinux1-dev (1 unstable [amd64])" aptget build-dep sed -s +testfailuremsg 'E: Unsatisfiable dependency group builddeps:sed:armel=1 -> libselinux-dev:armel' aptget build-dep -aarmel sed -s --solver 3.0 testfailureequal 'Reading package lists... Reading package lists... Building dependency tree... @@ -86,7 +90,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:sed:armel : Depends: libselinux-dev:armel but it is not installable -E: Unable to correct problems, you have held broken packages.' aptget build-dep -aarmel sed -s +E: Unable to correct problems, you have held broken packages.' aptget build-dep -aarmel sed -s --solver internal testsuccessequal "Reading package lists... Reading package lists... diff --git a/test/integration/test-bug-686346-package-missing-architecture b/test/integration/test-bug-686346-package-missing-architecture index d28600a4f..a064e5d73 100755 --- a/test/integration/test-bug-686346-package-missing-architecture +++ b/test/integration/test-bug-686346-package-missing-architecture @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' insertinstalledpackage 'pkgb' 'none' '1' diff --git a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch index 9c96bbe52..3bad6174a 100755 --- a/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch +++ b/test/integration/test-bug-712116-dpkg-pre-install-pkgs-hook-multiarch @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' 'i386' buildsimplenativepackage 'toolkit' 'all' '1' 'stable' 'Multi-Arch: foreign' @@ -89,7 +90,8 @@ stuff 2 amd64 none > - - none **REMOVE**' testfileequal "${hook}-v2.list" 'libsame 2 > - **REMOVE**' testfileequal "${hook}-v3.list" 'libsame 2 amd64 same > - - none **REMOVE**' - observehook install stuff:i386/stable libsame:i386/stable toolkit/stable + # FIXME: solver3: This should not require no-strict-pinning + observehook install stuff:i386/stable libsame:i386/stable toolkit/stable $(test "$APT_SOLVER" != "3.0" || printf '%s' '--no-strict-pinning') testfileequal "${hook}-v2.list" 'libsame 2 > 1 **CONFIGURE** stuff 2 > 1 **CONFIGURE** toolkit 2 > 1 **CONFIGURE**' diff --git a/test/integration/test-bug-720597-build-dep-purge b/test/integration/test-bug-720597-build-dep-purge index 4b36989ee..9ff0d23f4 100755 --- a/test/integration/test-bug-720597-build-dep-purge +++ b/test/integration/test-bug-720597-build-dep-purge @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual # we need this construct here as it isn't really possible to fake native arch for dpkg-* tools NATIVE="$(command dpkg --print-architecture)" diff --git a/test/integration/test-bug-723586-any-stripped-in-single-arch b/test/integration/test-bug-723586-any-stripped-in-single-arch index 38eb026ff..441bc29c2 100755 --- a/test/integration/test-bug-723586-any-stripped-in-single-arch +++ b/test/integration/test-bug-723586-any-stripped-in-single-arch @@ -29,6 +29,20 @@ Inst python3-gnupg (0.3.5-2 stable [all]) Conf python3 (3.3.2-16 unstable [amd64]) Conf python3-gnupg (0.3.5-2 stable [all])' +if [ "$APT_SOLVER" = "3.0" ]; then +FAILLOG='Reading package lists... +Building dependency tree... +Solving dependencies... +Some packages could not be installed. This may mean that you have +requested an impossible situation or if you are using the unstable +distribution that some required packages have not yet been created +or been moved out of Incoming. +The following information may help to resolve the situation: + +The following packages have unmet dependencies: + python-mips : Depends: python3:mips but it is not installable +E: Unsatisfiable dependency group python-mips:amd64=3 -> python3:mips:any' +else FAILLOG='Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -40,6 +54,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: python-mips : Depends: python3:mips but it is not installable E: Unable to correct problems, you have held broken packages.' +fi testsuccessequal "$INSTALLLOG" aptget install python3-gnupg -s aptcache showpkg python3 > showpkg.log diff --git a/test/integration/test-bug-735967-lib32-to-i386-unavailable b/test/integration/test-bug-735967-lib32-to-i386-unavailable index b836451fd..a44e58570 100755 --- a/test/integration/test-bug-735967-lib32-to-i386-unavailable +++ b/test/integration/test-bug-735967-lib32-to-i386-unavailable @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'i386' 'amd64' insertpackage 'unstable' 'lib32nss-mdns' 'amd64' '0.10-6' 'Depends: libnss-mdns-i386 (= 0.10-6)' @@ -31,6 +32,12 @@ setupaptarchive --no-update configarchitecture 'amd64' testsuccess aptget update +testsuccessequal 'Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages have been kept back: + lib32nss-mdns libnss-mdns +0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.' aptget dist-upgrade -s --solver 3.0 testsuccessequal 'Reading package lists... Building dependency tree... Calculating upgrade... @@ -41,8 +48,9 @@ The following packages will be upgraded: 1 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. Remv lib32nss-mdns [0.9-1] Inst libnss-mdns [0.9-1] (0.10-6 unstable [amd64]) -Conf libnss-mdns (0.10-6 unstable [amd64])' aptget dist-upgrade -s +Conf libnss-mdns (0.10-6 unstable [amd64])' aptget dist-upgrade -s --solver internal +testfailuremsg 'E: Unsatisfiable dependency group libfoo:amd64=1 -> libfoo-bin:amd64' aptget install foo -s --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -53,7 +61,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: libfoo : Depends: libfoo-bin but it is not installable -E: Unable to correct problems, you have held broken packages.' aptget install foo -s +E: Unable to correct problems, you have held broken packages.' aptget install foo -s --solver internal # activate multiarch configarchitecture 'amd64' 'i386' diff --git a/test/integration/test-bug-747261-arch-specific-conflicts b/test/integration/test-bug-747261-arch-specific-conflicts index e1370433f..093542d1c 100755 --- a/test/integration/test-bug-747261-arch-specific-conflicts +++ b/test/integration/test-bug-747261-arch-specific-conflicts @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' 'sparc' 'armel' insertinstalledpackage 'foobar' 'armel' '1' diff --git a/test/integration/test-bug-769609-triggers-still-pending-after-run b/test/integration/test-bug-769609-triggers-still-pending-after-run index ce2c193dd..0a2dd25c8 100755 --- a/test/integration/test-bug-769609-triggers-still-pending-after-run +++ b/test/integration/test-bug-769609-triggers-still-pending-after-run @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' msgtest 'Check if installed dpkg supports' 'noawait trigger' diff --git a/test/integration/test-bug-796070-downgrade-simulate b/test/integration/test-bug-796070-downgrade-simulate index 61ecc87d4..d1b6b7f8f 100755 --- a/test/integration/test-bug-796070-downgrade-simulate +++ b/test/integration/test-bug-796070-downgrade-simulate @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'i386' insertpackage 'unstable' 'apt' 'all' '1.0.10.1' 'Depends: libapt-pkg4.16 (>= 1.0.10.1)' diff --git a/test/integration/test-bug-960705-propagate-protected-to-satisfied-conflict b/test/integration/test-bug-960705-propagate-protected-to-satisfied-conflict index 272378b01..270536fae 100755 --- a/test/integration/test-bug-960705-propagate-protected-to-satisfied-conflict +++ b/test/integration/test-bug-960705-propagate-protected-to-satisfied-conflict @@ -15,6 +15,7 @@ Important: yes' setupaptarchive +# This only works on internal, we do not have magic essential autoswitch ability for 3.0 testsuccessequal "Reading package lists... Building dependency tree... Removing: systemd-sysv:amd64 as upgrade is not an option for runit-init:amd64 (1) @@ -50,4 +51,4 @@ Remv init [1] MarkDelete systemd-sysv:amd64 < 1 | none @ii H > FU=1 Remv systemd-sysv [1] Inst runit-init (1 unstable [all]) -Conf runit-init (1 unstable [all])" apt install runit-init -so Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 -o APT::Get::Allow-Solver-Remove-Essential=1 +Conf runit-init (1 unstable [all])" apt install runit-init -so Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 -o APT::Get::Allow-Solver-Remove-Essential=1 --solver internal diff --git a/test/integration/test-bug-960705-propagate-protected-to-satisfied-depends b/test/integration/test-bug-960705-propagate-protected-to-satisfied-depends index ca6bf8d7c..da11fc881 100755 --- a/test/integration/test-bug-960705-propagate-protected-to-satisfied-depends +++ b/test/integration/test-bug-960705-propagate-protected-to-satisfied-depends @@ -18,6 +18,35 @@ insertpackage 'unstable' 'fine-foo' 'all' '1' setupaptarchive +testsuccessequal "Reading package lists... +Building dependency tree... +Solving dependencies...MANUAL foobar:amd64 +[0] Install:foobar:amd64=1 () +[0] Install:requires-foo:amd64=1 (foobar:amd64=1) +[0] Install:foo:amd64=1 (foobar:amd64=1 -> requires-foo:amd64=1) +[0] Install:foo-depends:amd64=1 (foobar:amd64=1 -> requires-foo:amd64=1 -> foo:amd64=1) +Item (2@0) foobar:amd64=1 -> | conflicts-foo:amd64=1 | fine-foo:amd64=1 +[1] Install:conflicts-foo:amd64=1 (foobar:amd64=1) +[0] Reject:conflicts-foo:amd64=1 () +Item (1@0) foobar:amd64=1 -> | conflicts-foo:amd64=1 | fine-foo:amd64=1 +[0] Install:fine-foo:amd64=1 (foobar:amd64=1) + +The following additional packages will be installed: + fine-foo foo foo-depends requires-foo +The following NEW packages will be installed: + fine-foo foo foo-depends foobar requires-foo +0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded. +Inst fine-foo (1 unstable [all]) +Inst foo-depends (1 unstable [all]) +Inst foo (1 unstable [all]) +Inst requires-foo (1 unstable [all]) +Inst foobar (1 unstable [all]) +Conf fine-foo (1 unstable [all]) +Conf foo-depends (1 unstable [all]) +Conf foo (1 unstable [all]) +Conf requires-foo (1 unstable [all]) +Conf foobar (1 unstable [all])" apt install foobar -so Debug::APT::Solver=1 --solver 3.0 + testsuccessequal "Reading package lists... Building dependency tree... Installing foo:amd64 as Depends of foobar:amd64 @@ -42,4 +71,4 @@ Conf fine-foo (1 unstable [all]) Conf foo-depends (1 unstable [all]) Conf foo (1 unstable [all]) Conf requires-foo (1 unstable [all]) -Conf foobar (1 unstable [all])" apt install foobar -so Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::AutoInstall=1 +Conf foobar (1 unstable [all])" apt install foobar -so Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::AutoInstall=1 --solver internal diff --git a/test/integration/test-bug-lp1562402-nomark-removals-as-keep b/test/integration/test-bug-lp1562402-nomark-removals-as-keep index 6e8225aa4..41a9591fa 100755 --- a/test/integration/test-bug-lp1562402-nomark-removals-as-keep +++ b/test/integration/test-bug-lp1562402-nomark-removals-as-keep @@ -18,6 +18,15 @@ insertinstalledpackage 'maas-region-controller' 'all' '2.0.0~alpha3+bzr4810-0ubu setupaptarchive +testsuccessequal 'Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages have been kept back: + maas-common maas-region-controller maas-region-controller-min +0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.' aptget dist-upgrade -s --solver 3.0 + +allowremovemanual + testsuccess aptget dist-upgrade -s -o Debug::pkgDepCache::AutoInstall=true -o Debug::pkgPackageManager=yes -o Debug::pkgProblemResolver=yes testsuccessequal 'Reading package lists... Building dependency tree... diff --git a/test/integration/test-crossgrades b/test/integration/test-crossgrades index 6398e7e7f..b42821539 100755 --- a/test/integration/test-crossgrades +++ b/test/integration/test-crossgrades @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'i386' 'amd64' 'armel' configdpkgnoopchroot diff --git a/test/integration/test-dpkg-i-apt-install-fix-broken b/test/integration/test-dpkg-i-apt-install-fix-broken index 0b75b5fb1..5c517aaef 100755 --- a/test/integration/test-dpkg-i-apt-install-fix-broken +++ b/test/integration/test-dpkg-i-apt-install-fix-broken @@ -14,6 +14,28 @@ setupaptarchive testfailure dpkg -i incoming/autopkgtest-*.deb testsuccessequal 'Reading package lists... Building dependency tree... +Correcting dependencies...MANUAL autopkgtest-satdep:amd64 +[0] Install:autopkgtest-satdep:amd64 () +[0] Install:autopkgtest-satdep:amd64=1 (autopkgtest-satdep:amd64) +[0] Install:debhelper:amd64=1 (autopkgtest-satdep:amd64 -> autopkgtest-satdep:amd64=1) + Done +Solving dependencies...AUTOMATIC debhelper:amd64 - upgrade +MANUAL autopkgtest-satdep:amd64 +[0] Install:autopkgtest-satdep:amd64 () +[0] Install:autopkgtest-satdep:amd64=1 (autopkgtest-satdep:amd64) +[0] Install:debhelper:amd64=1 (autopkgtest-satdep:amd64 -> autopkgtest-satdep:amd64=1) + +The following additional packages will be installed: + debhelper +The following NEW packages will be installed: + debhelper +0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. +1 not fully installed or removed. +Inst debhelper (1 stable [all]) +Conf debhelper (1 stable [all]) +Conf autopkgtest-satdep (1 stable [amd64])' apt install -fso Debug::APT::Solver=1 --solver 3.0 +testsuccessequal 'Reading package lists... +Building dependency tree... Correcting dependencies... MarkInstall autopkgtest-satdep:amd64 < 1 @iU K Nb Ib > FU=0 MarkInstall debhelper:amd64 < none -> 1 @un uN > FU=0 Starting pkgProblemResolver with broken count: 0 @@ -31,4 +53,4 @@ The following NEW packages will be installed: 1 not fully installed or removed. Inst debhelper (1 stable [all]) Conf debhelper (1 stable [all]) -Conf autopkgtest-satdep (1 stable [amd64])' apt install -fso Debug::pkgProblemResolver=1 -o DEbug::pkgDepCache::Marker=1 +Conf autopkgtest-satdep (1 stable [amd64])' apt install -fso Debug::pkgProblemResolver=1 -o DEbug::pkgDepCache::Marker=1 --solver internal diff --git a/test/integration/test-external-installation-planner-protocol b/test/integration/test-external-installation-planner-protocol index 192f21bb3..1a04d2493 100755 --- a/test/integration/test-external-installation-planner-protocol +++ b/test/integration/test-external-installation-planner-protocol @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' buildsimplenativepackage 'libfoo' 'amd64' '3' 'experimental' 'Multi-Arch: same' diff --git a/test/integration/test-handling-broken-orgroups b/test/integration/test-handling-broken-orgroups index 564ea8839..1c20ae4f1 100755 --- a/test/integration/test-handling-broken-orgroups +++ b/test/integration/test-handling-broken-orgroups @@ -47,6 +47,7 @@ Inst coolstuff2 (1.0-1 unstable [all]) Conf stuff (1.0-1 unstable [all]) Conf coolstuff2 (1.0-1 unstable [all])' aptget install coolstuff2 -s +testfailuremsg 'E: Unsatisfiable dependency group coolstuff-broken:i386=1.0-1 -> cool2:i386' aptget install coolstuff-broken --solver 3.0 -s testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -58,7 +59,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: coolstuff-broken : Depends: cool2 but it is not installable or stuff2 but it is not installable -E: Unable to correct problems, you have held broken packages.' aptget install coolstuff-broken -s +E: Unable to correct problems, you have held broken packages.' aptget install coolstuff-broken --solver internal -s testsuccessequal 'Reading package lists... Building dependency tree... @@ -94,6 +95,7 @@ Inst coolstuff-provided (1.0-1 unstable [all]) Conf extrastuff (1.0-1 unstable [all]) Conf coolstuff-provided (1.0-1 unstable [all])' aptget install coolstuff-provided -s +testfailuremsg 'E: Unsatisfiable dependency group coolstuff-provided-broken:i386=1.0-1 -> cool2:i386' aptget install coolstuff-provided-broken --solver 3.0 -s testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -105,4 +107,4 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: coolstuff-provided-broken : Depends: cool2 but it is not installable or stuff-abi-2 -E: Unable to correct problems, you have held broken packages.' aptget install coolstuff-provided-broken -s +E: Unable to correct problems, you have held broken packages.' aptget install coolstuff-provided-broken --solver internal -s diff --git a/test/integration/test-ignore-provides-if-versioned-breaks b/test/integration/test-ignore-provides-if-versioned-breaks index ebcbecf47..7947d6d01 100755 --- a/test/integration/test-ignore-provides-if-versioned-breaks +++ b/test/integration/test-ignore-provides-if-versioned-breaks @@ -32,7 +32,10 @@ insertpackage 'unstable' 'foo-same-breaker-none' 'i386' '1.0' 'Breaks: foo-same' setupaptarchive - +testfailuremsg 'E: Conflict: foo:i386 but no versions are installable +E: Uninstallable version: foo-breaker-none:i386=1.0 -> not foo:i386=4.0 +E: Uninstallable version: foo-breaker-none:i386=1.0 -> not foo:i386=2.0 +E: Uninstallable version: foo-breaker-none:i386=1.0 -> not foo:i386=2.0' aptget install foo-provider foo-breaker-none -s --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -43,7 +46,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: foo-breaker-none : Breaks: foo -E: Unable to correct problems, you have held broken packages.' aptget install foo-provider foo-breaker-none -s +E: Unable to correct problems, you have held broken packages.' aptget install foo-provider foo-breaker-none -s --solver internal testsuccessequal 'Reading package lists... Building dependency tree... @@ -71,6 +74,10 @@ Conf foo (4.0 unstable [i386]) Conf foo-breaker-3 (1.0 unstable [i386]) Conf foo-provider (1.0 unstable [i386])' aptget install foo-provider foo-breaker-3 -s +testfailuremsg 'E: Conflict: foo-foreign:amd64 but no versions are installable +E: Uninstallable version: foo-foreign-breaker-none:i386=1.0 -> not foo-foreign:amd64=4.0 +E: Uninstallable version: foo-foreign-breaker-none:i386=1.0 -> not foo-foreign:amd64=2.0 +E: Uninstallable version: foo-foreign-breaker-none:i386=1.0 -> not foo-foreign:amd64=4.0' aptget install foo-foreign-provider foo-foreign-breaker-none -s --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -81,7 +88,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: foo-foreign-breaker-none : Breaks: foo-foreign -E: Unable to correct problems, you have held broken packages.' aptget install foo-foreign-provider foo-foreign-breaker-none -s +E: Unable to correct problems, you have held broken packages.' aptget install foo-foreign-provider foo-foreign-breaker-none -s --solver internal testsuccessequal 'Reading package lists... Building dependency tree... @@ -109,6 +116,7 @@ Conf foo-foreign:amd64 (4.0 unstable [amd64]) Conf foo-foreign-breaker-3 (1.0 unstable [i386]) Conf foo-foreign-provider (1.0 unstable [i386])' aptget install foo-foreign-provider foo-foreign-breaker-3 -s +testfailuremsg 'E: Conflict: -> foo-same:i386 but foo-same-breaker-none:i386=1.0 -> not foo-same:i386=2.0 -> not foo-same:i386' aptget install foo-same-provider foo-same-breaker-none -s --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -119,7 +127,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: foo-same-breaker-none : Breaks: foo-same -E: Unable to correct problems, you have held broken packages.' aptget install foo-same-provider foo-same-breaker-none -s +E: Unable to correct problems, you have held broken packages.' aptget install foo-same-provider foo-same-breaker-none -s --solver internal testsuccessequal 'Reading package lists... Building dependency tree... diff --git a/test/integration/test-ignore-provides-if-versioned-conflicts b/test/integration/test-ignore-provides-if-versioned-conflicts index 3243cfb51..dd24263d1 100755 --- a/test/integration/test-ignore-provides-if-versioned-conflicts +++ b/test/integration/test-ignore-provides-if-versioned-conflicts @@ -33,6 +33,10 @@ insertpackage 'unstable' 'foo-same-breaker-none' 'i386' '1.0' 'Conflicts: foo-sa setupaptarchive +testfailuremsg 'E: Conflict: foo:i386 but no versions are installable +E: Uninstallable version: foo-breaker-none:i386=1.0 -> not foo:i386=4.0 +E: Uninstallable version: foo-breaker-none:i386=1.0 -> not foo:i386=2.0 +E: Uninstallable version: foo-breaker-none:i386=1.0 -> not foo:i386=2.0' aptget install foo-provider foo-breaker-none -s --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -43,7 +47,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: foo-breaker-none : Conflicts: foo -E: Unable to correct problems, you have held broken packages.' aptget install foo-provider foo-breaker-none -s +E: Unable to correct problems, you have held broken packages.' aptget install foo-provider foo-breaker-none -s --solver internal testsuccessequal 'Reading package lists... Building dependency tree... @@ -71,6 +75,10 @@ Conf foo (4.0 unstable [i386]) Conf foo-breaker-3 (1.0 unstable [i386]) Conf foo-provider (1.0 unstable [i386])' aptget install foo-provider foo-breaker-3 -s +testfailuremsg 'E: Conflict: foo-foreign:amd64 but no versions are installable +E: Uninstallable version: foo-foreign-breaker-none:i386=1.0 -> not foo-foreign:amd64=4.0 +E: Uninstallable version: foo-foreign-breaker-none:i386=1.0 -> not foo-foreign:amd64=2.0 +E: Uninstallable version: foo-foreign-breaker-none:i386=1.0 -> not foo-foreign:amd64=4.0' aptget install foo-foreign-provider foo-foreign-breaker-none -s --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -81,7 +89,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: foo-foreign-breaker-none : Conflicts: foo-foreign -E: Unable to correct problems, you have held broken packages.' aptget install foo-foreign-provider foo-foreign-breaker-none -s +E: Unable to correct problems, you have held broken packages.' aptget install foo-foreign-provider foo-foreign-breaker-none -s --solver internal testsuccessequal 'Reading package lists... Building dependency tree... @@ -109,6 +117,7 @@ Conf foo-foreign:amd64 (4.0 unstable [amd64]) Conf foo-foreign-breaker-3 (1.0 unstable [i386]) Conf foo-foreign-provider (1.0 unstable [i386])' aptget install foo-foreign-provider foo-foreign-breaker-3 -s +testfailuremsg 'E: Conflict: -> foo-same:i386 but foo-same-breaker-none:i386=1.0 -> not foo-same:i386=2.0 -> not foo-same:i386' aptget install foo-same-provider foo-same-breaker-none -s --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -119,7 +128,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: foo-same-breaker-none : Conflicts: foo-same -E: Unable to correct problems, you have held broken packages.' aptget install foo-same-provider foo-same-breaker-none -s +E: Unable to correct problems, you have held broken packages.' aptget install foo-same-provider foo-same-breaker-none -s --solver internal testsuccessequal 'Reading package lists... Building dependency tree... diff --git a/test/integration/test-multiarch-allowed b/test/integration/test-multiarch-allowed index fc63d0e33..298867c5f 100755 --- a/test/integration/test-multiarch-allowed +++ b/test/integration/test-multiarch-allowed @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' 'i386' insertpackage 'unstable' 'foo' 'amd64,i386' '1' 'Multi-Arch: allowed' @@ -63,20 +64,23 @@ Inst needsfoo:i386 (1 unstable [i386]) Conf foo:i386 (1 unstable [i386]) Conf needsfoo:i386 (1 unstable [i386])' aptget install needsfoo:i386 -s # FIXME: same problem, but two different unmet dependency messages depending on install order +testfailuremsg "E: Conflict: -> needsfoo:i386=1 but foo:amd64=1 -> not foo:i386=1 -> not needsfoo:i386=1" aptget install needsfoo:i386 foo:amd64 -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: foo : Conflicts: foo:i386 but 1 is to be installed foo:i386 : Conflicts: foo but 1 is to be installed -E: Unable to correct problems, you have held broken packages." aptget install needsfoo:i386 foo:amd64 -s +E: Unable to correct problems, you have held broken packages." aptget install needsfoo:i386 foo:amd64 -s --solver internal +testfailuremsg "E: Conflict: -> needsfoo:i386=1 but foo:amd64=1 -> not foo:i386=1 -> not needsfoo:i386=1" aptget install foo:amd64 needsfoo:i386 -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: needsfoo:i386 : Depends: foo:i386 but it is not installable -E: Unable to correct problems, you have held broken packages." aptget install foo:amd64 needsfoo:i386 -s +E: Unable to correct problems, you have held broken packages." aptget install foo:amd64 needsfoo:i386 -s --solver internal +testfailuremsg "E: Conflict: -> needsfoo:amd64=1 but foo:i386=1 -> not foo:amd64=1 -> not needsfoo:amd64=1" aptget install needsfoo foo:i386 -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: foo : Conflicts: foo:i386 but 1 is to be installed foo:i386 : Conflicts: foo but 1 is to be installed -E: Unable to correct problems, you have held broken packages." aptget install needsfoo foo:i386 -s +E: Unable to correct problems, you have held broken packages." aptget install needsfoo foo:i386 -s --solver internal solveableinsinglearch1() { testsuccessequal "Reading package lists... @@ -127,6 +131,16 @@ Conf $1 (1 unstable [amd64])" aptget install $1 foo:i386 -s testneedsfooallgood 'needsfooany' testneedsfooallgood 'needsfoover1' +if [ "$APT_SOLVER" = "3.0" ]; then +NEEDSFOO2NATIVE="$BADPREFIX +The following packages have unmet dependencies: + needsfoover2 : Depends: foo:any (>= 2) +E: Unsatisfiable dependency group needsfoover2:amd64=1 -> foo:any:any" +NEEDSFOO2FOREIGN="$BADPREFIX +The following packages have unmet dependencies: + needsfoover2:i386 : Depends: foo:any (>= 2) +E: Unsatisfiable dependency group needsfoover2:i386=1 -> foo:any:any" +else NEEDSFOO2NATIVE="$BADPREFIX The following packages have unmet dependencies: needsfoover2 : Depends: foo:any (>= 2) @@ -135,32 +149,38 @@ NEEDSFOO2FOREIGN="$BADPREFIX The following packages have unmet dependencies: needsfoover2:i386 : Depends: foo:any (>= 2) E: Unable to correct problems, you have held broken packages." +fi testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 -s testfailureequal "$NEEDSFOO2FOREIGN" aptget install needsfoover2:i386 -s testfailureequal "$NEEDSFOO2FOREIGN" aptget install needsfoover2:i386 foo:i386 -s testfailureequal "$NEEDSFOO2NATIVE" aptget install needsfoover2 foo:i386 -s solveableinsinglearch2() { + testfailuremsg 'E: Conflict: hatesfoo:amd64=1 -> not foo:amd64=1 but foo:amd64=1' aptget install foo hatesfoo -s --solver 3.0 + testfailuremsg 'E: Conflict: hatesfooany:amd64=1 -> not foo:amd64=1 but foo:amd64=1' aptget install foo hatesfooany -s --solver 3.0 + testfailuremsg 'E: Conflict: hatesfoonative:amd64=1 -> not foo:amd64=1 but foo:amd64=1' aptget install foo hatesfoonative -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: hatesfoo : Conflicts: foo but 1 is to be installed -E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoo -s +E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoo -s --solver internal # the message differs slightly between single and multiarch - testfailuremsg 'E: Unable to correct problems, you have held broken packages.' aptget install foo hatesfooany -s + testfailuremsg 'E: Unable to correct problems, you have held broken packages.' aptget install foo hatesfooany -s --solver internal testfailureequal "$BADPREFIX The following packages have unmet dependencies: hatesfoonative : Conflicts: foo:amd64 -E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoonative -s +E: Unable to correct problems, you have held broken packages." aptget install foo hatesfoonative -s --solver internal } solveableinsinglearch2 +testfailuremsg "E: Conflict: hatesfoo:amd64=1 -> not foo:i386=1 but foo:i386=1" aptget install foo:i386 hatesfoo -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: hatesfoo : Conflicts: foo:i386 but 1 is to be installed -E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfoo -s +E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfoo -s --solver internal +testfailuremsg "E: Conflict: hatesfooany:amd64=1 -> not foo:i386=1 but foo:i386=1" aptget install foo:i386 hatesfooany -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: hatesfooany : Conflicts: foo:any -E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfooany -s +E: Unable to correct problems, you have held broken packages." aptget install foo:i386 hatesfooany -s --solver internal testsuccessequal 'Reading package lists... Building dependency tree... The following NEW packages will be installed: @@ -171,11 +191,12 @@ Inst hatesfoonative (1 unstable [amd64]) Conf foo:i386 (1 unstable [i386]) Conf hatesfoonative (1 unstable [amd64])' aptget install foo:i386 hatesfoonative -s +testfailuremsg "E: Unsatisfiable dependency group needscoolfoo:i386=1 -> coolfoo:i386" aptget install needscoolfoo:i386 -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: needscoolfoo:i386 : Depends: coolfoo:i386 but it is not installable Depends: coolbar:i386 but it is not installable -E: Unable to correct problems, you have held broken packages." aptget install needscoolfoo:i386 -s +E: Unable to correct problems, you have held broken packages." aptget install needscoolfoo:i386 -s --solver internal solveneedscoolfooanyin() { local NEEDSCOOL='needscoolfooany' if [ "$1" != 'amd64' ]; then NEEDSCOOL="${NEEDSCOOL}:$1"; fi @@ -243,15 +264,17 @@ Inst needscoolfoover1 (1 unstable [amd64]) Conf coolfoo (1 unstable [amd64]) Conf coolfoover (1 unstable [amd64]) Conf needscoolfoover1 (1 unstable [amd64])' aptget install needscoolfoover1 -s + testfailuremsg "E: Unsatisfiable dependency group needscoolfoover2:amd64=1 -> coolfoo:any:any" aptget install needscoolfoover2 -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: needscoolfoover2 : Depends: coolfoo:any (>= 2) -E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover2 -s +E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover2 -s --solver internal + testfailuremsg "E: Unsatisfiable dependency group needscoolfoover3:amd64=1 -> coolfoo:any:any" aptget install needscoolfoover3 -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: needscoolfoover3 : Depends: coolfoo:any (>= 2) Depends: coolbar:any (>= 3) -E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover3 -s +E: Unable to correct problems, you have held broken packages." aptget install needscoolfoover3 -s --solver internal } solveableinsinglearch3 diff --git a/test/integration/test-multiarch-foreign b/test/integration/test-multiarch-foreign index 713b27bd4..228fa8895 100755 --- a/test/integration/test-multiarch-foreign +++ b/test/integration/test-multiarch-foreign @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' 'i386' 'armel' insertpackage 'unstable' 'cool-foo' 'amd64,i386' '1.0' 'Depends: foo' @@ -178,16 +179,18 @@ distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: ' + testfailuremsg "E: Conflict: -> ${1%:*}:$4=1.0 but hates-foo:amd64=1.0 -> not ${1%:*}:$4=1.0" aptget install $1 hates-foo -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: hates-foo : Conflicts: foo Conflicts: foo:i386 Conflicts: foo:armel -E: Unable to correct problems, you have held broken packages." aptget install $1 hates-foo -s +E: Unable to correct problems, you have held broken packages." aptget install $1 hates-foo -s --solver internal + testfailuremsg "E: Conflict: $2:amd64=1.0 -> not foo:$4=1.0 but foo:$4=1.0" aptget install $1 $2 -s --solver 3.0 testfailureequal "$BADPREFIX The following packages have unmet dependencies: $2 : Conflicts: foo:$4 -E: Unable to correct problems, you have held broken packages." aptget install $1 $2 -s +E: Unable to correct problems, you have held broken packages." aptget install $1 $2 -s --solver internal testsuccessequal "Reading package lists... Building dependency tree... The following NEW packages will be installed: diff --git a/test/integration/test-not-upgrading-removed-depends b/test/integration/test-not-upgrading-removed-depends index 54b20422c..c7d67af3d 100755 --- a/test/integration/test-not-upgrading-removed-depends +++ b/test/integration/test-not-upgrading-removed-depends @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' insertpackage 'unstable' 'untouchable-for-solving' 'all' '1' 'Conflicts: main' diff --git a/test/integration/test-prefer-higher-priority-providers b/test/integration/test-prefer-higher-priority-providers index 7c3f32374..6f07db5f0 100755 --- a/test/integration/test-prefer-higher-priority-providers +++ b/test/integration/test-prefer-higher-priority-providers @@ -90,6 +90,10 @@ Inst awesome (1 unstable [all]) Conf baz (1 unstable [all]) Conf awesome (1 unstable [all])" aptget install awesome foo- bar- -s +testfailuremsg "E: Unsatisfiable dependency: awesome:amd64=1 -> foo:amd64=1 | bar:amd64=1 | baz:amd64=1 +E: Not considered: foo:amd64=1: not foo:amd64 -> not foo:amd64=1 +E: Not considered: bar:amd64=1: not bar:amd64 -> not bar:amd64=1 +E: Not considered: baz:amd64=1: not baz:amd64 -> not baz:amd64=1" aptget install awesome foo- bar- baz- -s --solver 3.0 testfailureequal "Reading package lists... Building dependency tree... Package 'foo' is not installed, so not removed @@ -103,4 +107,4 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: awesome : Depends: stuff -E: Unable to correct problems, you have held broken packages." aptget install awesome foo- bar- baz- -s +E: Unable to correct problems, you have held broken packages." aptget install awesome foo- bar- baz- -s --solver internal diff --git a/test/integration/test-resolver-delays-remove-decisions b/test/integration/test-resolver-delays-remove-decisions index a06995476..062a2e7e9 100755 --- a/test/integration/test-resolver-delays-remove-decisions +++ b/test/integration/test-resolver-delays-remove-decisions @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' 'i386' insertinstalledpackage 'stuff' 'all' '1' @@ -19,6 +20,18 @@ setupaptarchive # We are needlessly removing "stuff" if we don't delay its marking here # as we do not question the remove later on +testsuccessequal "Reading package lists... +Building dependency tree... +The following additional packages will be installed: + bar +The following NEW packages will be installed: + bar foobar +0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded. +Inst bar (1 unstable [all]) +Inst foobar (1 unstable [all]) +Conf bar (1 unstable [all]) +Conf foobar (1 unstable [all])" apt install foobar -s + testsuccessequal "Reading package lists... Building dependency tree... MarkInstall foobar:amd64 < none -> 1 @un puN Ib > FU=1 @@ -41,10 +54,27 @@ The following NEW packages will be installed: Inst bar (1 unstable [all]) Inst foobar (1 unstable [all]) Conf bar (1 unstable [all]) -Conf foobar (1 unstable [all])" apt install foobar -s -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 +Conf foobar (1 unstable [all])" apt install foobar -s -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 --solver internal insertinstalledpackage 'uninstallable' 'all' '1' +testsuccessequal "Reading package lists... +Building dependency tree... +The following additional packages will be installed: + foo foo-dep +The following packages will be REMOVED: + stuff +The following NEW packages will be installed: + foo foo-dep foobar +0 upgraded, 3 newly installed, 1 to remove and 0 not upgraded. +Remv stuff [1] +Inst foo-dep (1 unstable [all]) +Inst foo (1 unstable [all]) +Inst foobar (1 unstable [all]) +Conf foo-dep (1 unstable [all]) +Conf foo (1 unstable [all]) +Conf foobar (1 unstable [all])" apt install foobar -s + testsuccessequal "Reading package lists... Building dependency tree... MarkInstall foobar:amd64 < none -> 1 @un puN Ib > FU=1 @@ -71,9 +101,27 @@ Inst foo (1 unstable [all]) Inst foobar (1 unstable [all]) Conf foo-dep (1 unstable [all]) Conf foo (1 unstable [all]) -Conf foobar (1 unstable [all])" apt install foobar -s -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 +Conf foobar (1 unstable [all])" apt install foobar -s -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 --solver internal # Same solution but the installs are considered protected now as there is no other solution +testsuccessequal "Reading package lists... +Building dependency tree... +Package 'bar' is not installed, so not removed +The following additional packages will be installed: + foo foo-dep +The following packages will be REMOVED: + stuff +The following NEW packages will be installed: + foo foo-dep foobar +0 upgraded, 3 newly installed, 1 to remove and 0 not upgraded. +Remv stuff [1] +Inst foo-dep (1 unstable [all]) +Inst foo (1 unstable [all]) +Inst foobar (1 unstable [all]) +Conf foo-dep (1 unstable [all]) +Conf foo (1 unstable [all]) +Conf foobar (1 unstable [all])" apt install foobar bar- -q=0 -s + testsuccessequal "Reading package lists... Building dependency tree... MarkInstall foobar:amd64 < none -> 1 @un puN Ib > FU=1 @@ -103,4 +151,4 @@ Inst foo (1 unstable [all]) Inst foobar (1 unstable [all]) Conf foo-dep (1 unstable [all]) Conf foo (1 unstable [all]) -Conf foobar (1 unstable [all])" apt install foobar bar- -q=0 -s -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 +Conf foobar (1 unstable [all])" apt install foobar bar- -q=0 -s -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1 --solver internal diff --git a/test/integration/test-specific-architecture-dependencies b/test/integration/test-specific-architecture-dependencies index 447e407e5..ca39f18d8 100755 --- a/test/integration/test-specific-architecture-dependencies +++ b/test/integration/test-specific-architecture-dependencies @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' 'i386' insertpackage 'unstable' 'libc6' 'amd64,i386' '1' 'Multi-Arch: same' @@ -193,6 +194,7 @@ The following NEW packages will be installed: Inst foo-depender (1 unstable [amd64]) Conf foo-depender (1 unstable [amd64])' aptget install foo-depender -s +testfailuremsg 'E: Unsatisfiable dependency group foo-depender:i386=1 -> foo:i386' aptget install foo-depender:i386 -s --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -203,7 +205,7 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: foo-depender:i386 : Depends: foo:i386 but it is not installable -E: Unable to correct problems, you have held broken packages.' aptget install foo-depender:i386 -s +E: Unable to correct problems, you have held broken packages.' aptget install foo-depender:i386 -s --solver internal testsuccessequal 'Reading package lists... Building dependency tree... @@ -311,6 +313,7 @@ Remv libold [1] Inst breaker-x64 (1 unstable [amd64]) Conf breaker-x64 (1 unstable [amd64])' aptget install breaker-x64:amd64 -s +testfailuremsg 'E: Unsatisfiable dependency group depender-x32:amd64=1 -> libc6:i386:any' aptget install depender-x32 -s --solver 3.0 testfailureequal 'Reading package lists... Building dependency tree... Some packages could not be installed. This may mean that you have @@ -321,4 +324,4 @@ The following information may help to resolve the situation: The following packages have unmet dependencies: depender-x32 : Depends: libc6:i386 but it is not installable -E: Unable to correct problems, you have held broken packages.' aptget install depender-x32 -s +E: Unable to correct problems, you have held broken packages.' aptget install depender-x32 -s --solver internal diff --git a/test/integration/test-ubuntu-bug-1974196 b/test/integration/test-ubuntu-bug-1974196 index 7c38723c6..08dccffce 100755 --- a/test/integration/test-ubuntu-bug-1974196 +++ b/test/integration/test-ubuntu-bug-1974196 @@ -20,6 +20,19 @@ noprogress() { "$@" | sed /^Progress/d } +testsuccessequal "Reading package lists... +Building dependency tree... +The following additional packages will be installed: + depends pkg1 +The following packages will be upgraded: + depends pkg0 pkg1 +3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. +Inst depends [1] (2 unstable [all]) [] +Inst pkg0 [1] (2 unstable [all]) [] +Inst pkg1 [1] (2 unstable [all]) +Conf depends (2 unstable [all]) +Conf pkg0 (2 unstable [all]) +Conf pkg1 (2 unstable [all])" aptget install pkg0 -s testsuccessequal "Reading package lists... Building dependency tree... Upgrading: depends:arm64 < 1 | 2 @ii umH Ib > due to depends:arm64 Depends on pkg0:arm64 < 1 -> 2 @ii pumU > (= 1) @@ -40,7 +53,7 @@ Inst pkg0 [1] (2 unstable [all]) [] Inst pkg1 [1] (2 unstable [all]) Conf depends (2 unstable [all]) Conf pkg0 (2 unstable [all]) -Conf pkg1 (2 unstable [all])" aptget install pkg0 -o debug::pkgdepcache::marker=1 -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::AutoInstall=1 -s +Conf pkg1 (2 unstable [all])" aptget install pkg0 -o debug::pkgdepcache::marker=1 -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::AutoInstall=1 -s --solver internal testsuccessequal "Percentage: 0 Message: Start up solver… diff --git a/test/integration/test-unpack-different-version-unpacked b/test/integration/test-unpack-different-version-unpacked index e7da64ceb..810e2e953 100755 --- a/test/integration/test-unpack-different-version-unpacked +++ b/test/integration/test-unpack-different-version-unpacked @@ -14,14 +14,24 @@ cleanstatus() { rm rootdir/var/cache/apt/*.bin } -#FIXME: the reported version is wrong, it should be 1, not 2 insertinstalledpackage 'libqtcore4' 'i386,amd64' '1' 'Multi-Arch: same' '' 'install ok unpacked' +#FIXME(internal): the reported version is wrong, it should be 1, not 2 testsuccessequal 'Reading package lists... Building dependency tree... 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. 2 not fully installed or removed. Conf libqtcore4 (2 unstable [amd64]) -Conf libqtcore4:i386 (2 unstable [i386])' aptget install -s -f +Conf libqtcore4:i386 (2 unstable [i386])' aptget install -s -f --solver internal + +# FIXED(3.0): the reported version is correct now +testsuccessequal 'Reading package lists... +Building dependency tree... +Solving dependencies... +0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. +2 not fully installed or removed. +Conf libqtcore4 (1 [amd64]) +Conf libqtcore4:i386 (1 [i386])' aptget install -s -f --solver 3.0 + cleanstatus insertinstalledpackage 'libqtcore4' 'amd64' '2' 'Multi-Arch: same' '' 'install ok unpacked' -- cgit v1.2.3-70-g09d2 From acb77872861834d3c5b98ca2e81e0336a388e9f0 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 19 May 2024 17:42:34 +0200 Subject: solver3: Try candidate before installed version on upgrade This fixes --no-strict-pinning attempting to upgrade all the versions on the system. Adjust the upgrade test case accordingly: 1) no-strict-pinning pulls in systemd despite it being pinned down due to a dependenc (this was true before this fix) 2) no-strict-pinning does not pull in the upgrade-simple because nothing depends on it (this is what the test fixes) --- apt-pkg/solver3.cc | 11 ++++++-- test/integration/test-apt-get-upgrade | 51 +++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index ab66c9501..58fb07c01 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -46,8 +46,15 @@ struct CompareProviders3 /*{{{*/ { if (AV == BV) return false; - if (not upgrade && A->CurrentVer != 0 && A.CurrentVer() == AV) - return true; + // The current version should win, unless we are upgrading and the other is the + // candidate. + // If AV is the current version, AV only wins on upgrades if BV is not the candidate. + if (A.CurrentVer() == AV) + return upgrade ? Policy.GetCandidateVer(A) != BV : true; + // If BV is the current version, AV only wins on upgrades if it is the candidate. + if (A.CurrentVer() == BV) + return upgrade ? Policy.GetCandidateVer(A) == AV : false; + // If neither are the current version, order them by priority. if (Policy.GetPriority(AV) < Policy.GetPriority(BV)) return false; diff --git a/test/integration/test-apt-get-upgrade b/test/integration/test-apt-get-upgrade index 9fb2b41d1..c9e56d97d 100755 --- a/test/integration/test-apt-get-upgrade +++ b/test/integration/test-apt-get-upgrade @@ -167,3 +167,54 @@ Conf upgrade-with-conflict (2.0 unstable [all]) Conf new-dep (1.0 stable [all]) Conf upgrade-simple (2.0 unstable [all]) Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s dist-upgrade + +# --no-strict-pinning pulls in systemd due to the dependency +testsuccessequal 'Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages will be REMOVED: + conflicting-dep +The following NEW packages will be installed: + new-dep systemd +The following packages will be upgraded: + init upgrade-simple upgrade-with-conflict upgrade-with-new-dep +4 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. +Remv conflicting-dep [1.0] +Inst systemd (2 unstable [all]) +Conf systemd (2 unstable [all]) +Inst init [1] (2 unstable [all]) +Inst upgrade-with-conflict [1.0] (2.0 unstable [all]) +Inst new-dep (1.0 stable [all]) +Inst upgrade-simple [1.0] (2.0 unstable [all]) +Inst upgrade-with-new-dep [1.0] (2.0 unstable [all]) +Conf init (2 unstable [all]) +Conf upgrade-with-conflict (2.0 unstable [all]) +Conf new-dep (1.0 stable [all]) +Conf upgrade-simple (2.0 unstable [all]) +Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s dist-upgrade --no-strict-pinning --solver 3.0 + +# --no-strict-pinning does not cause a package to be upgraded on its own, though. +echo 'Package: upgrade-simple +Pin: release unstable +Pin-Priority: -1' > rootdir/etc/apt/preferences.d/no-strict-pinning.pref +testsuccessequal 'Reading package lists... +Building dependency tree... +Calculating upgrade... +The following packages will be REMOVED: + conflicting-dep +The following NEW packages will be installed: + new-dep systemd +The following packages will be upgraded: + init upgrade-with-conflict upgrade-with-new-dep +3 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. +Remv conflicting-dep [1.0] +Inst systemd (2 unstable [all]) +Conf systemd (2 unstable [all]) +Inst init [1] (2 unstable [all]) +Inst upgrade-with-conflict [1.0] (2.0 unstable [all]) +Inst new-dep (1.0 stable [all]) +Inst upgrade-with-new-dep [1.0] (2.0 unstable [all]) +Conf init (2 unstable [all]) +Conf upgrade-with-conflict (2.0 unstable [all]) +Conf new-dep (1.0 stable [all]) +Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s dist-upgrade --no-strict-pinning --solver 3.0 -- cgit v1.2.3-70-g09d2 From 56737e4bdb58e03eeea6f915259f3a18a79642a3 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 24 May 2024 15:17:41 +0200 Subject: test-bug-758153-versioned-provides-support: Solver 3.0 support The previous commit basically fixes this, it just requires some minor small adjustments --- test/integration/solver3.broken | 1 - test/integration/test-bug-758153-versioned-provides-support | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/test/integration/solver3.broken b/test/integration/solver3.broken index 57ab7ba57..65e18a7ff 100644 --- a/test/integration/solver3.broken +++ b/test/integration/solver3.broken @@ -15,7 +15,6 @@ test-bug-675449-essential-are-protected test-bug-709560-set-candidate-release test-bug-745046-candidate-propagation-fails test-bug-753297-upgradable -test-bug-758153-versioned-provides-support test-bug-767891-force-essential-important test-bug-961266-hold-means-hold test-dont-forget-conflicts-via-unknown-architectures diff --git a/test/integration/test-bug-758153-versioned-provides-support b/test/integration/test-bug-758153-versioned-provides-support index 7bf9d76bd..a057d33a8 100755 --- a/test/integration/test-bug-758153-versioned-provides-support +++ b/test/integration/test-bug-758153-versioned-provides-support @@ -7,6 +7,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' 'i386' insertinstalledpackage 'webapp' 'all' '1' 'Depends: httpd' @@ -393,11 +394,18 @@ Inst needsselfprov12 (1 unstable [amd64]) Conf selfprov (2 unstable [amd64]) Conf needsselfprov12 (1 unstable [amd64])" aptget install needsselfprov12 -s --solver $solver if [ "$solver" = 'apt' ]; then +if [ "$APT_SOLVER" = "3.0" ]; then +TOPDEPENDS=" needsselfprov123 : Depends: selfprov (= 1) + Depends: selfprov (= 2) + Depends: selfprov (= 3)" +else +TOPDEPENDS=" needsselfprov123 : Depends: selfprov (= 3)" +fi testfailureequal "$HEADER The solver encountered an error of type: ERR_UNSOLVABLE The following information might help you to understand what is wrong: The following packages have unmet dependencies: - needsselfprov123 : Depends: selfprov (= 3) +$TOPDEPENDS $SOMEPACKAGESCOULDNOT needsselfprov123 : Depends: selfprov (= 1) -- cgit v1.2.3-70-g09d2 From 0fa3b176652ff10276569a478c910ca866a4da5d Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 19 May 2024 21:24:08 +0200 Subject: solver3: Promote satisfied Suggests to Recommends As per the test-suggests-promoted-to-recommends test. This is still a bit messy as we ignore alternative choices and only check the last one, but um seems useful? --- apt-pkg/solver3.cc | 66 +++++++++++++++++++++---------- test/integration/solver3.broken | 2 - test/integration/test-bug-591882-conkeror | 3 +- 3 files changed, 48 insertions(+), 23 deletions(-) diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index 58fb07c01..3c4ca4eb7 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -348,8 +348,6 @@ bool APT::Solver::Install(pkgCache::VerIterator Ver, Reason reason) pkgCache::DepIterator end; dep.GlobOr(start, end); // advances dep - if (not policy.IsImportantDep(start)) - continue; if (not EnqueueOrGroup(start, end, Reason(Ver))) return false; } @@ -452,8 +450,6 @@ bool APT::Solver::EnqueueCommonDependencies(pkgCache::PkgIterator Pkg) } if (not allHaveDep) continue; - if (not policy.IsImportantDep(start)) - continue; if (not EnqueueOrGroup(start, end, Reason(Pkg))) return false; } @@ -467,6 +463,11 @@ bool APT::Solver::EnqueueOrGroup(pkgCache::DepIterator start, pkgCache::DepItera auto Ver = start.ParentVer(); auto fixPolicy = _config->FindB("APT::Get::Fix-Policy-Broken"); + // Non-important dependencies can only be installed if they are currently satisfied, see the check further + // below once we have calculated all possible solutions. + if (start.ParentPkg()->CurrentVer == 0 && not policy.IsImportantDep(start)) + return true; + if (unlikely(debug >= 3)) std::cerr << "Found dependency critical " << Ver.ParentPkg().FullName() << "=" << Ver.VerStr() << " -> " << start.TargetPkg().FullName() << "\n"; @@ -513,32 +514,57 @@ bool APT::Solver::EnqueueOrGroup(pkgCache::DepIterator start, pkgCache::DepItera if (not fixPolicy) std::sort(workItem.solutions.begin(), workItem.solutions.end(), CompareProviders3{cache, policy, TgtPkg}); - // Figure out if the reason is installed - bool reasonInstalled = false; - if (auto p = workItem.reason.Pkg()) - reasonInstalled = pkgCache::PkgIterator(cache, cache.PkgP + p)->CurrentVer != 0; - else if (auto v = workItem.reason.Ver()) - reasonInstalled = pkgCache::VerIterator(cache, cache.VerP + v).ParentPkg()->CurrentVer != 0; - // Try to perserve satisfied Recommends. FIXME: We should check if the Recommends was there in the installed version? - if (workItem.optional && reasonInstalled && not fixPolicy && - not std::any_of(workItem.solutions.begin(), workItem.solutions.end(), [this](auto ver) - { return pkgCache::VerIterator(cache, ver).ParentPkg()->CurrentVer != 0; })) + if (workItem.optional && start.ParentPkg()->CurrentVer) { - if (unlikely(debug >= 3)) + bool important = policy.IsImportantDep(start); + bool newOptional = true; + bool wasImportant = false; + for (auto D = start.ParentPkg().CurrentVer().DependsList(); not D.end(); D++) + if (not D.IsCritical() && not D.IsNegative() && D.TargetPkg() == start.TargetPkg()) + newOptional = false, wasImportant = policy.IsImportantDep(D); + + bool satisfied = std::any_of(workItem.solutions.begin(), workItem.solutions.end(), [this](auto ver) + { return pkgCache::VerIterator(cache, ver).ParentPkg()->CurrentVer != 0; }); + + if (important && wasImportant && not newOptional && not satisfied) { - std::cerr << "Ignoring currently unsatisfied Recommends "; - workItem.Dump(cache); - std::cerr << "\n"; + if (unlikely(debug >= 3)) + { + std::cerr << "Ignoring unsatisfied Recommends "; + workItem.Dump(cache); + std::cerr << "\n"; + } + return true; + } + if (not important && not wasImportant && not newOptional && satisfied) + { + if (unlikely(debug >= 3)) + { + std::cerr << "Promoting satisfied Suggests to Recommends: "; + workItem.Dump(cache); + std::cerr << "\n"; + } + important = true; + } + if (not important) + { + if (unlikely(debug >= 3)) + { + std::cerr << "Ignoring Suggests "; + workItem.Dump(cache); + std::cerr << "\n"; + } + return true; } - return true; } + if (not workItem.solutions.empty()) { // std::sort(workItem.solutions.begin(), workItem.solutions.end(), CompareProviders3{cache, TgtPkg}); if (unlikely(debug >= 3 && workItem.optional)) { - std::cerr << "Enqueuing currently satisfied Recommends "; + std::cerr << "Enqueuing Recommends "; workItem.Dump(cache); std::cerr << "\n"; } diff --git a/test/integration/solver3.broken b/test/integration/solver3.broken index 65e18a7ff..9228e46c8 100644 --- a/test/integration/solver3.broken +++ b/test/integration/solver3.broken @@ -8,7 +8,6 @@ test-apt-move-and-forget-manual-sections test-apt-patterns test-apt-source-and-build-dep test-bug-470115-new-and-tighten-recommends -test-bug-591882-conkeror test-bug-602412-dequote-redirect test-bug-611729-mark-as-manual test-bug-675449-essential-are-protected @@ -29,7 +28,6 @@ test-prevent-markinstall-multiarch-same-versionscrew test-release-candidate-switching test-resolve-by-keep-new-recommends test-resolver-provider-exchange -test-suggests-promoted-to-recommends test-ubuntu-bug-1130419-prefer-installed-ma-same-siblings test-ubuntu-bug-1304403-obsolete-priority-standard test-ubuntu-bug-1990586 diff --git a/test/integration/test-bug-591882-conkeror b/test/integration/test-bug-591882-conkeror index 6b903431a..21c569756 100755 --- a/test/integration/test-bug-591882-conkeror +++ b/test/integration/test-bug-591882-conkeror @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture "i386" setupaptarchive @@ -73,5 +74,5 @@ After this operation, 36.0 MB of additional disk space will be used. E: Trivial Only specified but this is not a trivial operation." # Test that the old behavior can be restored with the option -testfailureequal "$UPGRADEFAIL" aptget dist-upgrade --trivial-only -o pkgProblemResolver::FixByInstall=0 +testfailureequal "$UPGRADEFAIL" aptget dist-upgrade --trivial-only -o pkgProblemResolver::FixByInstall=0 --solver internal testfailureequal "$UPGRADESUCCESS" aptget dist-upgrade --trivial-only #-o pkgProblemResolver::FixByInstall=0 -- cgit v1.2.3-70-g09d2 From cd245a57f273d3c069543c19d6ac31c84879ce7b Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 20 May 2024 14:59:58 +0200 Subject: solver3: Solve optional dependencies before optional packages This somewhat improves reliability of not breaking Recommends, e.g. if the Recommends gets tightened. One test case enabled by this now is the test-resolver-provider-exchange, which with a simple change to allow removal of automatically installed packages works now. --- apt-pkg/solver3.cc | 2 ++ test/integration/solver3.broken | 1 - test/integration/test-resolver-provider-exchange | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index 3c4ca4eb7..216651a97 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -189,6 +189,8 @@ bool APT::Solver::Work::operator<(APT::Solver::Work const &b) const return std::any_of(solutions.begin(), solutions.end(), [b](auto sol) -> bool { return std::find(b.solutions.begin(), b.solutions.end(), sol) != b.solutions.end(); }); } + if (optional && b.optional && reason.empty() != b.reason.empty()) + return reason.empty(); // An optional item is less important than a required one. if (optional != b.optional) return optional; diff --git a/test/integration/solver3.broken b/test/integration/solver3.broken index 9228e46c8..c098b7498 100644 --- a/test/integration/solver3.broken +++ b/test/integration/solver3.broken @@ -27,7 +27,6 @@ test-phased-updates-upgrade test-prevent-markinstall-multiarch-same-versionscrew test-release-candidate-switching test-resolve-by-keep-new-recommends -test-resolver-provider-exchange test-ubuntu-bug-1130419-prefer-installed-ma-same-siblings test-ubuntu-bug-1304403-obsolete-priority-standard test-ubuntu-bug-1990586 diff --git a/test/integration/test-resolver-provider-exchange b/test/integration/test-resolver-provider-exchange index 0a85db34d..45d936978 100755 --- a/test/integration/test-resolver-provider-exchange +++ b/test/integration/test-resolver-provider-exchange @@ -4,6 +4,7 @@ set -e TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' insertinstalledpackage 'fuse' 'all' '2' -- cgit v1.2.3-70-g09d2 From 808f51e800a9d6a834723fe1d1fdff98ee14d7b5 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 21 May 2024 13:19:41 +0200 Subject: solver3: Use stable sort While it seems that libstdc++ is using stable_sort for sort, we should make this explicit: We don't want items in our queues to move ahead of earlier items of the same priority. i.e. consider dependencies, they are grouped by package, we don't want the sort algorithm to move B=2 ahead if A|B (which expands to A=2|A=1|B=2|B=1). --- apt-pkg/solver3.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index 216651a97..e16a02684 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -290,7 +290,7 @@ bool APT::Solver::Install(pkgCache::PkgIterator Pkg, Reason reason) for (auto ver = Pkg.VersionList(); not ver.end(); ver++) if (IsAllowedVersion(ver)) workItem.solutions.push_back(ver); - std::sort(workItem.solutions.begin(), workItem.solutions.end(), CompareProviders3{cache, policy, Pkg}); + std::stable_sort(workItem.solutions.begin(), workItem.solutions.end(), CompareProviders3{cache, policy, Pkg}); assert(workItem.solutions.size() > 0); if (workItem.solutions.size() > 1 || workItem.optional) @@ -506,7 +506,7 @@ bool APT::Solver::EnqueueOrGroup(pkgCache::DepIterator start, pkgCache::DepItera // FIXME: This is not really true, though, we should fix the CompareProviders to ignore the // installed state if (fixPolicy) - std::sort(workItem.solutions.begin() + begin, workItem.solutions.end(), CompareProviders3{cache, policy, TgtPkg}); + std::stable_sort(workItem.solutions.begin() + begin, workItem.solutions.end(), CompareProviders3{cache, policy, TgtPkg}); if (start == end) break; @@ -514,7 +514,7 @@ bool APT::Solver::EnqueueOrGroup(pkgCache::DepIterator start, pkgCache::DepItera } while (1); if (not fixPolicy) - std::sort(workItem.solutions.begin(), workItem.solutions.end(), CompareProviders3{cache, policy, TgtPkg}); + std::stable_sort(workItem.solutions.begin(), workItem.solutions.end(), CompareProviders3{cache, policy, TgtPkg}); // Try to perserve satisfied Recommends. FIXME: We should check if the Recommends was there in the installed version? if (workItem.optional && start.ParentPkg()->CurrentVer) @@ -563,7 +563,7 @@ bool APT::Solver::EnqueueOrGroup(pkgCache::DepIterator start, pkgCache::DepItera if (not workItem.solutions.empty()) { - // std::sort(workItem.solutions.begin(), workItem.solutions.end(), CompareProviders3{cache, TgtPkg}); + // std::stable_sort(workItem.solutions.begin(), workItem.solutions.end(), CompareProviders3{cache, TgtPkg}); if (unlikely(debug >= 3 && workItem.optional)) { std::cerr << "Enqueuing Recommends "; @@ -946,7 +946,7 @@ bool APT::Solver::FromDepCache(pkgDepCache &depcache) for (auto V = P.VersionList(); not V.end(); ++V) if (IsAllowedVersion(V)) w.solutions.push_back(V); - std::sort(w.solutions.begin(), w.solutions.end(), CompareProviders3{cache, policy, P}); + std::stable_sort(w.solutions.begin(), w.solutions.end(), CompareProviders3{cache, policy, P}); AddWork(std::move(w)); } } -- cgit v1.2.3-70-g09d2 From aaa9e415ce48964726401462767d6038da6d82e7 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Tue, 21 May 2024 16:57:56 +0200 Subject: solver3: Actually restore unsolved items rather than solved ones When restoring previously solved items, we try to restore items that have become unsolved again by skipping items that have a solved solution. Well at least we thought we did, but we accidentally had a "not" in there that inverted the meaning, hence we lost work items on backtracking. This mostly did not seem to have caused any issues, I stumbled over it while trying to add `autoremove` listings to `upgrade`, but fixing it also fixes: test-ubuntu-bug-1130419-prefer-installed-ma-same-siblings This used to say "E: Broken packages", meaning the solver lost a non-optional install request and the 2nd stage solver caught an incomplete solution. Also test-bug-735967-lib32-to-i386-unavailable restores the legacy solver behavior, so win win? --- apt-pkg/solver3.cc | 2 +- test/integration/solver3.broken | 1 - test/integration/test-bug-735967-lib32-to-i386-unavailable | 8 +------- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index e16a02684..d5811423d 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -710,7 +710,7 @@ bool APT::Solver::Pop() if (w.depth > depth) // Deeper decision level is no longer valid. return true; // This item is still solved, keep it on the solved list. - if (not std::any_of(w.solutions.begin(), w.solutions.end(), [this](auto ver) + if (std::any_of(w.solutions.begin(), w.solutions.end(), [this](auto ver) { return (*this)[ver].decision == Decision::MUST; })) return false; // We are not longer solved, move it back to work. diff --git a/test/integration/solver3.broken b/test/integration/solver3.broken index c098b7498..6575b068d 100644 --- a/test/integration/solver3.broken +++ b/test/integration/solver3.broken @@ -27,7 +27,6 @@ test-phased-updates-upgrade test-prevent-markinstall-multiarch-same-versionscrew test-release-candidate-switching test-resolve-by-keep-new-recommends -test-ubuntu-bug-1130419-prefer-installed-ma-same-siblings test-ubuntu-bug-1304403-obsolete-priority-standard test-ubuntu-bug-1990586 test-ubuntu-bug-2025462-phased-dist-upgrade diff --git a/test/integration/test-bug-735967-lib32-to-i386-unavailable b/test/integration/test-bug-735967-lib32-to-i386-unavailable index a44e58570..cc925d161 100755 --- a/test/integration/test-bug-735967-lib32-to-i386-unavailable +++ b/test/integration/test-bug-735967-lib32-to-i386-unavailable @@ -32,12 +32,6 @@ setupaptarchive --no-update configarchitecture 'amd64' testsuccess aptget update -testsuccessequal 'Reading package lists... -Building dependency tree... -Calculating upgrade... -The following packages have been kept back: - lib32nss-mdns libnss-mdns -0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.' aptget dist-upgrade -s --solver 3.0 testsuccessequal 'Reading package lists... Building dependency tree... Calculating upgrade... @@ -48,7 +42,7 @@ The following packages will be upgraded: 1 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. Remv lib32nss-mdns [0.9-1] Inst libnss-mdns [0.9-1] (0.10-6 unstable [amd64]) -Conf libnss-mdns (0.10-6 unstable [amd64])' aptget dist-upgrade -s --solver internal +Conf libnss-mdns (0.10-6 unstable [amd64])' aptget dist-upgrade -s testfailuremsg 'E: Unsatisfiable dependency group libfoo:amd64=1 -> libfoo-bin:amd64' aptget install foo -s --solver 3.0 testfailureequal 'Reading package lists... -- cgit v1.2.3-70-g09d2 From 4a2b89be6fa73b9c193d5b70e11a9305272efc3e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Thu, 23 May 2024 13:24:25 +0200 Subject: solver3: Fix translations of removals for marked install We also need to issue a MarkDelete() if the package is marked for installation currently but should not be, not only if it did not have a previous version. This fixes the final test in test-multiarch-barbarian, the others only needed adjustments to mark all packages as automatic. --- apt-pkg/solver3.cc | 2 +- test/integration/solver3.broken | 1 - test/integration/test-multiarch-barbarian | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apt-pkg/solver3.cc b/apt-pkg/solver3.cc index d5811423d..9831f7e14 100644 --- a/apt-pkg/solver3.cc +++ b/apt-pkg/solver3.cc @@ -987,7 +987,7 @@ bool APT::Solver::ToDepCache(pkgDepCache &depcache) depcache[P].Marked = 1; depcache[P].Garbage = 0; } - else if (P->CurrentVer) + else if (P->CurrentVer || depcache[P].Install()) { depcache.MarkDelete(P, false, 0, (*this)[P].reason.empty()); depcache[P].Marked = 0; diff --git a/test/integration/solver3.broken b/test/integration/solver3.broken index 6575b068d..75ddbe5df 100644 --- a/test/integration/solver3.broken +++ b/test/integration/solver3.broken @@ -20,7 +20,6 @@ test-dont-forget-conflicts-via-unknown-architectures test-explore-or-groups-in-markinstall test-external-dependency-solver-protocol test-method-mirror -test-multiarch-barbarian test-parse-all-archs-into-cache test-phased-updates-new-depends test-phased-updates-upgrade diff --git a/test/integration/test-multiarch-barbarian b/test/integration/test-multiarch-barbarian index 293f22735..b89783473 100755 --- a/test/integration/test-multiarch-barbarian +++ b/test/integration/test-multiarch-barbarian @@ -5,6 +5,7 @@ TESTDIR="$(readlink -f "$(dirname "$0")")" . "$TESTDIR/framework" setupenvironment +allowremovemanual configarchitecture 'amd64' 'i386' buildsimplenativepackage 'foreign-foo' 'amd64,i386' '1' 'stable' 'Multi-Arch: foreign -- cgit v1.2.3-70-g09d2