summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-01-20 09:37:50 +0000
committerMaxim Kuvyrkov <maxim.kuvyrkov@linaro.org>2019-01-22 08:10:53 +0000
commit11f9dcbdc8fece80800785c856a9902501f5e195 (patch)
tree6344c76550408fe92a96d3153632c40380de93d2
parent9008bee3f1ef60060c1f8d0d825a9182a4679e89 (diff)
tcwg_kernel*: Correct names of *_rev variables.
At the moment *_rev variables, such as current_rev, accept both git branches and git revisions (SHA1s) as values, which is confusing and makes it difficult to write code for manifest generation (manifests need all GIT references resolved at the moment of generation so that reproduction runs sees the "old" state of world). This change standardize the meaning of *_branch and *_rev suffices: *_branch variables accept either SHA1s or git branches and *_rev variables accept only SHA1s. With the established meanings, $bad_rev and $baseline_rev parameters of tcwg_kernel-bisect.sh script can only be SHA1s (which they are anyway in all reasonable cases), which allowed to simplify handling of a few things in tcwg_kernel-bisect.sh script. Change-Id: Ifc52385e4d3aeab2a3b6945fa6e1c88bcc2c7b6d
-rw-r--r--round-robin.sh27
-rwxr-xr-xtcwg_kernel-bisect.sh21
-rwxr-xr-xtcwg_kernel-build.sh14
3 files changed, 27 insertions, 35 deletions
diff --git a/round-robin.sh b/round-robin.sh
index 82cfc1d0..ac1ff3b3 100644
--- a/round-robin.sh
+++ b/round-robin.sh
@@ -6,19 +6,22 @@
# PROJECT's git url
#rr[PROJECT_url]
-# PROJECT's git revision parsable by git rev-parse.
+# PROJECT's git branch or SHA1 revision parsable by git rev-parse.
+#rr[PROJECT_branch]
+
+# PROJECT's git SHA1 revision. These are mostly used in manifests.
#rr[PROJECT_rev]
# Baseline branch name for current configuration. These branches are
# present in all above git repos.
#rr[baseline_branch]="linaro-local/ci/CONFIGURATION"
-# PROJECT that we are testing in this build. Use ${rr[current_rev]} for
+# PROJECT that we are testing in this build. Use ${rr[current_branch]} for
# this project, and ${rr[baseline_branch]} for all other projects.
#rr[current_project]="$current_project"
-# Git revision of ${rr[current_project]} to test.
-#rr[current_rev]="$current_rev"
+# Git branch or SHA1 revision of ${rr[current_project]} to test.
+#rr[current_branch]="$current_branch"
# Run mode: bisect or non-bisect. In bisect mode we do a couple things
# slightly differently (e.g., don't touch repo in clone_repo() ).
@@ -84,21 +87,21 @@ clone_repo ()
local branch
# Select the branch to build.
- # ${rr[current_rev]} specifies branch for ${rr[current_project]},
+ # ${rr[current_branch]} specifies branch for ${rr[current_project]},
# and everything else uses baseline branch.
if [ x"$project" = x"${rr[current_project]}" ]; then
- if [ x"${rr[current_rev]}" = x"default" ]; then
- branch=${rr[${current_project}_rev]}
- elif [ x"${rr[current_rev]}" = x"baseline" ]; then
+ if [ x"${rr[current_branch]}" = x"default" ]; then
+ branch=${rr[${current_project}_branch]}
+ elif [ x"${rr[current_branch]}" = x"baseline" ]; then
branch="refs/remotes/baseline/${rr[baseline_branch]}"
else
- branch=${rr[current_rev]}
+ branch=${rr[current_branch]}
fi
else
branch="refs/remotes/baseline/${rr[baseline_branch]}"
fi
- branch="${rr[${project}_sha1]-$branch}"
+ branch="${rr[${project}_rev]-$branch}"
# Decide on whether to use read-only or read-write mode for
# refs/remotes/baseline. We use read-only wherever possible to allow
@@ -121,14 +124,14 @@ clone_repo ()
cur_rev=$(git -C $project rev-parse HEAD)
cat <<EOF | manifest_out
-rr[${project}_sha1]=$cur_rev
+rr[${project}_rev]=$cur_rev
EOF
if [ x"$project" = x"${rr[current_project]}" ]; then
local baseline_rev
baseline_rev=$(git_rev_parse_long $project ${rr[baseline_branch]} baseline)
# Prepare for failure. If build fails we will bisect sha1 for
- # ${rr[current_rev]} and sha1 for $baseline_rev.
+ # ${rr[current_branch]} and sha1 for ${rr[baseline_branch]}.
cat > ${rr[top_artifacts]}/trigger-bisect-on-failure <<EOF
current_project=${rr[current_project]}
baseline_rev=$baseline_rev
diff --git a/tcwg_kernel-bisect.sh b/tcwg_kernel-bisect.sh
index df37dcc9..9bfe6eaf 100755
--- a/tcwg_kernel-bisect.sh
+++ b/tcwg_kernel-bisect.sh
@@ -13,8 +13,6 @@ fresh_dir $artifacts "$artifacts/manifests/*" "$artifacts/jenkins/*"
convert_args_to_variables "$@"
shift "$SHIFT_CONVERTED_ARGS"
-bad_rev="${bad_rev:-default}"
-baseline_rev="${baseline_rev:-baseline}"
BUILD_URL="${BUILD_URL:-$(pwd)}"
reproduce_bisect="${reproduce_bisect:-false}"
@@ -22,7 +20,7 @@ reproduce_bisect="${reproduce_bisect:-false}"
convert_args_to_variables ^^ $reproduce_bisect %% $artifacts/manifests/build-parameters.sh "$@"
$reproduce_bisect || manifest_pop
-obligatory_variables current_project toolchain
+obligatory_variables bad_rev baseline_rev current_project toolchain
linux_config="${linux_config:-defconfig}"
target="${target:-native}"
@@ -34,13 +32,6 @@ if $verbose; then set -x; fi
trap "eval \"echo ERROR at \${FUNCNAME[0]}:\${BASH_LINENO[0]}\" > $artifacts/failures" EXIT
-if [ x"$bad_rev" = x"default" ]; then
- echo "ERROR: Need explicit --bad_rev"
- exit 1
-else
- bad_rev=$(git -C $current_project rev-parse "$bad_rev")
-fi
-
# Build baseline that we are going to re-use to speed-up bisection.
# (This also confirms that infrastructure is OK.)
echo "Testing baseline_rev $baseline_rev (should be success)"
@@ -49,7 +40,7 @@ $scripts/tcwg_kernel-build.sh \
%% $artifacts/manifests/build-baseline.sh \
@@ $artifacts/manifests/build-parameters.sh \
--mode "baseline" \
- --current_rev "$baseline_rev" \
+ --current_branch "$baseline_rev" \
--reset_baseline true \
--top_artifacts "$artifacts/build-baseline" \
--verbose "$verbose"
@@ -58,8 +49,6 @@ assert ! [ -f $artifacts/failures ]
cd $current_project
-# Remember $good_rev from the baseline build above.
-baseline_rev=$(git rev-parse HEAD)
ln -f -s "build-baseline" "$artifacts/build-$baseline_rev"
ln -f -s "build-baseline.sh" "$artifacts/manifests/build-$baseline_rev.sh"
echo "$baseline_rev" >> $artifacts/good_revs
@@ -142,7 +131,7 @@ EOF
clone_or_update_repo . refs/remotes/mainline/master "$url"
mainline_master="${mainline_master-$(git merge-base $bad_rev HEAD)}"
cat <<EOF | manifest_out
-declare -g mainline_master=$mainline_rev
+declare -g mainline_master=$mainline_master
EOF
try_revs+=($mainline_master)
@@ -177,7 +166,7 @@ if [ x"$res" = x"0" ]; then
# Build job had a spurious failure. Re-try.
cat > $artifacts/trigger-2-build-master <<EOF
current_project=$current_project
-current_rev=$bad_rev
+current_branch=$bad_rev
EOF
rm -f $artifacts/jenkins/mail-recipients.txt
trap "" EXIT
@@ -360,7 +349,7 @@ EOF
# regressions (worse than $bad_rev).
cat > $artifacts/trigger-1-reset-baseline <<EOF
current_project=$current_project
-current_rev=$first_bad
+current_branch=$first_bad
reset_baseline=true
EOF
diff --git a/tcwg_kernel-build.sh b/tcwg_kernel-build.sh
index 8b0e6a09..d31329e9 100755
--- a/tcwg_kernel-build.sh
+++ b/tcwg_kernel-build.sh
@@ -11,27 +11,27 @@ convert_args_to_variables "$@"
mode="${mode-baseline}"
obligatory_variables toolchain \
- rr[linux_version] rr[linux_url] rr[linux_rev]
+ rr[linux_version] rr[linux_url] rr[linux_branch]
# Toolchain to use: gnu or llvm
case "$toolchain" in
"gnu") obligatory_variables rr[gnu_version] \
- rr[binutils_url] rr[binutils_rev] \
- rr[gcc_url] rr[gcc_rev] ;;
+ rr[binutils_url] rr[binutils_branch] \
+ rr[gcc_url] rr[gcc_branch] ;;
"llvm") obligatory_variables rr[llvm_version] \
- rr[llvm_url] rr[llvm_rev] ;;
+ rr[llvm_url] rr[llvm_branch] ;;
esac
case "$mode" in
"jenkins-full")
- obligatory_variables current_project current_rev
+ obligatory_variables current_project current_branch
;;
esac
# Set custom revision for one of the projects, and use baseline revisions
# for all other projects.
current_project="${current_project-none}"
-current_rev="${current_rev-default}"
+current_branch="${current_branch-default}"
linux_config="${linux_config-defconfig}"
reset_baseline="${reset_baseline-false}"
@@ -96,7 +96,7 @@ run_step_init "$start_at" "$finish_at" "$top_artifacts" "$base_artifacts_opt" "$
rr[baseline_branch]="linaro-local/ci/tcwg_kernel/$toolchain-${rr[${toolchain}_version]}-$target-${rr[linux_version]}-$linux_config"
rr[current_project]="$current_project"
-rr[current_rev]="$current_rev"
+rr[current_branch]="$current_branch"
rr[mode]="$mode"
rr[reset_baseline]="$reset_baseline"
rr[target]="$target"