From b8475d723d66914c3ee0755cc88a8118ea54bae2 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Tue, 16 Jul 2019 16:10:16 -0400 Subject: [PATCH] jjb: Update babeltrace jobs Signed-off-by: Michael Jeanson --- jobs/babeltrace.yaml | 14 +++---- scripts/babeltrace/build.sh | 81 ++++++++++++++++++++++++------------- 2 files changed, 60 insertions(+), 35 deletions(-) diff --git a/jobs/babeltrace.yaml b/jobs/babeltrace.yaml index d5df88a..09ddfeb 100644 --- a/jobs/babeltrace.yaml +++ b/jobs/babeltrace.yaml @@ -332,7 +332,7 @@ 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 @@ -584,7 +584,7 @@ - '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 @@ -608,7 +608,7 @@ 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] @@ -635,7 +635,7 @@ - '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 @@ -688,7 +688,7 @@ - '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 @@ -709,5 +709,5 @@ - '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] diff --git a/scripts/babeltrace/build.sh b/scripts/babeltrace/build.sh index 0d8fdaf..b6590a7 100755 --- a/scripts/babeltrace/build.sh +++ b/scripts/babeltrace/build.sh @@ -80,9 +80,6 @@ SRCDIR="$WORKSPACE/src/babeltrace" 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" @@ -270,38 +267,66 @@ esac # 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 @@ -332,7 +357,7 @@ find "$PREFIX/lib" -name "*.la" -exec rm -f {} \; # 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 -- 2.34.1