Commit Graph

18 Commits

Author SHA1 Message Date
Ettore Di Giacinto
9bd6730aeb 🤖 Adapt makefile/scripts to ginkgo changes 2022-01-04 18:47:21 +01:00
Ettore Di Giacinto
e64f68d36b Introduce install --relaxed
It introduces a relaxed way to install packages with loose deps. Default
installation now will by default prefer up-to-date packages during
selection.

Also:
- Upgrade now it's used in install so it have to return the full system view also when there is nothing to upgrade
- Avoid checking upgrade upfront if relaxed is on
2021-10-10 00:27:58 +02:00
Ettore Di Giacinto
1ef18ed2c5 Add salted method for assertion hashing
- Add the spec Hash as salt for image hashes
- Add tests and adapt existing ones
- Use a signature to build a spec hash

Fixes: #207
2021-05-19 17:34:01 +02:00
Ettore Di Giacinto
102a788c91 Revert "Revert "Stabilize ordering graph""
This reverts commit 2b23016a51.
2020-11-02 15:43:35 +01:00
Ettore Di Giacinto
2b23016a51 Revert "Stabilize ordering graph"
This reverts commit 940f553e1c.
2020-11-02 15:43:15 +01:00
Ettore Di Giacinto
940f553e1c Stabilize ordering graph
In this way when we order, we always return the same solution order in
case there are weak deps.

The following is optional - it doesn't change the "correctness" of the
solver results: We add an extra edge between deps that
share common dependendencies. This makes the link more stronger and
balances the graph so it doesn't show different results for the same query, as they
could be shuffled as don't have a direct connection.
2020-11-02 14:30:41 +01:00
Ettore Di Giacinto
f6a4b634c1 Don't always walk all World() packages
With this change the solver during install now considers only the part
of the tree which is required to calculate the solution, it doesn't
consider anymore World() as the search space.

The search space now is narrowed down to the packages that related to
the one which we are considering.

In this subset of changes we are also optimizing the Parallel solver
avoiding an useless loop.

This change boost overall performance on large datasets which don't
necessarly have relations touching the whole tree.
2020-10-30 19:12:12 +01:00
Ettore Di Giacinto
95e640c9d0 Make solver type switchable 2020-10-29 16:32:13 +01:00
Ettore Di Giacinto
9971fe9f45
Unique hashes for packages without deps 2020-05-18 19:57:01 +02:00
Daniele Rondina
c2e9176ab2 solver.Order now return error 2020-04-09 17:07:57 +02:00
Ettore Di Giacinto
fe608469d8
Do not call solver multiple times, reuse same assertion
Introduce Cut(), it allows to filter in the assertion to achieve the same hashes
2019-12-14 15:00:16 +01:00
Ettore Di Giacinto
ff3b322ea2
Expand also when selecting candidates to install/uninstall 2019-11-29 19:01:55 +01:00
Ettore Di Giacinto
b5381e0248
Make solver consume databases instead of world lists
first step - it is slower in the implementation for now, but all cases
seems to be sorted out.
Drop Flagged() and IsSet() from solver. the solver wont care, and only
the assertion value does matter (exception for uninstall)
2019-11-29 19:01:41 +01:00
Ettore Di Giacinto
3a7cfae9ae
Adapt solver test to structure change 2019-11-23 19:01:26 +01:00
Ettore Di Giacinto
3e850e9607
Adapt tests and fixup races in spinner
Signed-off-by: Ettore Di Giacinto <mudler@gentoo.org>
2019-11-16 13:26:33 +01:00
Ettore Di Giacinto
a85f4a53ec
Fix topological ordering
Keep unordered things on top and add two ways of topological sorting

Note: AssertionHash cannot order here as doesn't know the start point
2019-11-12 17:28:22 +01:00
Ettore Di Giacinto
8550265d75
Add assertion hashing 2019-11-11 14:58:12 +01:00
Ettore Di Giacinto
2dd56e9e49
Create a type for lists of PackageAssertion, and move Order() inside it 2019-11-11 11:02:47 +01:00