summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-02-18 18:13:24 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-02-26 10:15:43 +0000
commit644c2eba2e682c14cf064de47c21f91cf5106fd9 (patch)
tree654e8ecf36fef49e3b6cff89b190a4c9774b8a04
parent90935acc02c6219a06613ae6a0c85a65f8566acc (diff)
tcwg-dev-build: Enable builds using manifests
If manifest.txt was uploaded in job's parameters, then pass --manifest option to MakeRelease.job. Fix MakeRelease.job to not pass --target when manifest is set, otherwise ABE complains. Change-Id: I2aa25d3840281159e2ed00cfaab3b9e47a661801
-rwxr-xr-xMakeRelease.job15
-rw-r--r--jenkins-helpers.sh11
-rwxr-xr-xtcwg-dev-build.sh7
3 files changed, 27 insertions, 6 deletions
diff --git a/MakeRelease.job b/MakeRelease.job
index 83d80f20..6ca48bc3 100755
--- a/MakeRelease.job
+++ b/MakeRelease.job
@@ -99,10 +99,6 @@ else
rsh="ssh $fileserver"
fi
-if test x"${target}" != x"native" -a x"${target}" != x; then
- platform="--target ${target}"
-fi
-
shared="/home/buildslave/workspace/shared/"
user_snapshots="${user_workspace}/snapshots"
@@ -156,6 +152,13 @@ gcc=${gcc_src:+gcc=${gcc_src}}
srcs="${gcc} ${binutils} ${glibc} ${manifest}"
logfile=${user_workspace}/MakeRelease-${buildnumber}-$(uname -m).log
+# Set ABE's --target setting. No setting means native.
+# If manifest file is set, then ABE must use its setting.
+target_opt=
+if [ x"${target}" != x"native" -a x"${target}" != x -a x"$manifest" = x"" ]; then
+ target_opt="--target ${target}"
+fi
+
# Build a binary release tarball
# Remove logfile if present (for some unknown reason)
rm -f ${logfile}
@@ -164,7 +167,7 @@ manifests=()
tarballs=()
# Canadian cross builds require a Linux hosted cross compiler first
if test x"${canadian}" = x"true"; then
- $CONFIG_SHELL ${abe_dir}/abe.sh --list-artifacts ${user_workspace}/artifacts1.txt ${update} --release ${release} ${srcs} ${platform} --build all ${libc} ${extra} --tarbin >> ${logfile}
+ $CONFIG_SHELL ${abe_dir}/abe.sh --list-artifacts ${user_workspace}/artifacts1.txt ${update} --release ${release} ${srcs} $target_opt --build all ${libc} ${extra} --tarbin >> ${logfile}
abe_ret=$?
host="--host i686-w64-mingw32"
manifests+=($(read_var ${user_workspace}/artifacts1.txt manifest))
@@ -177,7 +180,7 @@ fi
# build the mingw32 compiler only if the previous cross-compiler build was
# successful.
if test ${abe_ret} -eq 0; then
- $CONFIG_SHELL ${abe_dir}/abe.sh --list-artifacts ${user_workspace}/artifacts2.txt ${update} --release ${release} --tarbin ${srcs} ${platform} ${host} --build all ${libc} ${extra} >> ${logfile}
+ $CONFIG_SHELL ${abe_dir}/abe.sh --list-artifacts ${user_workspace}/artifacts2.txt ${update} --release ${release} --tarbin ${srcs} $target_opt ${host} --build all ${libc} ${extra} >> ${logfile}
abe_ret=$?
manifests+=($(read_var ${user_workspace}/artifacts2.txt manifest))
fi
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh
index 58ec2a29..33218625 100644
--- a/jenkins-helpers.sh
+++ b/jenkins-helpers.sh
@@ -1,5 +1,16 @@
#!/bin/bash
+# Print absolute path to a file or directory
+# $1: Path (must exist)
+abs_path ()
+{
+ (
+ set -euf -o pipefail
+
+ echo "$(cd $(dirname "$1") && pwd)/$(basename "$1")"
+ )
+}
+
# Assert that $@ returns success.
assert ()
{
diff --git a/tcwg-dev-build.sh b/tcwg-dev-build.sh
index cf24ab60..24b7b930 100755
--- a/tcwg-dev-build.sh
+++ b/tcwg-dev-build.sh
@@ -8,6 +8,7 @@ convert_args_to_variables "$@"
abe_branch="${abe_branch-tested}"
dry_run="${dry_run-false}"
+manifest=""
release_name="${release_name-default}"
target="${target-aarch64-linux-gnu}"
version="${version-default}"
@@ -23,6 +24,11 @@ if [ x"$release_name" = x"default" ]; then
release_name="$(date +%Y%m%d-%H_%M_%S)"
fi
+manifest_opt=
+if [ -f "$manifest" ]; then
+ manifest_opt="--manifest $(abs_path "$manifest")"
+fi
+
manifest_validation_opt=
if [ x"$target" = x"native" ]; then
manifest_validation_opt="--manifest_validation false"
@@ -35,6 +41,7 @@ $scripts/MakeRelease.job \
--target $target \
--toolchainconfig $version \
--workspace `pwd` \
+ $manifest_opt \
$manifest_validation_opt \
${binutils:+--binutils "$binutils"} \
${gcc:+--gcc "$gcc"}