getsolus / ypkg

Modern, declarative, structured build format
https://getsol.us
GNU General Public License v3.0
22 stars 11 forks source link

ypkg-install-deps: add --dry-run and --json #57

Open GZGavinZhao opened 8 months ago

GZGavinZhao commented 8 months ago

The JSON dump has the following format:

[
{
    "name": "<package-name>",
    "version": "<version>",
    "release": "<relno>",
    "packageHash": "<hash-of-eopkg>",
}
]

This not only dumps every single (including transitive) dependencies, but also dumps the currently installed packages on the system. If we run this inside the solbuild chroot and run sudo eopkg up prior to running ypkg-install-deps --dry-run --json package.yml, we should get a (mostly) reproducible JSON of packages that the root is comprised of. If we cache this root identified by the hash of this JSON dump, we should be able to re-use this cached root in solbuild, eliminating most if not all the time needed for dependencies to install given that no dependency is changed.

ReillyBrogan commented 8 months ago

Another approach, though I don't know how viable this is with ypkg and solbuild, is to install each package into a separate overlayfs layer. Then the individual package installations can be cached so you get even more savings.

GZGavinZhao commented 8 months ago

The only problem I could think of with this approach is how do we deal with triggers. By caching the entire root, we also cache the result of all trigger runs.