node: 'master' # Applies only to matrix flyweight task
execution-strategy:
combination-filter: |
- (build=="std" && conf=="python-bindings") || (arch=="amd64")
+ (build=="std" && conf=="std") || (arch=="amd64")
axes:
- axis:
type: slave
- 'babeltrace_{version}_{buildtype}':
buildtype: build
arch: !!python/tuple [amd64]
- build: !!python/tuple [std, oot, dist]
+ build: !!python/tuple [std, oot, dist, oot-dist]
conf: !!python/tuple [std, static, python-bindings]
- 'babeltrace_{version}_{buildtype}':
buildtype: portbuild
buildtype: macosxbuild
arch: !!python/tuple [macosx]
build: !!python/tuple [std]
- conf: !!python/tuple [std, python-bindings, production]
+ conf: !!python/tuple [std, python-bindings]
- 'babeltrace_{version}_{cctype}':
cctype: clangbuild
arch: !!python/tuple [amd64]
- 'babeltrace_{version}_{buildtype}':
buildtype: build
arch: !!python/tuple [amd64]
- build: !!python/tuple [std, oot, dist]
+ build: !!python/tuple [std, oot, dist, oot-dist]
conf: !!python/tuple [std, static, prod, min]
- 'babeltrace_{version}_{buildtype}':
buildtype: portbuild
- 'dev_{user}_babeltrace_{version}_{buildtype}':
buildtype: build
arch: !!python/tuple [amd64]
- build: !!python/tuple [std, oot, dist]
+ build: !!python/tuple [std, oot, dist, oot-dist]
conf: !!python/tuple [std, static, python-bindings]
- 'dev_{user}_babeltrace_{version}_{buildtype}':
buildtype: macosxbuild
- 'dev_gerrit_babeltrace_{buildtype}':
buildtype: build
arch: !!python/tuple [amd64, armhf, arm64, powerpc, ppc64el, i386]
- build: !!python/tuple [std, oot, dist]
- conf: !!python/tuple [std, static, python-bindings, production]
+ build: !!python/tuple [std, oot, dist, oot-dist]
+ conf: !!python/tuple [std, static, prod, min]
TMPDIR="$WORKSPACE/tmp"
PREFIX="$WORKSPACE/build"
-# The build dir defaults to the source dir
-BUILDDIR="$SRCDIR"
-
# Create install and tmp directories
rm -rf "$PREFIX" "$TMPDIR"
mkdir -p "$PREFIX" "$TMPDIR"
# Make sure to move to the build dir and run configure
# before continuing.
case "$build" in
- oot)
- echo "Out of tree build"
+oot)
+ echo "Out of tree build"
+
+ # Create and enter a temporary build directory
+ builddir=$(mktemp -d)
+ cd "$builddir"
+
+ "$SRCDIR/configure" --prefix="$PREFIX" "${CONF_OPTS[@]}"
+ ;;
- BUILDDIR="$WORKSPACE/oot"
- mkdir -p "$BUILDDIR"
- cd "$BUILDDIR"
+dist)
+ echo "Distribution in-tree build"
- "$SRCDIR/configure" --prefix="$PREFIX" "${CONF_OPTS[@]}"
- ;;
+ # Run configure and generate the tar file
+ # in the source directory
+ ./configure
+ $MAKE dist
- dist)
- echo "Distribution out of tree build"
- BUILDDIR="$(mktemp -d)"
+ # Create and enter a temporary build directory
+ builddir=$(mktemp -d)
+ cd "$builddir"
+
+ # Extract the distribution tar in the build directory,
+ # ignore the first directory level
+ $TAR xvf "$SRCDIR"/*.tar.* --strip 1
+
+ ./configure --prefix="$PREFIX" "${CONF_OPTS[@]}"
+ ;;
- # Initial configure and generate tarball
- "$SRCDIR/configure"
- $MAKE dist
+oot-dist)
+ echo "Distribution out of tree build"
- mkdir -p "$BUILDDIR"
- cp ./*.tar.* "$BUILDDIR/"
- cd "$BUILDDIR"
+ # Create and enter a temporary build directory
+ builddir=$(mktemp -d)
+ cd "$builddir"
- # Ignore level 1 of tar
- $TAR xvf ./*.tar.* --strip 1
+ # Run configure out of tree and generate the tar file
+ "$SRCDIR/configure"
+ $MAKE dist
- ./configure --prefix="$PREFIX" "${CONF_OPTS[@]}"
- ;;
+ dist_srcdir="$(mktemp -d)"
+ cd "$dist_srcdir"
- *)
- echo "Standard in-tree build"
- ./configure --prefix="$PREFIX" "${CONF_OPTS[@]}"
- ;;
+ # Extract the distribution tar in the new source directory,
+ # ignore the first directory level
+ $TAR xvf "$builddir"/*.tar.* --strip 1
+
+ # Create and enter a second temporary build directory
+ builddir="$(mktemp -d)"
+ cd "$builddir"
+
+ # Run configure from the extracted distribution tar,
+ # out of the source tree
+ "$dist_srcdir/configure" --prefix="$PREFIX" "${CONF_OPTS[@]}"
+ ;;
+
+*)
+ echo "Standard in-tree build"
+ ./configure --prefix="$PREFIX" "${CONF_OPTS[@]}"
+ ;;
esac
# We are now inside a configured build directory
# Clean temp dir for dist build
if [ "$build" = "dist" ]; then
cd "$SRCDIR"
- rm -rf "$BUILDDIR"
+ rm -rf "$builddir"
fi
# Exit with the return code of the test suite