The main changes here are to leverage PackageError and PackageName more.
I also fixed a bug I introduced by misunderstanding code in auto_deps. auto_deps should return PackageNames instead of Strings, but I converted the Strings too early.
This deduplicates code as well as forces names to be sanitized. The API
for both redox-pkg and cookbook need some reimagining due to the
reshuffling, but this patch is not concerned with that as yet.
Closes: redox-os/redox#1600, redox-os/redox#1598
Probably closes: redox-os/installer#24
Some packages place files in nested directories, such as
`lib/packagename` or `libexec/ARCH/gcc`. If these directories are not
scanned, the dependencies key in stage.toml will be empty which leads to
dependencies not being installed in the image.
This may be the case if repo.sh did not build any TOML recipes. In that
case, we can just exit cleanly.
Signed-off-by: Anhad Singh <andypython@protonmail.com>
Fixes the bug where libgcc was unnecessarily building multiple times.
Which in turn caused other packages to rebuild.
Example: The source path is set to `prefix/${TARGET}/sysroot`. Currently
the way `cook` handles `source.path` ends up messing the timestamp of
`recipes/libs/libgcc/source` as it just performs `copy_dir_all(path,
&source_dir)` without checking if the timestamp of the source path
specified in the recipe was changed. This would consequently update the
timestamp of the source and cause it to rebuild.
Signed-off-by: Anhad Singh <andypython@protonmail.com>
Before it was not check if the shared dependencies of a package had been
built. This resulted in the installer panicking as it tried to install
a non-built package. This commit fixes that issue.
Signed-off-by: Anhad Singh <andypython@protonmail.com>
By default all libraries and applications that can be dynamically linked
will be dynamically linked. You can override this behaviour by setting
the `COOKBOOK_PREFER_STATIC` environment variable. Note that if you
perviously did not use this flag, it might (most likely will) require a
complete userland sysroot recompilation.
It will look like this:
```bash
$ make clean
$ COOKBOOK_PREFER_STATIC=yes make image
```
For testing, the following will also work:
```bash
$ COOKBOOK_PREFER_STATIC=yes make cr.{PACKAGE_NAME} # obviously replace
# PACKAGE_NAME with
# the name of a package :)
```
Signed-off-by: Anhad Singh <andypython@protonmail.com>