.github, common/travis: run CI without root

this should allow package tests that check things like writability to
succeed and have fewer skipped tests in CI.

- switch to using the `void-LIBC-full` container
- use `uchroot` instead of `ethereal`
- simplify some scripts for this change
This commit is contained in:
classabbyamp 2025-02-22 19:19:27 -05:00 committed by classabbyamp
parent e91b5eb17b
commit 4649c32a54
14 changed files with 111 additions and 113 deletions

View file

@ -1,7 +1,9 @@
#!/bin/sh
#!/bin/bash
#
# build.sh
set -e
if [ "$1" != "$2" ]; then
arch="-a $2"
fi
@ -10,10 +12,10 @@ if [ "$3" = 1 ]; then
test="-Q"
fi
PKGS=$(/hostrepo/xbps-src $test sort-dependencies $(cat /tmp/templates))
PKGS=$(./xbps-src $test sort-dependencies $(cat /tmp/templates))
for pkg in ${PKGS}; do
/hostrepo/xbps-src -j$(nproc) -s -H "$HOME"/hostdir $arch $test pkg "$pkg"
./xbps-src -j$(nproc) -s $arch $test pkg "$pkg"
[ $? -eq 1 ] && exit 1
done

View file

@ -1,7 +1,9 @@
#!/bin/sh
#!/bin/bash
#
# changed_templates.sh
set -e
tip="$(git rev-list -1 --parents HEAD)"
case "$tip" in
# This is a merge commit, pick last parent

View file

