summaryrefslogtreecommitdiff
path: root/test/integration
Commit message (Collapse)AuthorAgeFilesLines
* pager: Also set SMK in LESS, fix LV=C to be LV=-cJulian Andres Klode2025-03-261-1/+1
| | | | | | | | | | | Sync the LESS environment with systemd to make it more user-friendly than just a blinking colon: - S disables the terminal bell - M makes the output verbose, so the prompt is not ":" but "lines 1-n" - K means that Ctrl+c exits the command Also fix the LV= environment variable to use -c and not C.
* solver3: Correctly deb822-escape error message in evaluation reportJulian Andres Klode2025-03-261-0/+35
| | | | | | The error messages are multi-line now, so need correct escaping. LP: #2104276
* Respect custom LESS/MORE/LV variablesJulian Andres Klode2025-03-261-0/+3
| | | | | | Use setenv() to avoid overriding user defined variables. LP: #2103921
* solver3: Do not install new packages for SuggestsJulian Andres Klode2025-03-201-27/+1
| | | | | | | | | | As a followup to the previous commit, restore the exact behavior of the old solver to break the Suggests on upgrade here by erasing any choices not previously installed. This ensures that the Suggests never installs any new package, but it will still retain previously installed packages when solver3 is doing autoremove.
* solver3: Handle previously satisfied Suggests lastJulian Andres Klode2025-03-202-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In #2103556 we can see that avahi-daemon Suggests avahi-autoipd, which is previously satisfied by dhcpcd-base due to a Provides; that Provides has now been dropped; and solver3 keeps the update back. As in LP: #2102720 this is a Suggests and it seems wrong for the Suggests to actually influence dependency choices and be able to hold back updates. Instead, satisfy previously satisfied Suggests at the end. For the particular case in this bug report, this results in avahi-autoipd, the real package, to be installed to keep the Suggests working which needs further consideration whether that is the right choice (we can argue either way), but in any case this is a better solution. This in turn breaks the conkeror test which is a somewhat awkward unrealistic test these days as it has no automatically installed packages; because previously something must have had a Suggests on say libdatrie1 or something that was processed first. This would be fine before 5daf6dbfd272be2f8e3c59d4bab4be8c119b7aa1 but as of that commit we no longer rewrite conkeror Depends xulrunner-1.9 | xulrunner-1.9.1 into conkeror Depends xulrunner-1.9.1 | xulrunner-1.9 Because xulrunner-1.9 is manually installed. Mark xulrunner-1.9 as automatically installed to fix the test case. The resulting behavior seems correct: If you manually want xulrunner-1.9 specifically we should not replace it with xulrunner-1.9.1; but if it's automatically installed we should. LP: #2103556
* solver3: Avoid empty error message in evaluation crash reportJulian Andres Klode2025-03-201-1/+0
| | | | whoopsie does not accept empty values
* solver3: Use zstd-compressed, base64-encoded dumpsJulian Andres Klode2025-03-201-94/+2
| | | | | | | | | | | | | Store the solver dumps with zstd compression and base64-encode them in the crash report; such that they take up significantly less space and can fit in cassandra's schema. Base64 is wrapped at 76 characters as the base64 tool does. Do some magic std::string_view conversion to avoid string copies for the substr() used to get 76 characters at a time. Note we can rely on substr(i, 76) to handle less than 76 characters just fine; it uses std::min(76, size() - i) characters.
* solver evaluation: write minimized solver dumpsJulian Andres Klode2025-03-201-2/+3
| | | | These are faster to generate and significantly smaller.
* cmdline/apt-get.cc: emit Signed-By field and support $(SIGNED_BY) in apt-get ↵Johannes Schauer Marin Rodrigues2025-03-141-9/+10
| | | | indextargets --format
* solver3: Only hide ver->pkg clauses, not pkg->ver version selection onesJulian Andres Klode2025-03-132-2/+31
| | | | | | | | Particularly as Helmut pointed out we need to show which version we selected for install if there is only one but there is a versioned conflicts. Reported-By: Helmut Grohne <helmut@subdivi.de> on IRC
* solver3: Fix test-resolve-by-keep-new-recommendJulian Andres Klode2025-03-122-1/+18
| | | | | | | | | | | | | | | | | Reorder the if branches a bit to simplify the understanding of the promotions, and allow us to keep track of which dependency existed in the installed version. Change the rule for promoting new recommends to only promote new recommends to depends in *upgrade* and not *dist-upgrade* per the test-resolve-by-keep-new-recommends test case. This makes some sense: In a dist-upgrade, the solver could otherwise decide to remove an installed package if both the following hold: (1) something needs the upgraded version | something else (2) the upgraded version is not installable due to unsat recommends
* solver3: Fix Recommends/Suggests vs Enhances confusionJulian Andres Klode2025-03-121-0/+8
| | | | | | | | | | | | | | | | | | We accidentally considered an Enhances a reason to keep a package installed, which of course it is not, fix the determination of "existing soft dependency" to only include soft dependencies that should keep a package installed in the autoremover to solve the issue. This also fixes edsp/mantic-upgrade-rel-to-2024-05-29.edsp to not install llvm-13-dev for clang-13 which is an installed package with no upgrade. Also ensure we stop after the first match; the DependsList() is ordered by decreasing priority and we don't want to override Recommends by Suggests in case a package declares both... LP: #2101800
* test: Fix some weird editing artefactJulian Andres Klode2025-03-121-1/+1
|
* solver3: Correctly determine 'same' or groupsJulian Andres Klode2025-03-101-0/+18
| | | | | | We incorrectly used the DependencyData of the first or group member, however that only checked that the first or group member was the same and that both either had a next member or not.
* edsp: Set Forbid-New-Install/Forbid-Remove: no if other is setJulian Andres Klode2025-03-101-0/+37
| | | | | | | | The upgrade code may also set Upgrade: yes, and this sets both to yes, so `apt upgrade` dumps behave like `apt-get upgrade` ones, which of course is not intentional. moo
* solver3: Do not prefer new installs over manually installed obsoletesJulian Andres Klode2025-03-091-0/+4
| | | | | | | | | | Only move obsolete packages last that are automatically installed, as we don't want to remove manually installed obsolete packages. Add some missing const annotations to the operator[] arguments as well that were needed. LP: #2100247
* Print --solver 3.0 explanation if both internal and it failedJulian Andres Klode2025-03-092-1/+22
| | | | | | | | | | This can provide useful additional context. To avoid updating the whole test suite for it, introduce a new option `quiet::NoSolver3Explanation` and set it by default. All the other tests that assert output will already have matching tests for --solver 3.0 with the correct messages asserted, it makes no sense to duplicate them.
* Evaluate and fall back to the 3.0 solverJulian Andres Klode2025-03-093-0/+222
| | | | | | | | | | | | Always run the 3.0 solver after the internal solver. If the internal solver failed, and the 3.0 solver did not, use the 3.0 result. If 3.0 solver failed or produced a worse result than the internal solver, write an apport crash dump. We exclude situations which we now the solver can't handle, i.e. removals are forbidden and you requested removals, and stuff like that.
* solver3: Verbose error messagesJulian Andres Klode2025-03-0828-59/+401
| | | | | | | | | | | | | | | | | | | | | | Introduce a new function, LongWhyStr() that returns a longer reason for why something is being installed (or not). This does the same path walk as the other function does, but it renders the clauses at each level, and one per line, so the whole output is a lot more informative. It is a separate function to keep the existing debug messages use the simple single line implication graph We remove the other special case in AddWork() for empty solutions to mke use of the general case in Solve() instead, and then adapt the case in Solve() to the same case as in Enqueue(). This also happens to fix the bug that when we encountered an empty clause we just printed the clause had no solution, but not how we got to install the package with the clause. Adapt the test suite for the changes which is an annoying amount of paperwork.
* test: Grep continuation lines in error messagesJulian Andres Klode2025-03-042-2/+27
| | | | | This is important for upcoming multi-line solver error message work.
* Replace "GPG error" with "OpenPGP signature verification failed"Julian Andres Klode2025-03-046-12/+12
| | | | Reported-by: cacin on irc
* edsp: Write 'Size' to the EDSP filesJulian Andres Klode2025-03-031-0/+2
| | | | | | This allows solvers to optimize by download size; and gives us a better means of interpreting "downloadable" debs (they must have a size > 0 after all).
* test-apt-ftparchive-cachedb: Avoid race condition in test caseJulian Andres Klode2025-02-271-0/+5
| | | | | | | | | | | | | | apt-ftparchive skips regenerating Contents if they are newer than the Packages files. Most of the time, the test ended up generating Contents and Packages files with the same-second timestamp; so we ended up regenerating them and passing the test. However, sometimes, the timestamp of the Contents file was 1s higher and we ended up not regenerating the Contents file and hence failed the test case. Ensure the timestamps actually are the same to avoid the race condition and make this stable.
* Fix crash in VersionExtra using --with-source etcJulian Andres Klode2025-02-241-0/+10
| | | | | | | | | | | | | | | | | | | | VersionExtra holds, at runtime, the SHA256 of the packages being added to try to avoid deduplicating obviously different packages; the SHA256 itself is too large to store in the cache. When volatile sources are used, the VersionExtra array is not initialized, or rather it used to be initialized to 32*1024 zero elements as a performance optimization. This meant that specifying --with-source with a package that looks like a duplicate of a version with an ID >= 32*1024 triggered the assertion; so we could not reproduce it easily in the test suite. Remove the optimized initialization to make the behavior more uniform; and treat too large version IDs as having no SHA256. Closes: #1098702
* test: Improve output cleaning for solver progressJulian Andres Klode2025-02-181-12/+5
| | | | | | | | | | | We don't really care about solver progress messages in testing; hide them when comparing output, and hide them better than before. Previously testsuccessequal ... --solver 3.0 behaved differently than tests run with globally forced on 3.0 solver. Stop cleaning up autoremovals, but do clean up "Calculating upgrade" as well.
* solver3: Fix test-apt-move-and-forget-manual-sectionsJulian Andres Klode2025-02-181-1/+0
| | | | | Implement the moving of the auto bit. The whole auto-bit management is not entirely optimal yet, but this works.
* solver3: Only enqueue shared dependencies at the package levelJulian Andres Klode2025-02-1421-65/+64
| | | | | | | | | | | | | | | | | | | | | Dependencies shared by all versions are enqueued at the package level, so avoid enqueuing duplicates at the version level. This presumably has no meaningful impact on performance, potentially a negative performance impact on some workloads as we now need to find the duplicates again; it can become useful when there is a lot of backtracking. More importantly though this improves error messages, because now we can say that "all versions of foo depend on X", rather than saying "foo=1 depends on X" and you are left wondering why we did not select "foo=2". In this commit though, improved error messages are not implemented, they depend on redesigning the reason tracking to use clauses. Also the rationale tracking includes a lot more dependencies of the form "pkg:arch=version -> pkg:arch" which are annoying. Improved error messages should fold them into one node.
* solver3: Remove work rescoring in favor of unit propagationJulian Andres Klode2025-02-144-4/+2
| | | | | | | | | | | | | Instead of expensive rescoring of all outstanding items, use unit propagation to find new units after conflicts. We still count the items when adding them; but unless they are 0 or 1, which they should not be, they don't have any effect: The size field is now effectively static. If the size of an optional clause changed to 1, it is inserted a second time, and then moves up to the top of the optional items per the Work::operator< rules.
* test: Remove long obsolete FIXME for solver3Julian Andres Klode2025-02-141-2/+1
|
* test: Annotate the broken test casesJulian Andres Klode2025-02-141-4/+4
|
* test-ubuntu-bug-614993: Avoid implicit upgrade-by-source requirementJulian Andres Klode2025-02-142-11/+8
| | | | | | | This allows it to work with solver3 before that feature is implemented. This essentially reverts the change to that test made in 119a8d0ed19a4e946591b9aef7d662e14ca7ece5
* ResolveByKeep: Do not pass UPGRADE_ALL to EDSP solverJulian Andres Klode2025-02-141-1/+0
| | | | | | | | | | When we call an EDSP solver from ResolveByKeep(), we are not in an upgrade context: In an upgrade context, we call the solver directly from upgrade.cc instead of doing any Resolve() or ResolveByKeep() calls. This fixes the test-bug-602412-dequote-redirect test case, where ResolveByKeep() was called as part of --fix-missing
* test-dont-forget-conflicts-via-unknown-architectures: Use install, not upgradeJulian Andres Klode2025-02-142-2/+2
| | | | | The 3.0 solver does not support upgrade arguments to override the policy.
* Fix test-phased-updates-upgradeJulian Andres Klode2025-02-142-3/+2
| | | | | | | Our upgrade policy does not support specifying packagenames to upgrade commands that are not subject to the policy. It's possible this can be addressed at a later time, but let's not block the rest of the test from running.
* solver3: Fix ordering of or groupsJulian Andres Klode2025-02-142-10/+33
| | | | | | | | | | | | | | | | | | | | | | We inadvertently performed a global ordering of all possible solutions for the or group using CompareProviders3. This however is not correct, as we lose the ordering of the dependency group *too* much. Mostly this has no effect, but you can see for example in test-explore-or-groups-in-markinstall various instances of it. Adjust said test case to work with the 3.0 solver to the extent possible under the current design. The 3.0 solver does Recommends after processing any manually installed packages; as such the various Recommends test cases do not work: A `Recommends: okay|upgrade` will not upgrade `upgrade` if it visited `upgrade` first. This may change at a future time, but the correct semantics for Recommends are not entirely clear. Notably, the existing solver is not always consistent. You can see here where they matter, but recently I added test-solver-recommends-depends in which the Recommends do not influence the choice of other Depends.
* solver3: Implement phasing as part of strict pinning rulesJulian Andres Klode2025-02-141-4/+1
| | | | | | | | Phased updates are ignored when strict pinning is on; such that only the installed version will be available. By design of SAT solvers, this means that the version selection clause is unit, and hence the version can be directly propagated, i.e. that choice is safe.
* solver3: Correctly call MarkKeep() for kept back packagesJulian Andres Klode2025-02-141-11/+1
| | | | | | This fixes the difference in test-unpack-different-version-unpacked, but more importantly this is needed for phasing to be displayed correctly once that is implemented.
* test: Fix 7 test cases for 3.0 solver, annotate othersJulian Andres Klode2025-02-1410-36/+112
| | | | | Fix the test cases we can fix directly; add annotations where we know what work is needed, next we'll look at the other bugs.
* test: Support comments in --skip/--only filesJulian Andres Klode2025-02-141-2/+2
| | | | Strip everything after "#" and spaces before it.
* solver3: Install Essential on dist-upgradeJulian Andres Klode2025-02-142-3/+14
| | | | | | | | This is a bit gnarly, but dist-upgrade is mapped to is an upgrade + removals allowed + installs allowed :D
* solver3: Defer 3.0 'deep' autoremoval to 3.1, fix autoremoveJulian Andres Klode2025-02-142-7/+2
| | | | | | Restore the depcache's MarkRequired logic for 3.0 solver; and change the MarkInstall() call to pass a more correct value for FromUser, to not override an existing automatic status.
* solver3: Reject reverse conflicts on installJulian Andres Klode2025-02-143-9/+6
| | | | | | We forgot this in the previous iteration. This makes the reasoning in the test cases much nicer and apt-test's mantic-to-noble-jak.edsp now finishes rather than running into the timeout (potentially forever).
* solver3: Reject reverse dependencies nativelyJulian Andres Klode2025-02-145-18/+9
| | | | | | | | | | | | | | | | | | Instead of utilizing the reverse depends functionality of the cache and marking all possible reverse dependencies for removal, mark them ourselves by keeping track of reverse-implication-clauses. Notably, this improves the reverse dependency rejection substantially: The previous RejectReverseDependencies() function did not handle Provides. For this to work correctly right now, we need to discover optional clauses too when queuing them. This is somewhat suboptimal as we technically we don't care if they become unsat, we just waste time tracking them. The tests get a bit awkward, but oh well, we use what we can use.
* solver3: Discover recursive dependenciesJulian Andres Klode2025-02-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | When we have discovered all clauses for a version, discover each possible solution for the clauses. This means that when Discover(foo) is called _anything_ that could lead to foo becoming uninstallable is translated; so we can extend this next by keeping a list of reverse dependencies for each package and rejecting those. We limit the discovery to those variables that we did not already enqueue as a negative fact at the root level, as those can never become true. We are utilizing a queue here which is not the most performant solution possible, but where it excels is in producing usable stack traces when debugging. Traversing the entire dependency tree using recursion can easily produce thousand levels of recursion. The queue means that we discover packages in a breadth-first manner compatible with the order in which we propagate dependencies, which is helpful for consistency. The queue did not appear as a bottleneck in benchmarking. If it did, we could switch to a grow-only ring buffer (std::queue's underlying deque also shrinks automatically which is suboptimal).
* solver3: Defer version selection where possibleJulian Andres Klode2025-02-149-31/+37
| | | | | | | | | | | | | If a dependency can be satisfied by all versions of a package, add the package to the clause instead of the version object. This works only if there are no providers for the package: Providers are quite hard to enumerate over and make sure that all versions of a package satisfy the provider dependency. Implement arbitrary selection between packages and versions for the CompareProviders class: We pick the best version for each package and then pit them against each other.
* test: Fix skipping test casesArnaud Rebillout2025-02-121-2/+2
| | | | | | | | | | | The `--skip` option was introduced in commit 1fbdc04be7547b8c4bb84f400329415ea0bc60b5, and it was broken straight from the start for the case where `TESTTORUN` is not set (see last hunk in this commit, the mistake is obvious). It went unnoticed as the GitLab CI runs tests with the `-j` option, so `TESTTORUN` is set. While ci.debian.net runs without -j, but doesn't skip any test, so it doesn't trigger the bug either.
* solver3: Replace PropagateInstall() with Discover()Julian Andres Klode2025-02-071-0/+1
| | | | | | | | | | | | | | | Just propagate the stored clauses after we have discovered them; this is quite straightforward. We now more reliably discover common dependencies at the package level, adjust the test case accordingly. The next step is to make discovery recursive, or iterative, to build an entire recursive tree from all roots, and then we can reject reverse dependencies based on it. A bunch of refactorings are needed in the process. We remove the useless Hint enumeration and insert a flags struct into the State, such that we can record whether a package/version has been discovered, to avoid spending double time on discovery.
* solver3: Extract TranslateOrGroup() out of EnqueueOrGroup()Julian Andres Klode2025-02-071-1/+1
| | | | | | | This is not *purely* a refactoring, we accidentally used the version of the dependency when enqueuing conflicts rather than the reason, so the conflict string in the test case is different; the logging had the same issue.
* Also support debian-ports modernizationSamuel Thibault2025-02-021-0/+12
| | | | That just needs using '-' to replace spaces in Origin to get the keyring file name.
* solver3: Remove fixed test cases from broken listJulian Andres Klode2025-01-301-2/+0
|