<feed xmlns='http://www.w3.org/2005/Atom'>
<title>apt/apt-pkg/solver3.h, branch 3.1.12</title>
<subtitle>Debians commandline package manager</subtitle>
<id>https://git.kalnischkies.de/apt/atom?h=3.1.12</id>
<link rel='self' href='https://git.kalnischkies.de/apt/atom?h=3.1.12'/>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/'/>
<updated>2025-10-25T20:16:54Z</updated>
<entry>
<title>solver3: Allow removing manually installed packages</title>
<updated>2025-10-25T20:16:54Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2025-10-25T19:31:34Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=a3fca052ca21ad222ac7f2fdd7f3fe84b44beb60'/>
<id>urn:sha1:a3fca052ca21ad222ac7f2fdd7f3fe84b44beb60</id>
<content type='text'>
</content>
</entry>
<entry>
<title>solver3: Do not lose notion that we backtracked</title>
<updated>2025-10-25T20:16:54Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2025-10-25T19:25:23Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=8cd4bd5f708b69d536395675da4fce18d7f9c3f3'/>
<id>urn:sha1:8cd4bd5f708b69d536395675da4fce18d7f9c3f3</id>
<content type='text'>
Record a silly string if we backtracked such that we are aware
of it. We need to handle this in a broader fashion, but
this was at least breaking test-apt-never-markauto-sections
with remove-manual

LP: #2129819
</content>
</entry>
<entry>
<title>solver3: Eagerly satisfy previously satisfied Recommends</title>
<updated>2025-10-25T16:10:32Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2025-10-07T19:49:44Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=ffc9001b513606869c3cf94fb85a792503974d1f'/>
<id>urn:sha1:ffc9001b513606869c3cf94fb85a792503974d1f</id>
<content type='text'>
When a user ran `apt install gpg`, the solver decided to remove
`gnupg` and `seahorse` because `seahorse` was only pulled in as
a Recommends of ubuntu-desktop and Recommends were resolved after
all other dependencies.

Solve this to most extent by introducing eager optionality: These
dependencies, while they do not take part in classic unit propagation,
are otherwise treated like hard dependencies and resolved as soon
as possible rather than after any hard dependencies.

This ensures that the Recommends of ubuntu-desktop on seahorse
is retained correctly, and as a result, gnupg is updated to the
latest version.

Oops: 6c8e32eb-665d-11f0-a985-fa163ec8ca8c
</content>
</entry>
<entry>
<title>Include standard headers to fix clang compiler error</title>
<updated>2025-06-18T14:03:24Z</updated>
<author>
<name>Biswapriyo Nath</name>
<email>nathbappai@gmail.com</email>
</author>
<published>2025-06-18T14:03:19Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=06d0c12be00ee50c965830127f5812d2156681b1'/>
<id>urn:sha1:06d0c12be00ee50c965830127f5812d2156681b1</id>
<content type='text'>
This commit fixes the following compiler errors.
apt-pkg/acquire.cc:833:51: error: no template named 'function' in namespace 'std'
apt-pkg/contrib/error.cc:198:59: error: no member named 'front_inserter' in namespace 'std'
apt-pkg/solver3.h:44:22: error: no template named 'is_trivially_constructible_v' in namespace 'std'
methods/http.cc:1029:24: error: no member named 'inserter' in namespace 'std'
</content>
</entry>
<entry>
<title>solver3: Avoid FTBFS with g++ 14.2 on arm{el,hf}</title>
<updated>2025-06-10T18:51:09Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2025-06-10T18:51:09Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=d9b87e3e2b2615eb3be1e6a4413aa18384f04328'/>
<id>urn:sha1:d9b87e3e2b2615eb3be1e6a4413aa18384f04328</id>
<content type='text'>
With an explicit {} initialization, g++ 14.2 on armhf and armel
seems to generate the default constructor for the vector too early,
or in the first place, outside of solver3.cc where the constructor
is defined.

