Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/48901 )
Change subject: util/crossgcc: Add date to the toolchain revision ......................................................................
util/crossgcc: Add date to the toolchain revision
With the current version method, it's not possible to determine if a different version is older or newer than the current version without digging into the repository and finding the dates for the version numbers.
This change adds the commit date to the start of the toolchain version which will let us tell at a glance how old or new the toolchain is.
It's not perfect because multiple toolchain commits can go in on the same day, but adding the time made the string even longer, and really doesn't help that much.
Signed-off-by: Martin Roth martin@coreboot.org Change-Id: I9c6d27667b922dc15e7a6e132e1beff69eed839c Reviewed-on: https://review.coreboot.org/c/coreboot/+/48901 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Patrick Georgi pgeorgi@google.com --- M util/crossgcc/buildgcc 1 file changed, 6 insertions(+), 7 deletions(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index 92b4712..c947dd4 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -16,8 +16,7 @@
cd "$(dirname "$0")" || exit 1
-CROSSGCC_DATE="$(git log -n 1 --pretty=%ad --date=short .)" -CROSSGCC_VERSION="$(git log -n 1 --pretty=%h .)" +CROSSGCC_VERSION="$(git log -n 1 --pretty=%cd --date=short .)_$(git log -n 1 --pretty=%h .)" CROSSGCC_COMMIT=$( git describe )
# default settings @@ -591,7 +590,7 @@ }
printversion() { - printf "${blue}Welcome to the ${red}coreboot${blue} cross toolchain builder v$CROSSGCC_VERSION ($CROSSGCC_DATE)${NC}\n\n" + printf "${blue}Welcome to the ${red}coreboot${blue} cross toolchain builder v$CROSSGCC_VERSION ${NC}\n\n" }
myversion() @@ -728,7 +727,7 @@ ${GCC_OPTIONS} --enable-languages="${LANGUAGES}" \ --with-gmp="$DESTDIR$TARGETDIR" --with-mpfr="$DESTDIR$TARGETDIR" \ --with-mpc="$DESTDIR$TARGETDIR" \ - --with-pkgversion="coreboot bootstrap v$CROSSGCC_VERSION $CROSSGCC_DATE" \ + --with-pkgversion="coreboot bootstrap v$CROSSGCC_VERSION" \ && \ # shellcheck disable=SC2086 $MAKE $JOBS BOOT_CFLAGS="$HOSTCFLAGS" BUILD_CONFIG="" bootstrap && \ @@ -774,7 +773,7 @@ --with-gmp="$DESTDIR$TARGETDIR" --with-mpfr="$DESTDIR$TARGETDIR" \ --with-mpc="$DESTDIR$TARGETDIR" \ --with-gnu-as --with-gnu-ld \ - --with-pkgversion="coreboot toolchain v$CROSSGCC_VERSION $CROSSGCC_DATE" \ + --with-pkgversion="coreboot toolchain v$CROSSGCC_VERSION" \ && \ mkdir -p gcc/$TARGETARCH && \ rm -f "gcc/$TARGETARCH/$GCC_VERSION" && \ @@ -843,7 +842,7 @@ test "$UNAME" = "FreeBSD" && HOST="_FreeBSD" test "$UNAME" = "Cygwin" && HOST="_CYGWIN" HOST="$HOST" CFLAGS="$CFLAGS" \ - OPT_CFLAGS="-O -D_FORTIFY_SOURCE=2 -D COREBOOT_TOOLCHAIN_VERSION='"coreboot toolchain v$CROSSGCC_VERSION $CROSSGCC_DATE"' " \ + OPT_CFLAGS="-O -D_FORTIFY_SOURCE=2 -D COREBOOT_TOOLCHAIN_VERSION='"coreboot toolchain v$CROSSGCC_VERSION"' " \ $MAKE $JOBS CC="$(hostcc host)" iasl acpibin acpidump acpiexec acpihelp acpisrc acpixtract rm -f "$DESTDIR$TARGETDIR/bin/{iasl,acpibin,acpidump,acpiexec,acpihelp,acpisrc,acpixtract}" || touch "$RDIR/.failed" cp bin/{iasl,acpibin,acpidump,acpiexec,acpihelp,acpisrc,acpixtract} "$DESTDIR$TARGETDIR/bin" || touch "$RDIR/.failed" @@ -858,7 +857,7 @@ cd - || exit 1
$CMAKE -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$DESTDIR$TARGETDIR" \ - -DCLANG_VENDOR="coreboot toolchain v$CROSSGCC_VERSION $CROSSGCC_DATE - " \ + -DCLANG_VENDOR="coreboot toolchain v$CROSSGCC_VERSION - " \ -DCMAKE_BUILD_TYPE=Release ../$LLVM_DIR || touch .failed # shellcheck disable=SC2086 $MAKE $JOBS || touch .failed