Commit Graph

64 Commits

Author SHA1 Message Date
Ettore Di Giacinto
25f2abf103 Do conflict with same package versions while building formula 2020-02-26 23:01:08 +01:00
Ettore Di Giacinto
7e16e0cdb6 Add HashFingerprint() to Package and consume it while generating image names
In this way we don't depend on the package fingerpint characters while generating images, allowing
to support completely semver (e.g. + character is not allowed in docker images tag).

This change is not backward compatible with images currently already built and will invalidate the cache
2020-02-19 18:28:29 +01:00
Ettore Di Giacinto
b01c017507 Add HumanReadableString() to Package 2020-02-18 18:20:45 +01:00
Ettore Di Giacinto
7e0ea34b81 Switch back to gophersat 2020-02-11 14:58:17 +01:00
Ettore Di Giacinto
6f6e2bf15f Pin to gophersat version
Having the same var in the and block seems to make gophersat crash. Even if might be unoptimal,
we need this to tighten the conditions between packages.

Switch to gophersat fork until this fix is merged upstream:

https://github.com/crillab/gophersat/pull/17
2020-02-11 09:06:57 +01:00
Ettore Di Giacinto
33b442a832 Add accessor to decode from package String() 2020-02-10 17:14:46 +01:00
Ettore Di Giacinto
4dc4205868 Drop json skip from id. It prevents storm to track entities #55 2020-02-08 18:18:05 +01:00
Ettore Di Giacinto
0e30e6a1ad Treat single conflict cases as well when building conflict formula 2020-01-31 20:50:55 +01:00
Daniele Rondina
91d05b071d Review version comparision logic 2020-01-01 13:43:21 +01:00
Ettore Di Giacinto
d941c9755b Relax best match constraint rule
Or we could return unsat
2019-12-18 19:24:44 +01:00
Ettore Di Giacinto
15250bd991 Add support for Package provides
Add "provides" field in packages (which affect both runtime and buildtime deps).
It replaces all the occurences in the deptree before solving, actually
allowing to swap packages and provide virtuals. Along with a mechanism
for package rename #25.
2019-12-17 19:32:31 +01:00
Ettore Di Giacinto
0627b03121 Add IsSelector() to Package
It indicates if the package is a selector, by checking if versions
contains constraints signs (<>=)
2019-12-17 18:00:27 +01:00
Daniele Rondina
82c9795dc3 Add pkg description, url and license
* Move to mvdan.cc/sh/v3
* Improve RDEPEND parsing
2019-12-16 23:56:58 +01:00
Ettore Di Giacinto
d583fa8bf5 Force the solver to look at the best match first
Add support clauses to force the solver to look after the best match
first.

Closes #29
2019-12-16 17:56:52 +01: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
fb68f98b15 Enforce requirements
Make explicit that at least one must be selected
2019-12-14 01:02:12 +01:00
Ettore Di Giacinto
fa79afd6ba Various fixes
We can't route the message to the spinner, we would hide deps tree
2019-12-14 00:31:21 +01:00
Ettore Di Giacinto
94f65f3c55 Drop superflous call 2019-12-14 00:07:46 +01:00
Ettore Di Giacinto
396c090bc7 Drop unused import 2019-12-13 23:46:04 +01:00
Ettore Di Giacinto
b8c62c3e85 Move selection logic to package BuildFormula() 2019-12-13 23:37:44 +01:00
Ettore Di Giacinto
926f636dff Revert "Do not allow multiple versions in the results"
This reverts commit 15534ce253.
2019-12-13 23:05:09 +01:00
Ettore Di Giacinto
15534ce253 Do not allow multiple versions in the results
This happens because we select the best instead of selecting the best match in Package BuildFormula()

- Extend the selection test
- Select from databases when ordering
- Relax assertions search
- Split compile step in test
- Adapt tests

Note: This is temporarly until we treat this case in BuildFormula() inside Package
we need to build the constraints between all the requires when expanding
and then create a new constraint that selects the best match
2019-12-13 22:10:12 +01:00
Ettore Di Giacinto
adcd8df49e Add Bigger/Lower to Package to allow version comparison easier 2019-12-13 17:18:51 +01:00
Ettore Di Giacinto
556668fcc4 Make Expand and Revdeps consume a database 2019-12-06 16:28: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
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
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
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
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
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
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