From 8e951446f70f9fa789788072891009c0123e02b8 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 29 Dec 2019 20:54:54 +0100 Subject: [PATCH 1/3] Don't e "helpful" and auto convert shell scripts from unix to dos. --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..3b01fe21f1 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.sh -text \ No newline at end of file From 7c9e7f4c033591b11a39a7b18cf36ba0bc7ad65f Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 29 Dec 2019 20:56:12 +0100 Subject: [PATCH 2/3] Ignore *.orig files. --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 880dec30c6..296e96df9c 100755 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,7 @@ .*.swp #OSX image cache file *.DS_Store -#*.orig +*.orig LICENSES scripts/install.cache.* indra/newview/res/viewerRes.rc From f238377c80c716244fe88100833f95dcd13b8f88 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 29 Dec 2019 23:24:55 +0100 Subject: [PATCH 3/3] Bake git rev. hash into the viewer. --- indra/cmake/BuildVersion.cmake | 3 ++- indra/newview/fsversionvalues.h.in | 2 ++ indra/newview/llappviewer.cpp | 6 +++++- indra/newview/llversioninfo.cpp | 6 ++++++ indra/newview/llversioninfo.h | 4 ++++ scripts/configure_firestorm.sh | 6 ++++-- 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake index 790153884a..86e42fa0ba 100644 --- a/indra/cmake/BuildVersion.cmake +++ b/indra/cmake/BuildVersion.cmake @@ -9,7 +9,7 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" VIEWER_VERSION_MAJOR ${VIEWER_SHORT_VERSION}) string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" VIEWER_VERSION_MINOR ${VIEWER_SHORT_VERSION}) string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" VIEWER_VERSION_PATCH ${VIEWER_SHORT_VERSION}) - + if (DEFINED ENV{revision}) set(VIEWER_VERSION_REVISION $ENV{revision}) message("Revision (from environment): ${VIEWER_VERSION_REVISION}") @@ -64,6 +64,7 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n "LL_VIEWER_VERSION_MINOR=${VIEWER_VERSION_MINOR}" "LL_VIEWER_VERSION_PATCH=${VIEWER_VERSION_PATCH}" "LL_VIEWER_VERSION_BUILD=${VIEWER_VERSION_REVISION}" + "FS_VIEWER_VERSION_GITHASH=${VIEWER_VERSION_GITHASH}" "LLBUILD_CONFIG=\"${CMAKE_BUILD_TYPE}\"" ) endif (NOT DEFINED VIEWER_SHORT_VERSION) diff --git a/indra/newview/fsversionvalues.h.in b/indra/newview/fsversionvalues.h.in index 5e4c932b10..359c349103 100755 --- a/indra/newview/fsversionvalues.h.in +++ b/indra/newview/fsversionvalues.h.in @@ -42,7 +42,9 @@ #define LL_VIEWER_VERSION_MINOR @VIEWER_VERSION_MINOR@ #define LL_VIEWER_VERSION_PATCH @VIEWER_VERSION_PATCH@ #define LL_VIEWER_VERSION_BUILD @VIEWER_VERSION_REVISION@ +const std::string LL_VIEWER_VERSION_GITHASH {@VIEWER_VERSION_GITHASH@}; #define LLBUILD_CONFIG "@CMAKE_BUILD_TYPE@" + // #endif diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 9e0d45e4a4..6730e9f2b2 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4196,7 +4196,11 @@ void LLAppViewer::writeSystemInfo() // Dump some debugging info LL_INFOS("SystemInfo") << "Application: " << LLTrans::getString("APP_NAME") << LL_ENDL; - LL_INFOS("SystemInfo") << "Version: " << LLVersionInfo::getChannelAndVersion() << LL_ENDL; + + // Print into about git sha hash this build is based on. + // LL_INFOS("SystemInfo") << "Version: " << LLVersionInfo::getChannelAndVersion() << LL_ENDL; + LL_INFOS("SystemInfo") << "Version: " << LLVersionInfo::getChannelAndVersion() << " [" << LLVersionInfo::getGitHash() << "]" << LL_ENDL; + // // Dump the local time and time zone time_t now; diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp index 8d5168ba24..cb82d1de96 100644 --- a/indra/newview/llversioninfo.cpp +++ b/indra/newview/llversioninfo.cpp @@ -268,3 +268,9 @@ const std::string &LLVersionInfo::getBuildConfig() static const std::string build_configuration(LLBUILD_CONFIG); // set in indra/cmake/BuildVersion.cmake return build_configuration; } + +// return hash of HEAD +std::string LLVersionInfo::getGitHash() +{ + return LL_VIEWER_VERSION_GITHASH; +} diff --git a/indra/newview/llversioninfo.h b/indra/newview/llversioninfo.h index fed6b0efb5..4ecb605891 100644 --- a/indra/newview/llversioninfo.h +++ b/indra/newview/llversioninfo.h @@ -98,6 +98,10 @@ public: RELEASE_VIEWER } ViewerMaturity; static ViewerMaturity getViewerMaturity(); + + // return hash of HEAD + static std::string getGitHash(); + // }; #endif diff --git a/scripts/configure_firestorm.sh b/scripts/configure_firestorm.sh index d4753cd82e..a19c5d25fa 100755 --- a/scripts/configure_firestorm.sh +++ b/scripts/configure_firestorm.sh @@ -405,8 +405,10 @@ if [ \( $WANTS_VERSION -eq $TRUE \) -o \( $WANTS_CONFIG -eq $TRUE \) ] ; then majorVer=`cat indra/newview/VIEWER_VERSION.txt | cut -d "." -f 1` minorVer=`cat indra/newview/VIEWER_VERSION.txt | cut -d "." -f 2` patchVer=`cat indra/newview/VIEWER_VERSION.txt | cut -d "." -f 3` + gitHash=`git describe --always` echo "Channel : ${CHANNEL}" - echo "Version : ${majorVer}.${minorVer}.${patchVer}.${buildVer}" + echo "Version : ${majorVer}.${minorVer}.${patchVer}.${buildVer} [${gitHash}]" + GITHASH=-DVIEWER_VERSION_GITHASH=\"${gitHash}\" popd fi @@ -505,7 +507,7 @@ if [ $WANTS_CONFIG -eq $TRUE ] ; then UNATTENDED="-DUNATTENDED=ON" fi - cmake -G "$TARGET" ../indra $CHANNEL $FMODSTUDIO $FMODEX $KDU $OPENSIM $SINGLEGRID $AVX_OPTIMIZATION $AVX2_OPTIMIZATION $TESTBUILD $PACKAGE $UNATTENDED -DLL_TESTS:BOOL=OFF -DADDRESS_SIZE:STRING=$AUTOBUILD_ADDRSIZE -DCMAKE_BUILD_TYPE:STRING=$BTYPE \ + cmake -G "$TARGET" ../indra $CHANNEL ${GITHASH} $FMODSTUDIO $FMODEX $KDU $OPENSIM $SINGLEGRID $AVX_OPTIMIZATION $AVX2_OPTIMIZATION $TESTBUILD $PACKAGE $UNATTENDED -DLL_TESTS:BOOL=OFF -DADDRESS_SIZE:STRING=$AUTOBUILD_ADDRSIZE -DCMAKE_BUILD_TYPE:STRING=$BTYPE \ $CRASH_REPORTING -DVIEWER_SYMBOL_FILE:STRING="${VIEWER_SYMBOL_FILE:-}" -DROOT_PROJECT_NAME:STRING=Firestorm $LL_ARGS_PASSTHRU | tee $LOG if [ $PLATFORM == "windows" ] ; then