| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We inadvertently considered more upgrades as a better solution in
all cases, but if we are *installing* rather than upgrading, we
should count upgrades as a negative.
Change the code to accomodate that. This requires a few more
tricks:
- We remove the keep count check. This does not appear to work
correctly and would have prevented the fix. We are already
counting all possible changes, so why bother.
- We need to subtract the upgrade count from the install count
(upgrades are a class of installs) since we now allow comparing
solutions with different upgrade counts for install counts.
- After comparing the "new install count", we now compare upgrade
count too, in the opposite direction of upgrading.
To test, we abuse that solver 3.0 does not upgrade all packages
in a source package when using the install command.
LP: #2105395
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
The error messages are multi-line now, so need correct escaping.
LP: #2104276
|
| |
|
|
|
|
| |
Use setenv() to avoid overriding user defined variables.
LP: #2103921
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
| |
whoopsie does not accept empty values
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
These are faster to generate and significantly smaller.
|
| |
|
|
| |
indextargets --format
|
| |
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| | |
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
This is important for upcoming multi-line solver error message
work.
|
| |
|
|
| |
Reported-by: cacin on irc
|
| |
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
Implement the moving of the auto bit. The whole auto-bit management
is not entirely optimal yet, but this works.
|
| |
|
|
| |
string{=> _view})
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
This allows it to work with solver3 before that feature is implemented.
This essentially reverts the change to that test made in
119a8d0ed19a4e946591b9aef7d662e14ca7ece5
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
| |
The 3.0 solver does not support upgrade arguments to override the
policy.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
| |
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.
|
| |
|
|
| |
Strip everything after "#" and spaces before it.
|
| |
|
|
|
|
|
|
| |
This is a bit gnarly, but dist-upgrade is mapped to
is an upgrade + removals allowed + installs allowed
:D
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|