From 3100ea8bbc6db28d8c321e27782e0e160bcca5cf Mon Sep 17 00:00:00 2001 From: "Cel A. Skeggs" Date: Sun, 15 Dec 2019 13:06:19 -0500 Subject: [PATCH] build-chroot: provide more debugging info When the build chroot fails to install, print out some of the debootstrap output, so that more information is available when the build fails only in CI. --- build-chroot/create.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build-chroot/create.sh b/build-chroot/create.sh index 404d89d26..11950972f 100755 --- a/build-chroot/create.sh +++ b/build-chroot/create.sh @@ -30,7 +30,12 @@ then fi mkdir -m 'u=rwx,go=rx' "${HOMEWORLD_CHROOT}" -sudo debootstrap --include="$(grep -vE '^#' packages.list | tr '[:space:]' '\n' | sed '/^$/d' | tr '\n' ,)" stretch "${HOMEWORLD_CHROOT}" http://debian.csail.mit.edu/debian/ +if ! sudo debootstrap --include="$(grep -vE '^#' packages.list | tr '[:space:]' '\n' | sed '/^$/d' | tr '\n' ,)" stretch "${HOMEWORLD_CHROOT}" http://debian.csail.mit.edu/debian/ +then + echo "debootstrap failed; printing log" 1>&2 + cat "${HOMEWORLD_CHROOT}/debootstrap/debootstrap.log" + exit 1 +fi # TODO: build our own Bazel, rather than grabbing it from Google's repo ./install-bazel.sh --root "${HOMEWORLD_CHROOT}" sudo chroot "${HOMEWORLD_CHROOT}" groupadd "$(id -gn)" -g "$(id -g)"