mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
Marek noticed that some builds were failing with:
+ cd dist/install
+ find
+ cpio -R 0:0 -o -H newc
./automation/scripts/build: line 111: cpio: command not found
+ gzip
but succeeding overall, and producing a zero length xen-tools.cpio.gz as an
artefact.
In fact, it's all of:
archlinux:current
debian:12-x86_32
fedora:41
opensuse:tumbleweed
ubuntu (all versions)
Add cpio into all of these containers, including opensuse leap for good
measure, and use pipefail in the build script.
Fixes: 4611ae6fb8 ("CI: save toolstack artifact as cpio.gz")
Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Denis Mukhin <dmukhin@ford.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
116 lines
3.4 KiB
Python
Executable File
116 lines
3.4 KiB
Python
Executable File
#!/bin/bash -ex
|
|
|
|
set -o pipefail
|
|
|
|
test -f /etc/os-release && cat "$_"
|
|
|
|
# Construct $cc such that it matches what `make` will chose when taking
|
|
# CROSS_COMPILE into account. Do not modify $CC directly, as that will cause
|
|
# `make` to double-account CROSS_COMPILE.
|
|
cc="${CROSS_COMPILE}${CC}"
|
|
|
|
$cc --version
|
|
|
|
# random config or default config
|
|
if [[ "${RANDCONFIG}" == "y" ]]; then
|
|
|
|
cp -f xen/tools/kconfig/allrandom.config xen/allrandom.config.tmp
|
|
|
|
# Append job-specific fixed configuration
|
|
echo "${EXTRA_FIXED_RANDCONFIG}" >> xen/allrandom.config.tmp
|
|
|
|
make -j$(nproc) -C xen KCONFIG_ALLCONFIG=allrandom.config.tmp randconfig
|
|
|
|
# RANDCONFIG implies HYPERVISOR_ONLY
|
|
HYPERVISOR_ONLY="y"
|
|
else
|
|
# Start off with arch's defconfig
|
|
make -C xen defconfig
|
|
|
|
echo "CONFIG_DEBUG=${debug}" >> xen/.config
|
|
|
|
if [[ -n "${EXTRA_XEN_CONFIG}" ]]; then
|
|
echo "${EXTRA_XEN_CONFIG}" >> xen/.config
|
|
fi
|
|
|
|
make -j$(nproc) -C xen olddefconfig
|
|
fi
|
|
|
|
# Save the config file before building because build failure causes the script
|
|
# to exit early -- bash is invoked with -e.
|
|
cp xen/.config xen-config
|
|
|
|
# Directory for the artefacts to be dumped into
|
|
mkdir -p binaries
|
|
|
|
collect_xen_artefacts()
|
|
{
|
|
local f
|
|
|
|
for f in xen/xen xen/xen.efi; do
|
|
if [[ -f $f ]]; then
|
|
cp $f binaries/
|
|
fi
|
|
done
|
|
}
|
|
|
|
if [[ "${CPPCHECK}" == "y" ]] && [[ "${HYPERVISOR_ONLY}" == "y" ]]; then
|
|
# Cppcheck analysis invokes Xen-only build
|
|
xen/scripts/xen-analysis.py --run-cppcheck --cppcheck-misra -- -j$(nproc)
|
|
|
|
# Preserve artefacts
|
|
collect_xen_artefacts
|
|
cp xen/cppcheck-report/xen-cppcheck.txt xen-cppcheck.txt
|
|
elif [[ "${HYPERVISOR_ONLY}" == "y" ]]; then
|
|
# Xen-only build
|
|
make -j$(nproc) xen
|
|
|
|
# Preserve artefacts
|
|
collect_xen_artefacts
|
|
else
|
|
# Full build. Figure out our ./configure options
|
|
cfgargs=("--prefix=/usr")
|
|
cfgargs+=("--enable-docs")
|
|
|
|
# booleans for which compiler is in use
|
|
cc_is_gcc="$($cc --version | grep -q gcc && echo "y" || :)"
|
|
cc_is_clang="$($cc --version | grep -q clang && echo "y" || :)"
|
|
|
|
# The compiler version as an integer. e.g. GCC 4.9.2 => 0x040902
|
|
cc_ver="$($cc -dumpversion | awk -F. '{ printf "0x%02x%02x%02x", $1, $2, $3 }')"
|
|
|
|
if [[ "${cc_is_clang}" == "y" ]]; then
|
|
# SeaBIOS cannot be built with clang
|
|
cfgargs+=("--with-system-seabios=/usr/share/no-seabios.bin")
|
|
# iPXE cannot be built with clang
|
|
cfgargs+=("--with-system-ipxe=/usr/share/no-ipxe.pxe")
|
|
# newlib cannot be built with clang so we cannot build stubdoms
|
|
cfgargs+=("--disable-stubdom")
|
|
fi
|
|
|
|
if ldd /bin/ls | grep -q musl; then
|
|
# disable --disable-werror for QEMUU when building with MUSL
|
|
cfgargs+=("--with-extra-qemuu-configure-args=\"--disable-werror\"")
|
|
fi
|
|
|
|
# QEMU is only for those who ask
|
|
if [[ "$BUILD_QEMU_XEN" != "y" ]]; then
|
|
cfgargs+=("--with-system-qemu=/bin/false")
|
|
fi
|
|
|
|
# SeaBIOS requires GCC 4.6 or later
|
|
if [[ "${cc_is_gcc}" == "y" && "${cc_ver}" -lt 0x040600 ]]; then
|
|
cfgargs+=("--with-system-seabios=/usr/share/no-seabios.bin")
|
|
fi
|
|
|
|
./configure "${cfgargs[@]}"
|
|
make -j$(nproc) dist
|
|
|
|
# Preserve artefacts
|
|
# Note: Some smoke tests depending on finding binaries/xen on a full build
|
|
# even though dist/ contains everything, while some containers don't even
|
|
# build Xen
|
|
(cd dist/install; find | cpio -R 0:0 -o -H newc | gzip) > binaries/xen-tools.cpio.gz
|
|
collect_xen_artefacts
|
|
fi
|