@ -1,31 +1,37 @@
#!/bin/sh
#!/bin/bash
#
# check-install.sh
export XBPS_TARGET_ARCH="$2" XBPS_DISTDIR=/hostrepo
set -e
if [ "$1" != "$XBPS_TARGET_ARCH" ]; then
triplet="$(/hostrepo/xbps-src -a "$XBPS_TARGET_ARCH" show-var XBPS_CROSS_TRIPLET)"
CONFDIR="-C /usr/$triplet/etc/xbps.d"
HOST_ARCH="$1"
export XBPS_TARGET_ARCH="$2"
if [ "$HOST_ARCH" != "$XBPS_TARGET_ARCH" ]; then
triplet="$(./xbps-src -a "$XBPS_TARGET_ARCH" show-var XBPS_CROSS_TRIPLET)"
CONFDIR="-C $PWD/masterdir-$HOST_ARCH/usr/$triplet/etc/xbps.d"
else
CONFDIR="-C /etc/xbps.d"
CONFDIR="-C $PWD/masterdir-$HOST_ARCH/etc/xbps.d"
fi
mkdir /check-install
if ! [ -d /check-install ]; then
/bin/echo -e "\x1b[31m/check-install does not exist\x1b[0m"
exit 1
fi
mkdir -p /check-install/var/db/xbps/keys
cp /var/db/xbps/keys/* /check-install/var/db/xbps/keys/
ADDREPO="--repository=$HOME/hostdir/binpkgs/bootstrap
--repository=$HOME/hostdir/binpkgs
--repository=$HOME/hostdir/binpkgs/nonfree"
ADDREPO="--repository=hostdir/binpkgs/bootstrap
--repository=hostdir/binpkgs
--repository=hostdir/binpkgs/nonfree"
ROOTDIR="-r /check-install"
xbps-install $ROOTDIR $ADDREPO $CONFDIR -S
while read -r pkg; do
for subpkg in $(xsubpkg $pkg); do
/bin/echo -e "\x1b[32mTrying to install dependants of $subpkg:\x1b[0m"
/bin/echo -e "\x1b[32mTrying to install dependents of $subpkg:\x1b[0m"
for dep in $(xbps-query $ADDREPO -RX "$subpkg"); do
xbps-install \
$ROOTDIR $ADDREPO $CONFDIR \

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# fetch-xbps.sh

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# fetch-xtools.sh
@ -16,4 +16,4 @@ else
xbps-fetch -o "$FILE" "$URL" || exit 1
fi
$TAR xf "$FILE" -C /tmp/bin --strip-components=1 || exit 1
$TAR xf "$FILE" -C /usr/local/bin --strip-components=1 || exit 1

View file

@ -1,14 +1,16 @@
#!/bin/sh
#!/bin/bash
#
# prepare.sh
set -e
/bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m'
echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf
echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf
/bin/echo -e '\x1b[32mEnabling ethereal chroot-style...\x1b[0m'
echo XBPS_CHROOT_CMD=ethereal >> etc/conf
echo XBPS_ALLOW_CHROOT_BREAKOUT=yes >> etc/conf
/bin/echo -e '\x1b[32mEnabling uchroot chroot-style...\x1b[0m'
echo XBPS_CHROOT_CMD=uchroot >> etc/conf
/bin/echo -e '\x1b[32mLinking / to /masterdir...\x1b[0m'
ln -s / masterdir
/bin/echo -e '\x1b[32mBootstrapping...\x1b[0m'
./xbps-src binary-bootstrap

View file

@ -1,4 +1,6 @@
#!/bin/sh
#!/bin/bash
set -e
TRAVIS_MIRROR=repo-ci.voidlinux.org

View file

@ -1,15 +1,17 @@
#!/bin/sh
#!/bin/bash
#
# show_files.sh
export XBPS_TARGET_ARCH="$2" XBPS_DISTDIR=/hostrepo
set -e
export XBPS_TARGET_ARCH="$2"
while read -r pkg; do
for subpkg in $(xsubpkg $pkg); do
/bin/echo -e "\x1b[32mFiles of $subpkg:\x1b[0m"
xbps-query --repository=$HOME/hostdir/binpkgs/bootstrap \
--repository=$HOME/hostdir/binpkgs \
--repository=$HOME/hostdir/binpkgs/nonfree \
xbps-query --repository=hostdir/binpkgs/bootstrap \
--repository=hostdir/binpkgs \
--repository=hostdir/binpkgs/nonfree \
-i -f "$subpkg" ||
/bin/echo -e "\x1b[33m $subpkg wasn't found\x1b[0m"
done

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# runs update-check on all changed templates, then errors only if there was an
# issue with the update-check. does not error if further updates are available,
# as there may be a good reason not to update to those versions

View file

@ -1,14 +1,15 @@
#!/bin/sh
#!/bin/bash
#
# xlint.sh
EXITCODE=0
read base tip < /tmp/revisions
/bin/echo -e "\x1b[34mLinting commits...\x1b[0m"
common/scripts/lint-commits $base $tip || EXITCODE=$?
for t in $(awk '{ print "srcpkgs/" $0 "/template" }' /tmp/templates); do
/bin/echo -e "\x1b[32mLinting $t...\x1b[0m"
/bin/echo -e "\x1b[34mLinting $t...\x1b[0m"
xlint "$t" > /tmp/xlint_out || EXITCODE=$?
common/scripts/lint-version-change "$t" $base $tip > /tmp/vlint_out || EXITCODE=$?
awk -f common/scripts/lint2annotations.awk /tmp/xlint_out /tmp/vlint_out

View file

@ -1,17 +1,19 @@
#!/bin/sh
#!/bin/bash
#
# xpkgdiff.sh
export XBPS_TARGET_ARCH="$2" XBPS_DISTDIR=/hostrepo XBPS_HOSTDIR="$HOME/hostdir"
set -e
export XBPS_TARGET_ARCH="$2"
export DIFF='diff --unified=0 --report-identical-files --suppress-common-lines
--color=always --label REPO --label BUILT'
ARGS="-a $2 -R https://repo-ci.voidlinux.org/current"
while read -r pkg; do
for subpkg in $(xsubpkg $pkg); do
if xbps-query --repository=$HOME/hostdir/binpkgs/bootstrap \
--repository=$HOME/hostdir/binpkgs \
--repository=$HOME/hostdir/binpkgs/nonfree \
if xbps-query --repository=hostdir/binpkgs/bootstrap \
--repository=hostdir/binpkgs \
--repository=hostdir/binpkgs/nonfree \
-i "$subpkg" >&/dev/null; then
/bin/echo -e "\x1b[34mFile Diff of $subpkg:\x1b[0m"
xpkgdiff $ARGS -f $subpkg