Incremental package builds and releases on v* tags (0.8.0)
build / build (push) Successful in 30m42s
build / build (push) Successful in 30m42s
- build-packages.sh rebuilds a package only when its srcpkgs/ directory changed, its binary package is missing, or a dry-run install finds a shared library Void no longer provides; DASOS_REBUILD=1 rebuilds all. An unchanged `make packages` takes 20 s instead of 17 min on the CI host - ci/release.sh publishes both ISOs and SHA256SUMS as a Gitea release when the workflow runs for a v* tag matching VERSION - README and TODO updated Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,4 +18,5 @@ exec docker run --rm --privileged \
|
||||
--volume "$out/cache/xbps:/var/cache/xbps" \
|
||||
--env HOST_UID="$(id -u)" \
|
||||
--env HOST_GID="$(id -g)" \
|
||||
--env DASOS_REBUILD \
|
||||
"$image" "$@"
|
||||
|
||||
@@ -34,6 +34,30 @@ XBPS_CHROOT_CMD=uchroot
|
||||
XBPS_MAKEJOBS=$(nproc)
|
||||
CONF
|
||||
|
||||
# A package is rebuilt only when its directory in srcpkgs/ changed since the last
|
||||
# build, its binary package is gone, or Void no longer provides a shared library
|
||||
# it links to (a soname bump there needs a rebuild here). DASOS_REBUILD=1 rebuilds all.
|
||||
stamps=$hostdir/stamps
|
||||
mkdir -p "$stamps"
|
||||
srchash() {
|
||||
(cd "$vp/srcpkgs/$1" && find . -type f -print0 | sort -z | xargs -0 sha256sum) | sha256sum | cut -d' ' -f1
|
||||
}
|
||||
# An empty root to dry-run installs into: xbps refuses unresolved shared libraries
|
||||
checkroot=$(mktemp -d)
|
||||
mkdir -p "$checkroot/var/db/xbps/keys"
|
||||
cp -a /var/db/xbps/keys/. "$checkroot/var/db/xbps/keys/"
|
||||
voidrepo=$(sed -n 's/^repository=//p' /usr/share/xbps.d/*-repository-main.conf | head -1)
|
||||
xbps-install -S -r "$checkroot" -R "$voidrepo" >/dev/null
|
||||
up_to_date() {
|
||||
local info version revision
|
||||
[[ ${DASOS_REBUILD:-} != 1 && -f $stamps/$1 && $(< "$stamps/$1") == "$(srchash "$1")" ]] || return 1
|
||||
info=$(as_builder ./xbps-src show "$1")
|
||||
version=$(sed -n 's/^version:[[:space:]]*//p' <<<"$info")
|
||||
revision=$(sed -n 's/^revision:[[:space:]]*//p' <<<"$info")
|
||||
compgen -G "$hostdir/binpkgs/$1-${version}_$revision.*.xbps" >/dev/null || return 1
|
||||
xbps-install -n -y -r "$checkroot" -R "$hostdir/binpkgs" -R "$voidrepo" "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
names=()
|
||||
for dir in /work/srcpkgs/*/; do
|
||||
name=$(basename "$dir")
|
||||
@@ -59,9 +83,16 @@ fi
|
||||
# (also as a dependency of another one) would package the stale files
|
||||
rm -rf masterdir-x86_64/destdir/*
|
||||
for name in "${names[@]}"; do
|
||||
if up_to_date "$name"; then
|
||||
echo "==> $name is up to date"
|
||||
continue
|
||||
fi
|
||||
echo "==> Building $name"
|
||||
as_builder ./xbps-src -H "$hostdir" -f pkg "$name"
|
||||
srchash "$name" >"$stamps/$name"
|
||||
done
|
||||
rm -rf "$checkroot"
|
||||
chown -R "$HOST_UID:$HOST_GID" "$stamps"
|
||||
|
||||
echo "==> Repository: $hostdir/binpkgs"
|
||||
ls -1 "$hostdir"/binpkgs/*.xbps
|
||||
|
||||
Reference in New Issue
Block a user