Only build specific packages from source
This change will allow most packages to be downloaded from the web package archive, while still allowing the user to modify specific packages. The filesystem config, e.g. desktop.toml
, is the main place where the user chooses what build behavior they want for a specific package, with the user creating their own filesystem config. Each package will have a spec, e.g. uutils = "recipe"
, that selects the build behavior. uutils = {}
will use the default behavior, determined by make
variables.
Proposed Behavior
Changes from current behavior:
- If
REPO_BINARY
is 0 or not set, all packages are built from source. - If
REPO_BINARY
is 1, the new functionality is enabled and packages are downloaded unless otherwise specified in the filesystem config.
Phase 1 - Allow package spec to specify build from source vs download binary package
-
If REPO_BINARY
is 1, then the build will use downloaded packages as the default. -
In the filesystem config, e.g. desktop.toml
, if a package has an empty spec, e.g.uutils = {}
, then a downloaded package will be used when imaging. -
If the spec is "recipe", e.g. uutils = "recipe"
, the package is built from source according to the recipe. If the recipe fails, it is a fatal error. This is used when a dev wants to build from the git archive or other downloaded source. -
If the spec is "recipe_no_fetch", the package is built using the recipe, but the [source]
section is skipped, and the dev must manually clone and update therecipe/source
dir. If therecipe/source
dir is missing, it is a fatal error. This is used when a dev is actively developing a package.
Phase 2 - Add caching of packages based on SHA
-
If new variable PKG_CACHE
is set to a location, e.g.build/x86_64/pkg_cache
, andPKGS_NOT_CHECKED
is NOT set or not 1, then the build will cache packages it downloads from the web archive in the specified dir. It will compare the SHA of cached packages to the web archive and download packages where the SHA does not match. -
If PKGS_NOT_CHECKED
is 1, then the build will assume cached packages are up to date, similar tomake image
. If a required package is missing, it is a fatal error. It will also assume packages built from source are up to date, so it will not execute the recipe. -
If the spec is "pkg_no_fetch", e.g. `uutils = "pkg_no_fetch", then the cached package is used, its SHA is not checked, and if it does not exist, it is a fatal error. This is used for cases where the dev wants to test a specific version of a package.
Future
-
Instead of make
variables, settings are specified in the filesystem config. -
Global setting for the web package archive -
Global setting for the package archive cache location -
Global setting for the location of the recipes -
Individual recipes that are very simple, such as make from a tarball or clone of a Rust program, may be specified in line for a package -
Individual packages may have a specific web archive or recipe location