Skip to content

Commit

Permalink
Include SHA1 in version string for nightly GCCrs/static ananlysis builds
Browse files Browse the repository at this point in the history
Helps with tracking bugs when version string displays:

 gcc (Compiler-Explorer-Build-99b73780e6e30f962c01532d3ec189ceeecf7f93) 11.0.1 20210325 (experimental)

Also bump Major version used for local patch (currently none) for GCCrs as it's
based on pre-11 release.

Add quotes to have shellcheck happy.
  • Loading branch information
dkm committed May 23, 2021
1 parent 3dbd2ad commit a2f318d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions build/build.sh
Expand Up @@ -52,13 +52,15 @@ elif echo "${VERSION}" | grep 'static-analysis-trunk'; then
MAJOR_MINOR=10-trunk
LANGUAGES=c,c++
PLUGINS=analyzer
INCLUDE_SHA1_IN_VERSION_STRING=yes
elif echo "${VERSION}" | grep 'gccrs-master'; then
VERSION=gccrs-master-$(date +%Y%m%d)
URL=https://github.com/Rust-GCC/gccrs.git
BRANCH=master
MAJOR=10
MAJOR_MINOR=10-trunk
MAJOR=11
MAJOR_MINOR=11-trunk
LANGUAGES=rust
INCLUDE_SHA1_IN_VERSION_STRING=yes
elif echo "${VERSION}" | grep 'trunk'; then
VERSION=trunk-$(date +%Y%m%d)
URL=git://gcc.gnu.org/git/gcc.git
Expand Down Expand Up @@ -90,10 +92,15 @@ if [[ "${BINUTILS_VERSION}" == "trunk" ]]; then
BINUTILS_NEEDS_GMP=yes
fi

GCC_REVISION=$(git ls-remote --heads ${URL} refs/heads/${BRANCH} | cut -f 1)
GCC_REVISION=$(git ls-remote --heads ${URL} "refs/heads/${BRANCH}" | cut -f 1)
REVISION="gcc-${GCC_REVISION}-binutils-${BINUTILS_REVISION}"
LAST_REVISION="${3}"

PKGVERSION="Compiler-Explorer-Build"
if [[ -n "${INCLUDE_SHA1_IN_VERSION_STRING}" ]]; then
PKGVERSION+="-${GCC_REVISION}"
fi

echo "ce-build-revision:${REVISION}"

if [[ "${REVISION}" == "${LAST_REVISION}" ]]; then
Expand Down Expand Up @@ -163,7 +170,7 @@ CONFIG+=" --enable-linker-build-id"
CONFIG+=" --enable-lto"
CONFIG+=" --enable-plugins"
CONFIG+=" --enable-threads=posix"
CONFIG+=" --with-pkgversion=Compiler-Explorer-Build"
CONFIG+=" --with-pkgversion=\"${PKGVERSION}\""
# The static analyzer branch adds a --enable-plugins configuration option
if [[ -n "${PLUGINS}" ]]; then
CONFIG+=" --enable-plugins=${PLUGINS}"
Expand Down

0 comments on commit a2f318d

Please sign in to comment.