Allows a template to define in which circumstances its do_check phase
should run, without requiring custom do_check definitions in each
template (also makes it easier to change how build styles do things
without checking as many templates).
Add to Manual and CONTRIBUTING as well.
Missing $XBPS_MASTERDIR/tmp caused ca-certificates and glibc-locales to
fail in the reconfigure step of binary-bootstrap, since a call to mktemp
(which I couldn't locate in source though) assumed /tmp in the chroot
would be present already.
This issue was reproducible reliably for me on NixOS by doing something
like:
rm -rf masterdir
./xbps-src binary-bootstrap
The workaround I found was:
mkdir -p masterdir/tmp # or alternatively ./xbps-src clean
# which also (re-)creates masterdir/tmp
./xbps-src binary-bootstrap
This workaround is now mirrored in chroot_prepare by ensuring that tmp
always exists.
Currently /etc/localtime is copied from the host to the chroot. Some
software expects /etc/localtime to be a symbolic link it can read to
determine the name of the time zone, so set up the expected link
structure.
xbps-src always ignore self deps in depends and in hostmakedepends
when not cross compiling. The old behaviour did only check for cross.
This now also ignores them in makedepends, but they are either way
disallowed in there, and returning an error would be correct, but
./xbps-src show-* is and never was suitable for linting, so ignore for now.
The file was created in chroot_prepare(), but the configuration
directory was being cleaned in chroot_sync_repodata(). This commit moves
the configuration to after the directories are created.
Fixes#25534
Outside of chroot, we calcucate XBPS_ALT_REPOSITORY only to throw it
away and calculate it again inside chroot. Normally, this is not problem
except when we're working with a Git's worktree, in which case, we don't
have the access to original gitdir inside chroot.
Let's bring that value from outside of chroot into it.
The code for `git.sr.ht` was almost identical to that of `hg.sr.ht`. The
main difference, aside from replacing `hg.sr.ht` in `url` with
`git.sr.ht`, was the endpoint of `url`. The `hg.sr.ht` url uses `tags`
whereas `git.sr.ht` uses `refs`.
Flag options was appended to XBPS_PKG_OPTIONS, but was later
overwritten by sourcing config. Instead, pass only flags
options in separate variable and join at very end.
To avoid scanning templates multiple times, because
symbolic links were included, use find to scan only
directories below srcpkgs and collect their
srcpkgs/<dir>/template files.
af6e1a7e79 introduces dependencies based in subpkgs,
but this makes "xbps-src show-build-deps" return cyclic
dependencies in some cases, i.e:
$ ./xbps-src show-build-deps kirigami2
cmake
extra-cmake-modules
kcoreaddons
kirigami2
qt5
$
This is because `kirigami2-devel` depends on `kirigami2`, thus
introducing a cycle.
Skip cycles completely, note that "show-build-deps" should not
be used to collect deps for cross compilation, because you can't
know what type of dependency it is: host or target.
The new behavior is basically this:
1) Local repos are installed same as before.
2) Multilib configs are now handled only if they exist. They follow
a naming system repos-{local,remote}-ARCH-multilib.conf.
3) Remote repo files follow naming repos-remote-ARCH.conf. If that
does not exist, repos-remote.conf or repos-remote-musl.conf is
used instead (fallback).
4) Cross follows the same behavior, just without multilib.
[ci skip]
That means instead of having a single hostdir/repocache, there
is now hostdir/repocache-$XBPS_TARGET_MACHINE.
This solves multiple problems:
1) When cross-compiling for different architectures and the repos
for host and target differ, you will not get signature/checksum
conflicts for noarch packages.
2) The clean-repocache command will not delete noarch packages that
don't belong to that architecture.
3) Clean mixing of glibc and musl masterdirs with the same hostdir
is now possible; even when building natively, the musl masterdir
will use its repocache-foo-musl, while the glibc masterdir will
use repocache-foo.
[ci skip]
The problem here is that newly introduced behavior in commit
b2b0409be4 resulted in builddir and
destdir *always* being removed when starting a build, as a part of
masterdir auto-update. We don't want this as we may want to resume
a previous build (e.g. by running stages individually or by resuming
a failed build from where it stopped).
Therefore, explicitly override the removal to restore previous behavior.