Commit Graph

154 Commits

Author SHA1 Message Date
Ettore Di Giacinto
57181d7cbf Add FindPackages()
The version inmemory is optimized, while the boltdb implementation is
not.

It returns a list of the same package but with all the versions present
in the db.
2019-12-06 16:29:15 +01:00
Ettore Di Giacinto
556668fcc4 Make Expand and Revdeps consume a database 2019-12-06 16:28:42 +01:00
Ettore Di Giacinto
595c10f357 Use fingerprint as ids in inmemorydb 2019-12-03 23:38:25 +01:00
Ettore Di Giacinto
58169770e1 Add test for FindPackageCandidate
Adapt tests for env
2019-12-01 23:24:42 +01:00
Ettore Di Giacinto
55fa7265e5 Move selection logic to a db accessor #19
In this way the compiler consume such accessor, and make it possible to expand whenever used
2019-12-01 19:11:31 +01:00
Ettore Di Giacinto
e31f8820e2 Adapt tests
Adapt docker and package tests

Fix tree test
2019-11-29 19:01:54 +01:00
Ettore Di Giacinto
d0c84d24a0 Expand also when ordering assertions 2019-11-29 19:01:52 +01:00
Ettore Di Giacinto
91b3daf180 Drop Best from solver and add cases for solver with expansion 2019-11-29 19:01:51 +01:00
Ettore Di Giacinto
4031a4ae81 Marshal JSON of package without escapes
Otherwise >, < get escaped as JSON does that in favour of browsers
2019-11-29 19:01:50 +01:00
Ettore Di Giacinto
f71cc5281e Offer World from database
Compute here world instead of scattering it in different structures.

Also move Best() in package and make expansion here #20
2019-11-29 19:01:48 +01:00
Ettore Di Giacinto
62af9c81d5 BoltDB fixups
Unmarshalling needs well-defined structs, also swap pointers in few places where needed.

There are few more TODOS pending (like getting UpdatePackage fixed properly)
2019-11-25 20:03:37 +01:00
Ettore Di Giacinto
a8b350fd8e Implement uninstall
Also add RemovePackage in database implementation (boltdb is not tested yet)

Add test case for uninstall
2019-11-24 00:16:12 +01:00
Ettore Di Giacinto
0d7b2cf448 Track installed files 2019-11-23 22:41:51 +01:00
Geaaru
4ef86170d4 package: Fix typo 2019-11-16 17:29:58 +01:00
Geaaru
8989d3f8d7 Add String implementation 2019-11-16 17:29:58 +01:00
Ettore Di Giacinto
6face9c980 Add package expansion during resolve deps
Closes #2
2019-11-16 14:58:50 +01:00
Ettore Di Giacinto
32dea6f7fd Add Best() to solver for package selection based on version 2019-11-16 14:40:58 +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
b2060c82e3 Make DB Switchable
Fixes races conditions and make the DB Switchable. Also prepare inside
the CompilationSpec the tree of the deps to be built, and parallelize
only the building jobs.

Closes #7

Signed-off-by: Ettore Di Giacinto <mudler@gentoo.org>
2019-11-16 13:26:33 +01:00
Ettore Di Giacinto
c95e0ed91d Add revdep calculation
Add CompilationSpecs type to handle slices of CompilationSpec, to
perform operation such as Unique() and Remove().

Add also dependencies and the spec associated to the Artifact, to track
how the artifact was generated.