Without {}, this compiles again.

    In file included from /usr/include/c++/14/vector:66,
                     from /&lt;&lt;PKGBUILDDIR&gt;&gt;/obj-arm-linux-gnueabihf/include/apt-pkg/cachefilter.h:14:
    /usr/include/c++/14/bits/stl_vector.h: In instantiation of ‘constexpr std::_Vector_base&lt;_Tp, _Alloc&gt;::~_Vector_base() [with _Tp = APT::Solver::Work; _Alloc = std::allocator&lt;APT::Solver::Work&gt;]’:
    /usr/include/c++/14/bits/stl_vector.h:531:7:   required from here
      531 |       vector() = default;
          |       ^~~~~~
    /usr/include/c++/14/bits/stl_vector.h:369:49: error: invalid use of incomplete type ‘struct APT::Solver::Work’
      369 |                       _M_impl._M_end_of_storage - _M_impl._M_start);
          |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
    In file included from /&lt;&lt;PKGBUILDDIR&gt;&gt;/apt-pkg/edsp.cc:22:
    /&lt;&lt;PKGBUILDDIR&gt;&gt;/obj-arm-linux-gnueabihf/include/apt-pkg/solver3.h:87:11: note: forward declaration of ‘struct APT::Solver::Work’
       87 |    struct Work;
          |           ^~~~
    /usr/include/c++/14/bits/stl_vector.h: In instantiation of ‘constexpr std::_Vector_base&lt;_Tp, _Alloc&gt;::~_Vector_base() [with _Tp = APT::Solver::Solved; _Alloc = std::allocator&lt;APT::Solver::Solved&gt;]’:
    /usr/include/c++/14/bits/stl_vector.h:531:7:   required from here
      531 |       vector() = default;
          |       ^~~~~~
    /usr/include/c++/14/bits/stl_vector.h:369:49: error: invalid use of incomplete type ‘struct APT::Solver::Solved’
      369 |                       _M_impl._M_end_of_storage - _M_impl._M_start);
          |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
    /&lt;&lt;PKGBUILDDIR&gt;&gt;/obj-arm-linux-gnueabihf/include/apt-pkg/solver3.h:88:11: note: forward declaration of ‘struct APT::Solver::Solved’
       88 |    struct Solved;
          |           ^~~~~~
</content>
</entry>
<entry>
<title>solver3: Explicitly declare and define ~Solver</title>
<updated>2025-06-10T14:27:36Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2025-06-10T11:44:18Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=060f4e274f08ea338158606fc81b451924a293d0'/>
<id>urn:sha1:060f4e274f08ea338158606fc81b451924a293d0</id>
<content type='text'>
On recent armfhf and s390x builds in the PPA, the compiler seems to have
generated the destructor at the wrong point where the definitions where
not yet complete, and it does seem ill-advised to rely on a
default-constructed destructor in the solver for future ABI sake.

In file included from /usr/include/c++/14/vector:66,
                 from /&lt;&lt;PKGBUILDDIR&gt;&gt;/obj-arm-linux-gnueabihf/include/apt-pkg/cachefilter.h:14:
/usr/include/c++/14/bits/stl_vector.h: In instantiation of ‘constexpr std::_Vector_base&lt;_Tp, _Alloc&gt;::~_Vector_base() [with _Tp = APT::Solver::Work; _Alloc = std::allocator&lt;APT::Solver::Work&gt;]’:
/usr/include/c++/14/bits/stl_vector.h:531:7:   required from here
  531 |       vector() = default;
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:369:49: error: invalid use of incomplete type ‘struct APT::Solver::Work’
  369 |                       _M_impl._M_end_of_storage - _M_impl._M_start);
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from /&lt;&lt;PKGBUILDDIR&gt;&gt;/apt-pkg/edsp.cc:22:
/&lt;&lt;PKGBUILDDIR&gt;&gt;/obj-arm-linux-gnueabihf/include/apt-pkg/solver3.h:87:11: note: forward declaration of ‘struct APT::Solver::Work’
   87 |    struct Work;
      |           ^~~~
/usr/include/c++/14/bits/stl_vector.h: In instantiation of ‘constexpr std::_Vector_base&lt;_Tp, _Alloc&gt;::~_Vector_base() [with _Tp = APT::Solver::Solved; _Alloc = std::allocator&lt;APT::Solver::Solved&gt;]’:
/usr/include/c++/14/bits/stl_vector.h:531:7:   required from here
  531 |       vector() = default;
      |       ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:369:49: error: invalid use of incomplete type ‘struct APT::Solver::Solved’
  369 |                       _M_impl._M_end_of_storage - _M_impl._M_start);
      |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/&lt;&lt;PKGBUILDDIR&gt;&gt;/obj-arm-linux-gnueabihf/include/apt-pkg/solver3.h:88:11: note: forward declaration of ‘struct APT::Solver::Solved’
   88 |    struct Solved;
      |           ^~~~~~
