summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Release 2.9.282.9.28Julian Andres Klode2025-02-075-6/+41
|
* Merge branch 'solver3'Julian Andres Klode2025-02-074-300/+383
|\
| * solver3: Avoid std::vector for statically sized arraysJulian Andres Klode2025-02-072-26/+70
| | | | | | | | | | | | | | | | | | | | The bounds checking on the vector accesses is killing performance, so switch from vector to a basic array, given that we don't actually need _any_ functionality from vector... Of course while we are at it, let us define a safe wrapper around it so we cannot accidentally index arrays for package IDs with version IDs and whatnot.
| * solver3: Add const where helpfulJulian Andres Klode2025-02-072-10/+24
| | | | | | | | | | operator[] is a bit annoying here, but oh well, what can we do?
| * solver3: Point to stored clauses, do not copy themJulian Andres Klode2025-02-072-38/+41
| | | | | | | | | | | | This makes Work trivially destructible, and in turn solved, allowing their queues to be destructed without running destructors, and avoiding the copy should have a nice performance improvement.
| * solver3: Use a package clause for optional rootsJulian Andres Klode2025-02-072-6/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of iterating over the version here and picking it, just enqueue the package as well, which should allow us to select the version at a later time. This also causes a funny inverse problem now, though, as was evidenced in one of the test cases: To summarize, if our optional roots are all single items, they will be considered soft-unit, causing them to be processed in order. However it can be that an optional root has a specific version selected because another version was rejected. Consider X Conflicts A (= 1) A, B have 2 versions: '2' available, '1' installed B (= n) Depends A (= n) Run `apt install X`. The expected result is for A and B to be upgraded to version 2. With only a package root, if B appears in the cache before A however, we will get: Install X Reject A (= 1) Install B Install B (= 1) # keep it installed Reject A (= 2) => A is being removed as both versions are rejected Hence we do also need to re-introduce the additional version clause, now we get: Install X Reject A (= 1) Install A (= 2) # it got "promoted" to a 'stronger' soft-unit Install B Fail B (= 1) # keep it installed Install B (= 2) Introduce a root state to hold all the clauses that don't have another owner. moo
| * solver3: Refactor Dump() to toString()Julian Andres Klode2025-02-072-54/+27
| | | | | | | | | | This vastly simplifies the code at the expense of performance, lol.
| * solver3: Support comparing packages and versionsJulian Andres Klode2025-02-071-8/+15
| | | | | | | | | | | | | | | | | | | | | | When comparing packages, we compare the best version for the package. To determine the best version, the rules for comparisons are applied normally. This allows us to mix packages and versions in a clause as the solutions for a dependency, which means we'll be able to defer the selection of a particular version of a package to a later time.
| * solver3: Replace PropagateInstall() with Discover()Julian Andres Klode2025-02-073-93/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-073-41/+43
| | | | | | | | | | | | | | 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.
| * solver3: Extract Clause out of WorkJulian Andres Klode2025-02-072-66/+86
| | | | | | | | | | Extract clause into a separate struct and embed a copy of it in our Work class.
| * solver3: Simplify WhyStr()Julian Andres Klode2025-02-071-16/+5
| | | | | | | | Reuse the generic variable rendering
| * solver3: Cache all configuration callsJulian Andres Klode2025-02-072-9/+10
| |
| * solver3: Cache calls to policyJulian Andres Klode2025-02-072-6/+22
| | | | | | | | It's a bit silly otherwise.
| * solver3: Propagate single choice clauses as factsJulian Andres Klode2025-02-072-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | This removes a bunch of complexity, and generalizes the propagation behavior, such that we don't need to do if (w.solutions.size() == 1 && not w.optional) Enqueue() else AddWork(w); in our callers.
| * solver3: Annotate all bool functions with [[nodiscard]]Julian Andres Klode2025-02-071-12/+12
| | | | | | | | | | It is very important that we check the return value of all these functions, otherwise the logic is wrong.
| * solver3: Early exit when propagating satisfied clausesJulian Andres Klode2025-02-071-4/+5
| |
| * solver3: Partially generalize work items from Version to VarJulian Andres Klode2025-02-072-31/+46
| | | | | | | | | | | | | | | | Store all possible solutions and choices as Var. Currently any Var in here must be a Version because CompareProviders3 cannot compare versions against packages yet, but in the future (TM), this will allow storing packages directly in clauses, which allows defering version selection to a later point.
| * solver3: Simplify work orderingJulian Andres Klode2025-02-071-14/+4
| | | | | | | | | | | | | | | | | | | | Moving the optional != b.optional comparison ahead of the group one allows us to get a better behavior; and now we avoid the nested if. Also remove the special cases that ordered based on the reason of the work item, these have been superseded by groups a while ago.
| * solver3: Drop unused upgrade flagJulian Andres Klode2025-02-072-5/+3
|/ | | | This was leftover from before the groups were added.
* Merge branch 'dpkg-admindir' into 'main'Julian Andres Klode2025-02-071-0/+7
|\ | | | | | | | | dpkg: Pass --admindir if a different one is specified See merge request apt-team/apt!445
| * dpkg: Pass --admindir if a different one is specifiedJulian Andres Klode2025-02-071-0/+7
|/ | | | | | | Otherwise if we set e.g. Dir, we end up with the foreign architectures from the host which is wrong. Fixes: 8e6a86aa3bc6d5a9013bb42fccea9bbce3fd97e2
* Merge branch 'editsources' into 'main'Julian Andres Klode2025-02-071-2/+0
|\ | | | | | | | | edit-sources: don't force .list as suffix See merge request apt-team/apt!448
| * edit-sources: don't force .listChristopher Bock2025-02-071-2/+0
|/
* Merge branch 'modernize-sources' into 'main'Julian Andres Klode2025-02-071-0/+1
|\ | | | | | | | | completion: modernize-sources #1094904 See merge request apt-team/apt!447
| * completion: Add modernize-sources Christopher Bock2025-02-071-0/+1
|/ | | | Closes: #1094904
* modernize-sources: Avoid opening /dev/stdout for simulateJulian Andres Klode2025-02-041-5/+4
| | | | | | | /dev/stdout may not exist, so let's instead just reference the std::cout stream. Reported-by: h01ger on IRC
* Release 2.9.272.9.27Julian Andres Klode2025-02-035-6/+37
|
* Merge branch 'boot-space-2' into 'main'Julian Andres Klode2025-02-033-36/+29
|\ | | | | | | | | Correctly calculate kernel size in /boot See merge request apt-team/apt!444
| * Measure BootSize as integerJulian Andres Klode2025-02-033-5/+5
| | | | | | | | I don't know why I used a double here this is awkward.
| * Correctly calculate kernel size in /bootJulian Andres Klode2025-02-031-32/+25
|/ | | | | | | | | | | | Change the code to get the size from the existing vmlinuz, rather than using the package size, which only worked in Ubuntu, and possibly not on all kernel packages either. Refactor the code a bit to avoid the nested if as well, and use off_t to measure and sum the sizes before switching to floating point. Closes: #1085184
* Merge branch 'main' into 'main'Julian Andres Klode2025-02-032-1/+13
|\ | | | | | | | | Also support debian-ports modernization See merge request apt-team/apt!443
| * Also support debian-ports modernizationSamuel Thibault2025-02-022-1/+13
|/ | | | That just needs using '-' to replace spaces in Origin to get the keyring file name.
* Merge branch 'fix/stats' into 'main'Julian Andres Klode2025-01-314-100/+111
|\ | | | | | | | | `stats` rabbithole: Do not overflow ver/desc<->file relation counters See merge request apt-team/apt!441
| * Include Extra in the size counted for Version structDavid Kalnischkies2025-01-301-1/+1
| | | | | | | | | | | | It is a tiny struct, so the difference in 'stats' is minor even with all the versions but it is more correct and also helps in case the Extra struct is changed to predictably trigger a binary cache invalidation.
| * Record all available sources for descriptionsDavid Kalnischkies2025-01-302-56/+59
| | | | | | | | | | | | | | | | | | | | | | | | Avoiding duplications is one thing, but it could also be handy to know all sources for a description so that you can e.g. avoid opening another file or similar such if its also present in one you already have open. Given how the structures were set up this was probably intended all along and either worked at some point or was abandoned for the duplicates that we started culling heavily with the introduction of MultiArch as at that point they blew up the cache and needed to be dealt with.
| * Do not create descriptions structs for each architectureDavid Kalnischkies2025-01-301-6/+9
| | | | | | | | | | | | | | | | The architectures are supposed to share the descriptions as they are (very usually) the same, but the code was happily creating structs for every architecture of a package which is especially pointless as for e.g. Debian those will be the short description likely superseded in output and all uses by the 'en' "translation".
| * Drop unused version stanza size info from binary cacheDavid Kalnischkies2025-01-303-36/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Same reason as with the description size before, but this one had actually one extremely dated user in src:apt left with dumpavail, which is changed to an implementation that is (in comparison) a bit slower, but should be good enough for a command that is ideally not used anymore (even if codesearch suggests otherwise). After all, what makes this a bit slower is not that we don't know the size, but that this one does additional work preparing for accessing the fields which we don't do. In exchange pkgTagFile has a better implementation for "Jitter" than the old code that we would "just" need to copy here if speed were really an issue.
| * Drop unused description size info from binary cacheDavid Kalnischkies2025-01-302-5/+11
| | | | | | | | | | | | | | | | | | | | | | Nothing in src:apt uses this information and that isn't all to surprising as it is usually not that interesting to know how big a specific stanza of a description is as the max size is available and you are usually working with more than one description. So this information just takes up space in our binary cache… 64 bits per structure which can quickly add up to whole MBs depending on how many (and which) sources you have enabled.
| * Do not overflow ver/desc<->file relation countersDavid Kalnischkies2025-01-301-0/+5
|/ | | | | | | | | | | | | | | | The counters aren't used for anything really except for the 'stats' command that is off in its display and calculation due to 16bit not being enough for counting all the relations we have. Semi-broken more than a decade ago as I accidentally aligned it with the other file relation counters which count far less frequent ones through, so 'unsigned long' should have been changed to the id type rather than the smaller fileid type. Of course, this commit only prepares the fix as this would be an ABI break, so with the current ABI we are still overflowing. Regression-of: 4ad8619bb1f0bf777d17c568bb7a6cf7f30aac34
* solver3: Credit MiniSATJulian Andres Klode2025-01-301-0/+11
| | | | Gbp-Dch: ignore
* Merge branch 'solver3' into 'main'Julian Andres Klode2025-01-3017-93/+146
|\ | | | | | | | | solver3: Unit propagation queues See merge request apt-team/apt!440
| * solver3: Remove fixed test cases from broken listJulian Andres Klode2025-01-301-2/+0
| |
| * solver3: Use a propagation queueJulian Andres Klode2025-01-3014-41/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of directly propagating in a recursive fashion, queue propagations in a queue and work on them in a loop per the miniSAT paper. We call Propagate() only at the end of the FromDepCache() function and then in the Solve loop. Delaying the initial propagation means that we get a stronger reasoning: Assume you have x->a->b->c, y->c and you install x,y: - Previously we traversed: x, y, x->a, a->b, b->c, (y->c) - but now we traverse: x, y, x->a, y->c, a->b, (b->c) Notably c now has the implication y->c instead of x->a->b->c. Inside the solver we need to call Propagate in a loop: Propagating facts can fail and we then backtrack. If backtracking is succesful, we have gained a new fact to propagate.
| * solver3: Replace Install() with Enqueue(), and PropagateInstall()Julian Andres Klode2025-01-302-44/+36
| | | | | | | | | | | | Do not enqueue common dependencies if a version is selected already, this avoids test suites changing now in behavior as the ordering is different.
| * solver3: Remove NewUnsatRecommends groupJulian Andres Klode2025-01-303-3/+46
| | | | | | | | | | | | This is more or less unused; but it particularly has the bad problem of forcing new unsat recommends to be solved *before* dependencies. Which is awkward.
| * solver3: Soft unit propagation for optional itemsJulian Andres Klode2025-01-302-3/+14
|/ | | | | If both items are optional, unit items should be processed first.
* Brazilian Portuguese program translation updateRafael Fontenelle2025-01-301-549/+683
| | | | Closes: #1092563
* Merge branch 'mr-update-zh_cn-translation-apt2.9.24' into 'main'Julian Andres Klode2025-01-281-39/+29
|\ | | | | | | | | po/zh_CN.po: Refresh Simplified Chinese translation for apt See merge request apt-team/apt!432
| * po/zh_CN.po: Refresh Simplified Chinese translation for aptBoyuan Yang2025-01-281-39/+29
|/