Add revdeps compilation wrapper, and unit tests
2019-11-15 18:11:26 +01:00
Ettore Di Giacinto
83fb1d1219 Add Matches() to pkg.Package 2019-11-15 18:04:46 +01:00
Ettore Di Giacinto
891daf4b71 Add package Revdeps expansion #12 2019-11-14 23:46:52 +01:00
Ettore Di Giacinto
ef54b3d4b5 Pass world as a pointer in expand 2019-11-14 23:20:28 +01:00
Ettore Di Giacinto
4c1c7451e7 Resolve deps before compiling 2019-11-12 08:48:07 +01:00
Ettore Di Giacinto
ea2a51ce66 Implement compilation with images
A compilespec with an image defined (and no seed) can now be compiled,
and an artifact delta is provided at the end of the process.
2019-11-10 10:48:07 +01:00
Ettore Di Giacinto
639d4438e1 Adapt tests 2019-11-08 18:30:53 +01:00
Ettore Di Giacinto
61c318d549 Set path during recipe load
Set path only when the recipe is loaded and not when it gets converted. In such way the internal temporary db knows where the sources where.
2019-11-04 17:14:32 +01:00
Ettore Di Giacinto
b32a6c2286 Wrap errors 2019-11-04 17:13:53 +01:00
Ettore Di Giacinto
9dc8fccd12 Add Rel() accessor to package 2019-11-04 12:36:55 +01:00
Ettore Di Giacinto
4dab89d209 Add support to store the path of the loaded packages 2019-11-04 12:35:21 +01:00
Ettore Di Giacinto
8c86f6c84d Drop ID from marshalled content 2019-11-04 11:11:33 +01:00
Ettore Di Giacinto
9ec316312f Use singleton version of InMemoryDB when necessary (still needed from the solver) 2019-11-02 18:00:42 +01:00
Ettore Di Giacinto
4fbe84b30b Support concurrency in InMemoryDB and reach feature parity with boltdb 2019-11-02 17:56:43 +01:00
Ettore Di Giacinto
ef1d0e5573 Make also deps recalculation concurrent 2019-11-01 16:26:11 +01:00
Ettore Di Giacinto
ff98bdfc16 Enable two-pass scan
Split dependency resolving ( definition <-> db mapping ) into a method of the tree (ResolveDeps),
and do not care of looking up for packages while parsing.

Note: it is slower but it is much accurate and we can
choose what to do with the ones which aren't resolved (and show a helpful message too).
2019-11-01 11:32:17 +01:00
Ettore Di Giacinto
e5db47a679 Add Explain() to Assertions and Packages 2019-10-31 12:38:59 +01:00
Ettore Di Giacinto
a5ceafca26 Add Tree parser with bolt
Also add Tree builder (Recipe) which can recompose trees.
2019-10-31 12:38:59 +01:00
Ettore Di Giacinto
c3197d70fc Add boltdb implementation for packageset and db 2019-10-31 12:38:32 +01:00
Ettore Di Giacinto
0813f75546 Add packageset 2019-07-27 11:29:39 +02:00
Ettore Di Giacinto
db90a8f69c Add package category and make fingerprint more unique 2019-06-14 17:40:24 +02:00
Ettore Di Giacinto
b29ce651b9 Expose Uses to interface 2019-06-12 21:32:15 +02:00
Ettore Di Giacinto
caa7c788ec Drop State from package
Also tests for Clone()
2019-06-12 20:57:39 +02:00
Ettore Di Giacinto
9f3f715324 Add BuildFormula and ReuiresContains tests 2019-06-11 23:38:16 +02:00
Ettore Di Giacinto
3f762070fe Add tests 2019-06-11 23:18:16 +02:00
Ettore Di Giacinto
cab133f229 Imeplement PackageDatabase
Consume InMemoryDatabase for now, which act as a singleton in-memory db.
2019-06-11 23:04:01 +02:00
Ettore Di Giacinto
f47e907dda Refactor 2019-06-11 18:48:09 +02:00
Ettore Di Giacinto
ff582ce77c Enhance Uninstall and resolve conflict sets
Compute a minimum conflict set over the uninstall.

Adds also tests for specific cases covered by Uninstall now
2019-06-11 18:03:50 +02:00
Ettore Di Giacinto
86472e7bf5 Normalize input data beforeahead 2019-06-05 18:49:35 +02:00
Ettore Di Giacinto
632619fe91 Add uninstall
Uninstall can be done in different ways - the most accurate would be to try find a minimum subset of packages that gives conflicts and try to reduce them gradually.
E.g. this could be done with other SAT algorithms. For now we keep things simple and we compute the uninstalls as an indirect of an installation from an empty profile.

Also take care of corner cases where world has no clauses, and fixes a typo in building the world formula
2019-06-05 18:49:35 +02:00
Ettore Di Giacinto
39a3e433a7 Cleanup 2019-06-05 18:49:34 +02:00