</content>
</entry>
<entry>
<title>solver3: Merge intersecting dependencies</title>
<updated>2025-05-27T13:56:55Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2025-05-27T12:24:09Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=eafc52e942d4daec30fb80e70c035ed935f31afb'/>
<id>urn:sha1:eafc52e942d4daec30fb80e70c035ed935f31afb</id>
<content type='text'>
If a package declares multiple dependencies that can be solved by
the same packages we should use the common set of packages to
solve them.

A common example is requiring the same Debian source version, or the
same upstream version as in our test case:

    git-ng Depends: git (&gt;&gt; 1:2.26.2), git (&lt;&lt; 1:2.26.2-.)

The solver expands this to the concrete objects:

    git-ng Depends: "real git" (= 1:2.26.2-1) | chaos-actor, "real git" (= 1:2.26.2-1) | "real git" (= 1:2.25.1-1)

When given an upgrade request, the solver would now choose

    chaos-actor               to satisfy git (&gt;&gt; 1:2.26.2)
    "real git" (= 1:2.25.1-1) to satisfy git (&lt;&lt; 1:2.26.2-.)

To satisfy the two constraints, which is not the intended outcome.

Address this problem by introducing a concept of merged clauses:
If two dependencies of a package have overlapping solutions, replace
the dependency by the intersection, and record the merged clause
instead, this leads to a single clause:

    Depends: git (&gt;&gt; 1:2.26.2) and git (&lt;&lt; 1:2.26.2-.)

which expands to just the real git binary.

The implementation is a bit finicky in that it removes the variables
from the original clause which may not be helpful for debugging, but
it records the clauses merged with, as seen in the test case, so the
reasoning is clear.

LP: #2111792
</content>
</entry>
<entry>
<title>solver3: Initialize startTime if not set in Pop()</title>
<updated>2025-05-26T10:43:24Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2025-05-26T10:42:58Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=6c3196950acb6a1351c221c74edd9c3ba691b7e5'/>
<id>urn:sha1:6c3196950acb6a1351c221c74edd9c3ba691b7e5</id>
<content type='text'>
If the user pushes Assumptions that fail, we could inadvertently
timeout during the Pop() as the variable was not initialized.

Always initialize it to 0, and if we haven't set an actual time
by the time we Pop() set it there.
</content>
</entry>
<entry>
<title>solver3: Remove Work::choice</title>
<updated>2025-05-26T10:08:29Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2025-05-20T09:42:34Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=4f5b0fe1d6af3a5cce15636b9c5307438a9c2d9f'/>
<id>urn:sha1:4f5b0fe1d6af3a5cce15636b9c5307438a9c2d9f</id>
<content type='text'>
Instead of having the historic choice here, follow MiniSAT and
use the assigned variable from the tail. This should also make
the Assume() function work now, albeit we still need to actually
migrate to it.

This is a first step towards refactoring the Solve() loop to use
a propagate/find next literal/assume it kind of loop, albeit there
is a bit more to prepare there as we need to also reinsert work
items when backtracking.
</content>
</entry>
<entry>
<title>Introduce apt why, apt why-not</title>
<updated>2025-05-19T15:20:09Z</updated>
<author>
<name>Julian Andres Klode</name>
<email>jak@debian.org</email>
</author>
<published>2025-05-19T12:17:23Z</published>
<link rel='alternate' type='text/html' href='https://git.kalnischkies.de/apt/commit/?id=7724d170751b3dc1717ba7a08881437cf7151996'/>
<id>urn:sha1:7724d170751b3dc1717ba7a08881437cf7151996</id>
<content type='text'>
These are implemented somewhat differently from aptitudes
why and why-not commands: They produce the actual solver
trace for why a particular decision has been taken.

For the why-not case, we need to explicitly discover our
specified package, as if nothing else depends on it in
our graph, it would otherwise always be undiscovered and
conflicts not detected (see e.g. level-3 in the test).
</content>
</entry>
</feed>
