This pullrequest removes redundant codepaths in
xbps-src-do{build,configure,install}.sh and joins the code in the
run_step function. This causes slightly different behavior to
do_install:
Do install will chdir to wrksrc only _before_ the first step. The
current behavior is that pre_install will run without a chdir, do_ and
post_ is runned with a chdir. This is a subtle but breaking change and
may cause some templates to break at install phase.
Add another stage 'check' between 'build' and 'install'. It is be enabled using the
variable XBPS_CHECK_PKGS=yes and disabled if unset, set to "0" or "no" in your
local etc/conf.
A new xbps-src option `-q` for `quick` will disable XBPS_CHECK_PKGS by overriding it to 0.
If enabled, `common/xbps-src/shutils/xbps-src-docheck.sh` checks for an existing
`do_check()` function in the package's template and, if it exists, calls it.
A new template variable `checkdepends` may be present and list packages required
to run the `do_check()` function. Example: `checkdepends="bc unittest-cpp"`.
When building with -C and without -t (xbps-uchroot(1) with overlayfs),
make sure to remove autodeps prior to start resolving dependencies.
This is necessary for cases where a previous built pkg contains the
same build dependency required for another pkg with -C, resulting
in dependencies being detected as installed and later removed.
Thanks to @dominikh and @Gottox for info and comments.
This was added to make sure pkg file metadata contains a different mtime
(in seconds precision), but building multiple pkgs in less than a second
will be really strange.
The build.sh script is now responsible to handle all the logic to build
a source package and its subpackages, as well as all its required
build dependencies. Thanks to this and subshells, dependencies are now
built into its own child process, creating a process tree that can go
nested as long as your system allows forking and has enough memory :-)
This fixes some issues that have been while building pkgs that have lots
of nested dependencies.
XBPS_STATEDIR is created in XBPS_BUILDDIR/.xbps-${sourcepkg}-${version}
and contains logs and state files for all phases, as well as wrappers.
We can now inspect the output from all hooks.
Those helpers were just setting up some extra functions that can be used
on templates, and this can be done already via environment, so let's remove
the helpers completely.
The prepare-32bit hook has been moved to the pre-pkg stage and now
those hooks are executed as part of the install phase. That means that
pre-pkg hooks are now independently run for the subpkgs and the sourcepkg
after the install-destdir phase and pre/do/install hooks.
As bonus, finally correct rdeps can now be collected for the 32bit pkgs
and works for all them, without the need to sort the order of subpkgs!