diff --git a/build.sh b/build.sh index 725854c..b2c5998 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,10 @@ #!/bin/bash set -e +SCRIPTDIR="$(dirname $(readlink -f "$0"))" + abort() { local x=$1; shift; for i in "$@"; do echo >&2 "$0: abort: $i"; done; exit "$x"; } +report() { for i in "$@"; do echo >&2 "debcargo-conf builder: $i"; done; } if [ "$(basename "$PWD")" != "build" ]; then abort 1 "This script is only meant to be run from the build/ directory." @@ -32,6 +35,8 @@ DEBSRC=$(dpkg-parsechangelog -l $PKGNAME/debian/changelog -SSource) DEBDIST=$(dpkg-parsechangelog -l $PKGNAME/debian/changelog -SDistribution) DEB_HOST_ARCH=$(dpkg-architecture -q DEB_HOST_ARCH) +SRCNAME="${DEBSRC}_${DEBVER}" +BUILDNAME="${DEBSRC}_${DEBVER}_${DEB_HOST_ARCH}" if [ -z "$CHROOT" ] && schroot -i -c "debcargo-unstable-${DEB_HOST_ARCH}-sbuild" >/dev/null 2>&1; then CHROOT="debcargo-unstable-${DEB_HOST_ARCH}-sbuild" fi @@ -42,7 +47,7 @@ test ! -e "$dst" -o "$src" -nt "$dst" } -if shouldbuild ${DEBSRC}_${DEBVER}.dsc "$PKGNAME/debian/changelog" ]; then +if shouldbuild "$SRCNAME.dsc" "$PKGNAME/debian/changelog" ]; then if [ "$REUSE_EXISTING_ORIG_TARBALL" = 1 ]; then UPSVER="${DEBVER%-*}" mv "${DEBSRC}_${UPSVER}.orig.tar.gz" "${DEBSRC}_${UPSVER}.orig.tar.gz.new" @@ -62,7 +67,7 @@ ( cd "$PKGNAME" && dpkg-buildpackage -d -S --no-sign ) # sign if not UNRELEASED if echo "$DEBDIST" | grep -qv UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; then - debsign ${DEBSRC}_${DEBVER}_source.changes + debsign "${SRCNAME}_source.changes" fi fi @@ -74,8 +79,7 @@ apt-cache dumpavail -o APT::Default-Release=unstable | \ sed -e 's/Package: .*/\0\nStatus: install ok installed/g' > dpkg-dummy/status if ! test -s dpkg-dummy/status; then - echo >&2 "couldn't generate dpkg-dummy/status, is Debian unstable in your APT sources?" - exit 1 + abort 1 "couldn't generate dpkg-dummy/status, is Debian unstable in your APT sources?" fi fi ( cd "$PKGNAME" && dpkg-checkbuilddeps --admindir=../dpkg-dummy ) @@ -91,9 +95,9 @@ exit fi -AUTOPKGTEST_OPTS=() -if [ "$RUN_AUTOPKGTEST" = 1 ]; then - AUTOPKGTEST_OPTS=(--run-autopkgtest --autopkgtest-root-arg= --autopkgtest-opts="-- schroot ${CHROOT}") +AUTOPKGTEST_OPTS=(--run-autopkgtest --autopkgtest-root-arg= --autopkgtest-opts="-- schroot ${CHROOT}") +if [ "$SKIP_AUTOPKGTEST" = 1 ]; then + AUTOPKGTEST_OPTS=() fi sbuild --no-source --arch-any --arch-all \ @@ -101,10 +105,17 @@ ${DISTRIBUTION:+-d $DISTRIBUTION} \ ${@/#/--extra-package=} \ "${AUTOPKGTEST_OPTS[@]}" \ - ${DEBSRC}_${DEBVER}.dsc -changestool ${DEBSRC}_${DEBVER}_${DEB_HOST_ARCH}.changes adddsc ${DEBSRC}_${DEBVER}.dsc + "$SRCNAME.dsc" +if [ "$SKIP_AUTOPKGTEST" != 1 ]; then + report "analyzing autopkgtest log: $BUILDNAME.test.log" + # this is a bit of a hack but works OK for now, until sbuild supports %SBUILD_BUILD_DIR in --autopkgtest-opt + sed -ne '/autopkgtest .*: testing package .* version .*/,$p' "$BUILDNAME.build" > "$BUILDNAME.test.log" + "$SCRIPTDIR/dev/rust-regressions.sh" "$BUILDNAME.test.log" +fi +changestool "$BUILDNAME.changes" adddsc "$SRCNAME.dsc" +report "build complete: $BUILDNAME.changes" # sign if not UNRELEASED if echo "$DEBDIST" | grep -qv UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; then - debsign ${DEBSIGN_KEYID:+-k $DEBSIGN_KEYID }--no-re-sign ${DEBSRC}_${DEBVER}_${DEB_HOST_ARCH}.changes + debsign ${DEBSIGN_KEYID:+-k $DEBSIGN_KEYID }--no-re-sign "$BUILDNAME.changes" fi diff --git a/dev/rust-regressions.sh b/dev/rust-regressions.sh index 2a635e4..f7d803b 100755 --- a/dev/rust-regressions.sh +++ b/dev/rust-regressions.sh @@ -16,7 +16,8 @@ local c=0 local url="$1" local name="$(zegrep -o 'autopkgtest \[[0-9:]+\]: testing package [^[:space:]]+' "$url" | cut '-d ' -f5)" - if zegrep -q '^error\[E0554\]' "$url"; then + if zegrep -q '^error\[E0554\]' "$url" && \ + ! zegrep -q "^cargo-auto-test: re-running test with RUSTC_BOOTSTRAP due to E0554" "$url"; then results["falsepositive_unstable"]+="$name"$'\n' c=$((c+1)) fi diff --git a/vars.sh.frag b/vars.sh.frag index a4967b8..4b85fed 100644 --- a/vars.sh.frag +++ b/vars.sh.frag @@ -58,7 +58,7 @@ PKGCFG="$PKGDIR/debian/debcargo.toml" mkdir -p "$(dirname $BUILDDIR)" -cp "$PWD/build.sh" "$PWD/build/build.sh" +ln -srf "$PWD/build.sh" "$PWD/build/build.sh" chmod +x "$PWD/build/build.sh" if [ -z "$CRATE" ]; then