aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2023-12-07 21:51:46 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2023-12-08 09:35:59 +0000
commit25b414915b35c52967c368fa2708e4c3c1febec5 (patch)
tree049a40804857ceb8e6c81f8f672ace24681a1231
parentcdabad4b622ceb10dae5deee58aa505f207cbe75 (diff)
Change update location of LAST_UPDATED and gcc/REVISION
These files are used when sending test results summaries. Since the CI uses Jenkins rather ABE to checkout the sources, we want to update LAST_UPDATED and gcc/REVISION later than the checkout phase. Since we want to include $ABE_TARGET_BOARD_OPTIONS early in the summaries to make them easier to read/more informative, we have to update these two files in two different locations: - gcc/REVISION is used to build the output of 'gcc --version' and has to be updated before starting the build, so we create it before running the configure step. The drawback is that at this stage we don't know about $ABE_TARGET_BOARD_OPTIONS in case the user invokes ABE once to build the toolchain (without $ABE_TARGET_BOARD_OPTIONS), and once to run the tests (with $ABE_TARGET_BOARD_OPTIONS, but too late to update gcc/REVISION). (This is what we do in CI) - LAST_UPDATED is used only by contrib/test_summary, and can be updated when running the tests. Change-Id: I5e50072fc189b7ae41a0829b83155d21294aa282
-rw-r--r--lib/checkout.sh8
-rw-r--r--lib/configure.sh19
-rw-r--r--lib/make.sh40
3 files changed, 59 insertions, 8 deletions
diff --git a/lib/checkout.sh b/lib/checkout.sh
index b906d99e..95539e13 100644
--- a/lib/checkout.sh
+++ b/lib/checkout.sh
@@ -241,14 +241,6 @@ checkout()
# Touch GCC's auto-generated files to avoid non-deterministic
# build behavior.
dryrun "(cd ${srcdir} && ./contrib/gcc_update --touch)"
- # LAST_UPDATED and gcc/REVISION are used when sending
- # results summaries
- # Report svn revision, if present
- local svnrev="$(git -C ${srcdir} log -n 1 | grep git-svn-id: | awk '{print $2;}' | cut -d@ -f2)"
- local revstring="${newrev}"
- [ x"${svnrev}" != x ] && revstring="${svnrev}"
- dryrun "echo $(TZ=UTC date) '(revision' ${revstring}')' | tee ${srcdir}/LAST_UPDATED"
- dryrun "echo \[${branch} revision ${revstring}\] | tee ${srcdir}/gcc/REVISION"
if test x"${gcc_patch_file}" != x""; then
dryrun "git -C ${srcdir} apply --check ${gcc_patch_file}"
diff --git a/lib/configure.sh b/lib/configure.sh
index d30a7123..d6d9b701 100644
--- a/lib/configure.sh
+++ b/lib/configure.sh
@@ -192,6 +192,25 @@ configure_build()
# Native build needs stage2 build only.
opts="$opts $stage2_flags"
fi
+
+ if [ x"$send_results_to" != x ]; then
+ # gcc/REVISION is used to build 'gcc --version'
+ # output. This file is not committed in the GCC repo,
+ # but GCC's build system uses it if present in
+ # $srcdir.
+ local revstring="$(get_component_revision ${component})"
+ local branch="$(get_component_branch ${component})"
+ local srcdir="$(get_component_srcdir ${component})"
+
+ # Try to generate a nicer revision.
+ if [ -d ${srcdir}/.git ]; then
+ revstring=$(git -C ${srcdir} describe --match "basepoints/*" \
+ --match "releases/*" ${revstring} | sed 's,^basepoints/,,')
+ fi
+
+ dryrun "echo \[${branch} revision ${revstring}\] | tee ${srcdir}/gcc/REVISION"
+ dryrun "touch ${srcdir}/gcc/genversion.cc"
+ fi
;;
binutils)
if test x"${override_linker}" = x"gold"; then
diff --git a/lib/make.sh b/lib/make.sh
index 5b4a99bc..bf4facaf 100644
--- a/lib/make.sh
+++ b/lib/make.sh
@@ -1071,6 +1071,46 @@ make_check()
;;
gcc)
exec_tests=true
+
+ if [ x"$send_results_to" != x ]; then
+ # LAST_UPDATED is used when sending results summaries.
+ # This file is not committed in the GCC repo, but is
+ # used by contrib/test_summary if present in $srcdir.
+ #
+ # We generate almost the same contents as in
+ # gcc/REVISION (see configure_build() in
+ # lib/configure.sh), but we add $target and
+ # $ABE_TARGET_BOARD_OPTIONS so that this information
+ # is more obvious when reading the email report.
+ #
+ # The reason we do this in two places is because in
+ # configure_build() we don;t know
+ # $ABE_TARGET_BOARD_OPTIONS, for instance if the user
+ # invokes ABE twice, once to build the toolchain
+ # (without $ABE_TARGET_BOARD_OPTIONS), and once to run
+ # the tests (with $ABE_TARGET_BOARD_OPTIONS, skipping
+ # the build part, so too late for an update to
+ # gcc/VERSION to be taken into account). (This is
+ # what we do in CI)
+ #
+ # If we accept not to provide
+ # $ABE_TARGET_BOARD_OPTIONS in the summaries, we could
+ # merge the creation of LAST_UPDATED with that of
+ # gcc/REVISION in configure_build().
+ local revstring="$(get_component_revision ${component})"
+ local branch="$(get_component_branch ${component})"
+ local srcdir="$(get_component_srcdir ${component})"
+
+ # Try to generate a nicer revision
+ if [ -d ${srcdir}/.git ]; then
+ revstring=$(git -C ${srcdir} describe --match "basepoints/*" \
+ --match "releases/*" ${revstring} | sed 's,^basepoints/,,')
+ fi
+
+ local long_config="$target $ABE_TARGET_BOARD_OPTIONS"
+ dryrun "echo $(date --utc --iso-8601=seconds) '(${branch} revision' $revstring')' $long_config | tee ${srcdir}/LAST_UPDATED"
+ fi
+
;;
gdb)
exec_tests=true