Преглед на файлове

HPCC-25611 Allow build tag use by platform to be driven by env. var.

And allow to be parsed in during docker build
(primarily to be used by LN build)

Signed-off-by: Jake Smith <jake.smith@lexisnexisrisk.com>
Jake Smith преди 4 години
родител
ревизия
9aca97785b
променени са 48 файла, в които са добавени 52 реда и са изтрити 101 реда
  1. 0 1
      common/dllserver/thorplugin.cpp
  2. 0 1
      configuration/cli/envchk/envchk.cpp
  3. 1 1
      dali/dfuplus/main.cpp
  4. 1 2
      dali/sasha/saserver.cpp
  5. 1 2
      dali/server/daserver.cpp
  6. 2 4
      dockerfiles/buildall-common.sh
  7. 6 0
      dockerfiles/buildall.sh
  8. 2 0
      dockerfiles/platform-core-debug/Dockerfile
  9. 1 3
      ecl/ecl-bundle/ecl-bundle.cpp
  10. 1 3
      ecl/ecl-package/ecl-package.cpp
  11. 3 4
      ecl/eclagent/eclagent.cpp
  12. 1 2
      ecl/eclcc/eclcc.cpp
  13. 1 3
      ecl/eclcmd/ecl.cpp
  14. 1 2
      ecl/eclcmd/eclcmd_common.cpp
  15. 0 1
      ecl/eclcmd/eclcmd_core.cpp
  16. 1 1
      ecl/eclcmd/eclcmd_shell.cpp
  17. 1 3
      ecl/eclcmd/queries/ecl-queries.cpp
  18. 1 3
      ecl/eclcmd/roxie/ecl-roxie.cpp
  19. 1 2
      ecl/hql/hqlexpr.cpp
  20. 1 2
      ecl/hqlcpp/hqlecl.cpp
  21. 1 2
      ecl/hqlcpp/hqlhtcpp.cpp
  22. 0 16
      esp/platform/espcontext.cpp
  23. 0 1
      esp/platform/espcontext.hpp
  24. 2 5
      esp/platform/espp.cpp
  25. 0 1
      esp/services/ws_account/ws_accountService.hpp
  26. 0 1
      esp/services/ws_configmgr/ws_configmgrSession.hpp
  27. 0 1
      esp/services/ws_smc/ws_smcService.cpp
  28. 1 1
      esp/services/ws_sql/ws_sqlService.cpp
  29. 1 2
      fs/dafilesrv/dafilesrv.cpp
  30. 2 2
      roxie/ccd/ccdmain.cpp
  31. 1 2
      roxie/ccd/ccdstate.cpp
  32. 0 1
      system/jlib/jdebug.cpp
  33. 0 1
      system/jlib/jfile.cpp
  34. 0 1
      system/jlib/jlog.cpp
  35. 0 2
      system/jlib/jsecrets.cpp
  36. 0 1
      system/jlib/jsocket.cpp
  37. 6 0
      system/jlib/jutil.cpp
  38. 2 0
      system/jlib/jutil.hpp
  39. 1 2
      thorlcr/master/thgraphmanager.cpp
  40. 2 3
      thorlcr/master/thmastermain.cpp
  41. 3 4
      thorlcr/slave/thslavemain.cpp
  42. 1 1
      thorlcr/thorutil/thormisc.cpp
  43. 0 1
      tools/esdlcmd/esdl-publish.cpp
  44. 1 3
      tools/esdlcmd/esdlcmd.cpp
  45. 1 2
      tools/esdlcmd/esdlcmd_common.cpp
  46. 0 1
      tools/esdlcmd/esdlcmd_core.cpp
  47. 0 1
      tools/esdlcmd/esdlcmd_monitor.cpp
  48. 1 3
      tools/esdlcmd/esdlcmd_shell.cpp

+ 0 - 1
common/dllserver/thorplugin.cpp

@@ -24,7 +24,6 @@
 #include "jregexp.hpp"
 #include "jlzw.hpp"
 #include "eclrtl.hpp"
-#include "build-config.h"
 #if defined(__APPLE__)
 #include <mach-o/getsect.h>
 #include <sys/mman.h>

+ 0 - 1
configuration/cli/envchk/envchk.cpp

@@ -19,7 +19,6 @@
 #include <iostream>
 #include <string>
 #include <vector>
-#include "build-config.h"
 #include "platform.h"
 #include <exception>
 #include <sys/types.h>

+ 1 - 1
dali/dfuplus/main.cpp

@@ -23,7 +23,7 @@
 
 void printVersion()
 {
-    printf("DFU Version: %d %s\n", DAFT_VERSION, BUILD_TAG);
+    printf("DFU Version: %d %s\n", DAFT_VERSION, hpccBuildTag);
 }
 
 void handleSyntax()

+ 1 - 2
dali/sasha/saserver.cpp

@@ -15,7 +15,6 @@
     limitations under the License.
 ############################################################################## */
 
-#include "build-config.h"
 #include "platform.h"
 #include "thirdparty.h"
 #include "portlist.h"
@@ -369,7 +368,7 @@ int main(int argc, const char* argv[])
     #else
         setupContainerizedLogMsgHandler();
     #endif
-        DBGLOG("Build %s", BUILD_TAG);
+        DBGLOG("Build %s", hpccBuildTag);
 
         unsigned short port = serverConfig->getPropInt("@port");
         if (!port)

+ 1 - 2
dali/server/daserver.cpp

@@ -18,7 +18,6 @@
 #include <unordered_map>
 #include <string>
 
-#include "build-config.h"
 #include "platform.h"
 #include "thirdparty.h"
 #include "jlib.hpp"
@@ -458,7 +457,7 @@ int main(int argc, const char* argv[])
 #else
         setupContainerizedLogMsgHandler();
 #endif
-        PROGLOG("Build %s", BUILD_TAG);
+        PROGLOG("Build %s", hpccBuildTag);
 
         StringBuffer dataPath;
         StringBuffer mirrorPath;

+ 2 - 4
dockerfiles/buildall-common.sh

@@ -49,9 +49,6 @@ fi
 set -e
 
 if [[ -z ${INPUT_BUILD_LABEL} ]]; then
-  . ${SCRIPT_DIR}/../cmake_modules/parse_cmake.sh
-  parse_cmake
-  set_tag
   BUILD_LABEL=${HPCC_SHORT_TAG}
 else
   BUILD_LABEL=${INPUT_BUILD_LABEL}
@@ -73,6 +70,7 @@ build_image() {
   local name=$1
   local label=$2
   local buildTag=$3
+  local rest=${@:4}
   [[ -z ${label} ]] && label=$BUILD_LABEL
   [[ -z ${buildTag} ]] && buildTag=$BUILD_TAG
 
@@ -87,7 +85,7 @@ build_image() {
        --build-arg USE_CPPUNIT=${USE_CPPUNIT} \
        --build-arg BUILD_THREADS=${BUILD_THREADS} \
        --build-arg GITHUB_TOKEN=${GITHUB_TOKEN} \
-       ${name}/
+       ${rest} ${name}/
   fi
   push_image $name $label
 }

+ 6 - 0
dockerfiles/buildall.sh

@@ -23,6 +23,12 @@
 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 pushd $DIR 2>&1 > /dev/null
 
+if [[ -z ${INPUT_BUILD_LABEL} ]]; then
+  . ${SCRIPT_DIR}/../cmake_modules/parse_cmake.sh
+  parse_cmake
+  set_tag $HPCC_PROJECT
+fi
+
 . ./buildall-common.sh
 
 if [[ -n ${INPUT_USERNAME} ]] ; then

+ 2 - 0
dockerfiles/platform-core-debug/Dockerfile

@@ -37,4 +37,6 @@ ENV HPCC_DLLSERVER_PATH=/var/lib/HPCCSystems/queries
 
 USER hpcc
 WORKDIR /var/lib/HPCCSystems
+ARG BUILD_TAG_OVERRIDE
+ENV HPCC_BUILD_TAG=${BUILD_TAG_OVERRIDE}
 RUN eclcc -pch && rm eclcc.log

+ 1 - 3
ecl/ecl-bundle/ecl-bundle.cpp

@@ -23,8 +23,6 @@
 
 #include "rmtfile.hpp"
 
-#include "build-config.h"
-
 #include "eclcmd.hpp"
 #include "eclcmd_common.hpp"
 #include "eclcmd_core.hpp"
@@ -1839,7 +1837,7 @@ public:
 
 static int doMain(int argc, const char *argv[])
 {
-    BundleCMDShell processor(argc, argv, createBundleSubCommand, BUILD_TAG);
+    BundleCMDShell processor(argc, argv, createBundleSubCommand, hpccBuildTag);
     return processor.run();
 }
 

+ 1 - 3
ecl/ecl-package/ecl-package.cpp

@@ -20,8 +20,6 @@
 #include "jfile.hpp"
 #include "jargv.hpp"
 
-#include "build-config.h"
-
 #include "ws_packageprocess_esp.ipp"
 
 #include "eclcmd.hpp"
@@ -1644,7 +1642,7 @@ public:
 
 static int doMain(int argc, const char *argv[])
 {
-    PackageCMDShell processor(argc, argv, createPackageSubCommand, BUILD_TAG);
+    PackageCMDShell processor(argc, argv, createPackageSubCommand, hpccBuildTag);
     return processor.run();
 }
 

+ 3 - 4
ecl/eclagent/eclagent.cpp

@@ -15,7 +15,6 @@
     limitations under the License.
 ############################################################################## */
 
-#include "build-config.h"
 #include "jlib.hpp"
 #include "jmisc.hpp"
 #include "jdebug.hpp"
@@ -1858,7 +1857,7 @@ void EclAgent::doProcess()
             LOG(MCrunlock, unknownJob, "Obtained workunit lock");
             if (w->hasDebugValue("traceLevel"))
                 traceLevel = w->getDebugValueInt("traceLevel", 10);
-            w->setTracingValue("EclAgentBuild", BUILD_TAG);
+            w->setTracingValue("EclAgentBuild", hpccBuildTag);
             if (agentTopology->hasProp("@name"))
                 w->addProcess("EclAgent", agentTopology->queryProp("@name"), GetCurrentProcessId(), 0, nullptr, false, logname.str());
 
@@ -3474,7 +3473,7 @@ extern int HTHOR_API eclagent_main(int argc, const char *argv[], StringBuffer *
     if (traceLevel)
     {
         printStart(argc, argv);
-        DBGLOG("Build %s", BUILD_TAG);
+        DBGLOG("Build %s", hpccBuildTag);
     }
 
     // Extract any params into stored - primarily for standalone case but handy for debugging eclagent sometimes too
@@ -3662,7 +3661,7 @@ extern int HTHOR_API eclagent_main(int argc, const char *argv[], StringBuffer *
             wuid.set(uid);
         }
         setDefaultJobId(wuid.str());
-        LOG(MCoperatorInfo, "hthor build %s", BUILD_TAG);
+        LOG(MCoperatorInfo, "hthor build %s", hpccBuildTag);
 
 #ifdef MONITOR_ECLAGENT_STATUS
         if (serverstatus)

+ 1 - 2
ecl/eclcc/eclcc.cpp

@@ -52,7 +52,6 @@
 #include "hqlstmt.hpp"
 #include "hqlcache.hpp"
 
-#include "build-config.h"
 #include "rmtfile.hpp"
 #include "deffield.hpp"
 
@@ -2854,7 +2853,7 @@ int EclCC::parseCommandLineOptions(int argc, const char* argv[])
         }
         else if (strcmp(arg, "--version")==0)
         {
-            fprintf(stdout,"%s %s\n", LANGUAGE_VERSION, BUILD_TAG);
+            fprintf(stdout,"%s %s\n", LANGUAGE_VERSION, hpccBuildTag);
             return 1;
         }
         else if (startsWith(arg, "-Wc,"))

+ 1 - 3
ecl/eclcmd/ecl.cpp

@@ -19,8 +19,6 @@
 #include "jfile.hpp"
 #include "jargv.hpp"
 
-#include "build-config.h"
-
 #include "ws_workunits.hpp"
 
 #include "eclcmd.hpp"
@@ -37,7 +35,7 @@
 
 static int doMain(int argc, const char *argv[])
 {
-    EclCMDShell processor(argc, argv, createCoreEclCommand, BUILD_TAG, true);
+    EclCMDShell processor(argc, argv, createCoreEclCommand, hpccBuildTag, true);
     return processor.run();
 }
 

+ 1 - 2
ecl/eclcmd/eclcmd_common.cpp

@@ -20,7 +20,6 @@
 #include "jfile.hpp"
 #include "jargv.hpp"
 #include "junicode.hpp"
-#include "build-config.h"
 #include "workunit.hpp"
 #include "eclwatch_errorlist.hpp"
 
@@ -332,7 +331,7 @@ eclCmdOptionMatchIndicator EclCmdCommon::matchCommandLineOption(ArgvIterator &it
     }
     if (iter.matchFlag(boolValue, ECLOPT_VERSION))
     {
-        fprintf(stdout, "%s\n", BUILD_TAG);
+        fprintf(stdout, "%s\n", hpccBuildTag);
         return EclCmdOptionCompletion;
     }
     if (iter.matchOption(optServer, ECLOPT_SERVER)||iter.matchOption(optServer, ECLOPT_SERVER_S))

+ 0 - 1
ecl/eclcmd/eclcmd_core.cpp

@@ -20,7 +20,6 @@
 #include "jfile.hpp"
 #include "jargv.hpp"
 #include "jflz.hpp"
-#include "build-config.h"
 #include "httpclient.hpp"
 
 #include "workunit.hpp"

+ 1 - 1
ecl/eclcmd/eclcmd_shell.cpp

@@ -184,7 +184,7 @@ bool EclCMDShell::parseCommandLineOptions(ArgvIterator &iter)
         }
         if (iter.matchFlag(boolValue, "--version"))
         {
-            fprintf(stdout, "%s\n", BUILD_TAG);
+            fprintf(stdout, "%s\n", hpccBuildTag);
             return false;
         }
         StringAttr tempArg;

+ 1 - 3
ecl/eclcmd/queries/ecl-queries.cpp

@@ -20,8 +20,6 @@
 #include "jargv.hpp"
 #include "jflz.hpp"
 
-#include "build-config.h"
-
 #include "ws_workunits.hpp"
 
 #include "eclcmd.hpp"
@@ -1561,7 +1559,7 @@ public:
 
 static int doMain(int argc, const char *argv[])
 {
-    EclQueriesCMDShell processor(argc, argv, createEclQueriesCommand, BUILD_TAG);
+    EclQueriesCMDShell processor(argc, argv, createEclQueriesCommand, hpccBuildTag);
     return processor.run();
 }
 

+ 1 - 3
ecl/eclcmd/roxie/ecl-roxie.cpp

@@ -19,8 +19,6 @@
 #include "jfile.hpp"
 #include "jargv.hpp"
 
-#include "build-config.h"
-
 #include "ws_smc.hpp"
 
 #include "eclcmd.hpp"
@@ -565,7 +563,7 @@ public:
 
 static int doMain(int argc, const char *argv[])
 {
-    EclRoxieCMDShell processor(argc, argv, createEclRoxieCommand, BUILD_TAG);
+    EclRoxieCMDShell processor(argc, argv, createEclRoxieCommand, hpccBuildTag);
     return processor.run();
 }
 

+ 1 - 2
ecl/hql/hqlexpr.cpp

@@ -15,7 +15,6 @@
     limitations under the License.
 ############################################################################## */
 #include "platform.h"
-#include "build-config.h"
 
 #include "jlib.hpp"
 #include "jmisc.hpp"
@@ -1299,7 +1298,7 @@ void HqlParseContext::getCacheBaseFilename(StringBuffer & fullName, StringBuffer
 extern HQL_API IPropertyTree * createAttributeArchive()
 {
     Owned<IPropertyTree> archive = createPTree("Archive");
-    archive->setProp("@build", BUILD_TAG);
+    archive->setProp("@build", hpccBuildTag);
     archive->setProp("@eclVersion", LANGUAGE_VERSION);
     return archive.getClear();
 }

+ 1 - 2
ecl/hqlcpp/hqlecl.cpp

@@ -15,7 +15,6 @@
     limitations under the License.
 ############################################################################## */
 
-#include "build-config.h"
 #include "jliball.hpp"
 #include "jmisc.hpp"
 #include "jstream.hpp"
@@ -847,7 +846,7 @@ extern HQLCPP_API unsigned getLibraryCRC(IHqlExpression * library)
 void setWorkunitHash(IWorkUnit * wu, IHqlExpression * expr)
 {
     //Assuming builds come from different branches this will change the crc for each one.
-    unsigned cacheCRC = crc32(BUILD_TAG, strlen(BUILD_TAG), ACTIVITY_INTERFACE_VERSION);
+    unsigned cacheCRC = crc32(hpccBuildTag, strlen(hpccBuildTag), ACTIVITY_INTERFACE_VERSION);
     cacheCRC += getExpressionCRC(expr);
 #ifdef _WIN32
     cacheCRC++; // make sure CRC is different in windows/linux

+ 1 - 2
ecl/hqlcpp/hqlhtcpp.cpp

@@ -24,7 +24,6 @@
 #include "jdebug.hpp"
 #include "rtldynfield.hpp"
 
-#include "build-config.h"
 #include "hql.hpp"
 #include "hqlthql.hpp"
 #include "hqlmeta.hpp"
@@ -6067,7 +6066,7 @@ bool HqlCppTranslator::buildCpp(IHqlCppInstance & _code, HqlQueryContext & query
 
     try
     {
-        wu()->setCodeVersion(ACTIVITY_INTERFACE_VERSION,BUILD_TAG,LANGUAGE_VERSION);
+        wu()->setCodeVersion(ACTIVITY_INTERFACE_VERSION,hpccBuildTag,LANGUAGE_VERSION);
         cacheOptions();
 
         if (options.obfuscateOutput)

+ 0 - 16
esp/platform/espcontext.cpp

@@ -999,22 +999,6 @@ const char* getBuildVersion()
 {
     return g_buildVersion.str();
 }
-static StringBuffer g_buildLevel;
-
-void setBuildLevel(const char* buildLevel)
-{
-    g_buildLevel.clear();
-    if(buildLevel&&*buildLevel)
-        g_buildLevel.append(buildLevel);
-
-    g_buildLevel.trim();
-}
-
-const char* getBuildLevel()
-{
-    return g_buildLevel.str();
-}
-
 IEspServer* queryEspServer()
 {
     return dynamic_cast<IEspServer*>(getESPContainer());

+ 0 - 1
esp/platform/espcontext.hpp

@@ -145,7 +145,6 @@ esp_http_decl const char* getCFD();
 esp_http_decl void setBuildVersion(const char* buildVersion);
 esp_http_decl const char* getBuildVersion();
 esp_http_decl void setBuildLevel(const char* buildLevel);
-esp_http_decl const char* getBuildLevel();
 esp_http_decl IEspServer* queryEspServer();
 
 #define SDSSESSION_CONNECT_TIMEOUTMS (180*1000)

+ 2 - 5
esp/platform/espp.cpp

@@ -462,18 +462,15 @@ int init_main(int argc, const char* argv[])
         procpt->setProp("@daliServers", queryComponentConfig().queryProp("@daliServers"));
 #endif
 
-        const char* build_ver = BUILD_TAG;
+        const char* build_ver = hpccBuildTag;
         setBuildVersion(build_ver);
 
-        const char* build_level = BUILD_LEVEL;
-        setBuildLevel(build_level);
-
         const char * processName = procpt->queryProp("@name");
         setStatisticsComponentName(SCTesp, processName, true);
 
         openEspLogFile(envpt.get(), procpt.get());
 
-        DBGLOG("Esp starting %s", BUILD_TAG);
+        DBGLOG("Esp starting %s", hpccBuildTag);
 
         StringBuffer componentfilesDir;
         if(procpt->hasProp("@componentfilesDir"))

+ 0 - 1
esp/services/ws_account/ws_accountService.hpp

@@ -50,7 +50,6 @@ public:
 
         IPropertyTree *folder = ensureNavFolder(data, "My Account", "My Account");
 
-        const char* build_level = getBuildLevel();
         if (!stricmp(m_authType.str(), "none") || !stricmp(m_authType.str(), "local"))
         {
             ensureNavLink(*folder, "My Account", "/Ws_Access/SecurityNotEnabled?form_", "My Account", NULL, NULL, 0, true);//Force the menu to use this setting

+ 0 - 1
esp/services/ws_configmgr/ws_configmgrSession.hpp

@@ -21,7 +21,6 @@
 
 
 #include "EnvironmentMgr.hpp"
-#include "build-config.h"
 #include <iterator>
 #include <algorithm>
 #include <map>

+ 0 - 1
esp/services/ws_smc/ws_smcService.cpp

@@ -17,7 +17,6 @@
 
 #pragma warning (disable : 4786)
 
-#include "build-config.h"
 
 #ifdef _USE_OPENLDAP
 #include "ldapsecurity.ipp"

+ 1 - 1
esp/services/ws_sql/ws_sqlService.cpp

@@ -30,7 +30,7 @@ void CwssqlEx::init(IPropertyTree *_cfg, const char *_process, const char *_serv
         throw MakeStringException(-1, "ws_sqlEx: Problem initiating ECLFunctions structure");
     }
 
-    setWsSqlBuildVersion(BUILD_TAG);
+    setWsSqlBuildVersion(hpccBuildTag);
 }
 
 bool CwssqlEx::onEcho(IEspContext &context, IEspEchoRequest &req, IEspEchoResponse &resp)

+ 1 - 2
fs/dafilesrv/dafilesrv.cpp

@@ -18,7 +18,6 @@
 #include "platform.h"
 #include "portlist.h"
 
-#include "build-config.h"
 #include "jlib.hpp"
 #include "jiface.hpp"
 #include "jutil.hpp"
@@ -800,7 +799,7 @@ int main(int argc,char **argv)
 #endif
 
     write_pidfile(componentName.str());
-    PROGLOG("Dafilesrv starting - Build %s", BUILD_TAG);
+    PROGLOG("Dafilesrv starting - Build %s", hpccBuildTag);
     PROGLOG("Parallel request limit = %d, throttleDelayMs = %d, throttleCPULimit = %d", parallelRequestLimit, throttleDelayMs, throttleCPULimit);
 
     const char * verstring = remoteServerVersionString();

+ 2 - 2
roxie/ccd/ccdmain.cpp

@@ -857,14 +857,14 @@ int CCD_API roxie_main(int argc, const char *argv[], const char * defaultYaml)
         if (restarts)
         {
             if (traceLevel)
-                DBGLOG("Roxie restarting: restarts = %d build = %s", restarts.load(), BUILD_TAG);
+                DBGLOG("Roxie restarting: restarts = %d build = %s", restarts.load(), hpccBuildTag);
             setStartRuid(restarts);
         }
         else
         {
             if (traceLevel)
             {
-                DBGLOG("Roxie starting, build = %s", BUILD_TAG);
+                DBGLOG("Roxie starting, build = %s", hpccBuildTag);
             }
         }
 

+ 1 - 2
roxie/ccd/ccdstate.cpp

@@ -17,7 +17,6 @@
 
 #include <platform.h>
 #include <jlib.hpp>
-#include "build-config.h"
 
 #include "jisem.hpp"
 #include "jhash.hpp"
@@ -2344,7 +2343,7 @@ private:
             }
             else if (stricmp(queryName, "control:getBuildVersion")==0)
             {
-                reply.appendf("<version id='%s'/>", BUILD_TAG);
+                reply.appendf("<version id='%s'/>", hpccBuildTag);
             }
             else
                 unknown = true;

+ 0 - 1
system/jlib/jdebug.cpp

@@ -55,7 +55,6 @@
  #include <mach/mach_host.h>
  #include <mach/vm_statistics.h>
 #endif
-#include "build-config.h"
 
 //===========================================================================
 #ifdef _DEBUG

+ 0 - 1
system/jlib/jfile.cpp

@@ -60,7 +60,6 @@
 #include "jregexp.hpp"
 #include "portlist.h"
 
-#include "build-config.h"
 #include "jprop.hpp"
 
 // #define REMOTE_DISCONNECT_ON_DESTRUCTOR  // enable to disconnect on IFile destructor

+ 0 - 1
system/jlib/jlog.cpp

@@ -17,7 +17,6 @@
 
 
 #include "platform.h"
-#include "build-config.h"
 
 #include <algorithm>
 #include "stdio.h"

+ 0 - 2
system/jlib/jsecrets.cpp

@@ -25,8 +25,6 @@
 #include "jerror.hpp"
 #include "jsecrets.hpp"
 
-#include "build-config.h"
-
 //including cpp-httplib single header file REST client
 //  doesn't work with format-nonliteral as an error
 //

+ 0 - 1
system/jlib/jsocket.cpp

@@ -67,7 +67,6 @@
 #include "jprop.hpp"
 #include "jregexp.hpp"
 #include "jdebug.hpp"
-#include "build-config.h"
 
 // epoll only with linux
 

+ 6 - 0
system/jlib/jutil.cpp

@@ -68,6 +68,8 @@ static CriticalSection * protectedGeneratorCs;
 mach_timebase_info_data_t timebase_info  = { 1,1 };
 #endif
 
+const char *hpccBuildTag = nullptr;
+
 MODULE_INIT(INIT_PRIORITY_SYSTEM)
 {
     cvtLock = new NonReentrantSpinLock;
@@ -79,6 +81,10 @@ MODULE_INIT(INIT_PRIORITY_SYSTEM)
     if (mach_timebase_info(&timebase_info) != KERN_SUCCESS)
         return false;
 #endif
+    hpccBuildTag = getenv("HPCC_BUILD_TAG");
+    if (isEmptyString(hpccBuildTag))
+        hpccBuildTag = BUILD_TAG;
+
     return true;
 }
 

+ 2 - 0
system/jlib/jutil.hpp

@@ -585,5 +585,7 @@ public:
     }
 };
 
+extern jlib_decl const char *hpccBuildTag;
+
 #endif
 

+ 1 - 2
thorlcr/master/thgraphmanager.cpp

@@ -15,7 +15,6 @@
     limitations under the License.
 ############################################################################## */
 
-#include "build-config.h"
 #include "platform.h"
 #include "jarray.hpp"
 #include "jfile.hpp"
@@ -907,7 +906,7 @@ bool CJobManager::executeGraph(IConstWorkUnit &workunit, const char *graphName,
     timestamp_type startTs = getTimeStampNowValue();
     {
         Owned<IWorkUnit> wu = &workunit.lock();
-        wu->setTracingValue("ThorBuild", BUILD_TAG);
+        wu->setTracingValue("ThorBuild", hpccBuildTag);
 #ifndef _CONTAINERIZED
         updateWorkUnitLog(*wu);
 #endif

+ 2 - 3
thorlcr/master/thmastermain.cpp

@@ -29,7 +29,6 @@
 #include <direct.h> 
 #endif
 
-#include "build-config.h"
 #include "jlib.hpp"
 #include "jdebug.hpp"
 #include "jfile.hpp"
@@ -605,7 +604,7 @@ int main( int argc, const char *argv[]  )
 #endif
     setStatisticsComponentName(SCTthor, globals->queryProp("@name"), true);
 
-    globals->setProp("@masterBuildTag", BUILD_TAG);
+    globals->setProp("@masterBuildTag", hpccBuildTag);
 
     setIORetryCount(globals->getPropInt("Debug/@ioRetries")); // default == 0 == off
     StringBuffer daliServer;
@@ -674,7 +673,7 @@ int main( int argc, const char *argv[]  )
         logHandler = queryStderrLogMsgHandler();
         logUrl.set("stderr");
 #endif
-        LOG(MCdebugProgress, thorJob, "Build %s", BUILD_TAG);
+        LOG(MCdebugProgress, thorJob, "Build %s", hpccBuildTag);
 
         Owned<IGroup> serverGroup = createIGroupRetry(daliServer.str(), DALI_SERVER_PORT);
 

+ 3 - 4
thorlcr/slave/thslavemain.cpp

@@ -25,7 +25,6 @@
 #include <stdio.h> 
 #include <stdlib.h> 
 
-#include "build-config.h"
 #include "jlib.hpp"
 #include "jdebug.hpp"
 #include "jexcept.hpp"
@@ -170,10 +169,10 @@ static bool RegisterSelf(SocketEndpoint &masterEp)
         const char *_masterBuildTag = globals->queryProp("@masterBuildTag");
         const char *masterBuildTag = _masterBuildTag?_masterBuildTag:"no build tag";
         PROGLOG("Master build: %s", masterBuildTag);
-        if (!_masterBuildTag || 0 != strcmp(BUILD_TAG, _masterBuildTag))
+        if (!_masterBuildTag || 0 != strcmp(hpccBuildTag, _masterBuildTag))
         {
             StringBuffer errStr("Thor master/slave build mismatch, master = ");
-            errStr.append(masterBuildTag).append(", slave = ").append(BUILD_TAG);
+            errStr.append(masterBuildTag).append(", slave = ").append(hpccBuildTag);
             OERRLOG("%s", errStr.str());
 #ifndef _DEBUG
             replyError(TE_FailedToRegisterSlave, errStr.str());
@@ -300,7 +299,7 @@ ILogMsgHandler *startSlaveLog()
     logHandler = queryStderrLogMsgHandler();
 #endif
     //setupContainerizedStorageLocations();
-    LOG(MCdebugProgress, thorJob, "Build %s", BUILD_TAG);
+    LOG(MCdebugProgress, thorJob, "Build %s", hpccBuildTag);
     return logHandler;
 }
 

+ 1 - 1
thorlcr/thorutil/thormisc.cpp

@@ -613,7 +613,7 @@ void SetLogName(const char *prefix, const char *logdir, const char *thorname, bo
     StringBuffer lf;
     openLogFile(lf, logname.str());
     PROGLOG("Opened log file %s", lf.str());
-    PROGLOG("Build %s", BUILD_TAG);
+    PROGLOG("Build %s", hpccBuildTag);
 }
 #endif
 

+ 0 - 1
tools/esdlcmd/esdl-publish.cpp

@@ -20,7 +20,6 @@
 #include "esdlcmd_common.hpp"
 
 #include "esdlcmd_core.hpp"
-#include "build-config.h"
 #include "esdlcmdutils.hpp"
 
 class EsdlPublishCmdCommon : public EsdlCmdCommon

+ 1 - 3
tools/esdlcmd/esdlcmd.cpp

@@ -19,8 +19,6 @@
 #include "jfile.hpp"
 #include "jargv.hpp"
 
-#include "build-config.h"
-
 #include "esdlcmd.hpp"
 #include "esdlcmd_common.hpp"
 #include "esdlcmd_core.hpp"
@@ -33,7 +31,7 @@
 
 static int doMain(int argc, const char *argv[])
 {
-    EsdlCMDShell processor(argc, argv, createCoreEsdlCommand, BUILD_TAG, true);
+    EsdlCMDShell processor(argc, argv, createCoreEsdlCommand, hpccBuildTag, true);
     return processor.run();
 }
 

+ 1 - 2
tools/esdlcmd/esdlcmd_common.cpp

@@ -20,7 +20,6 @@
 #include "jfile.hpp"
 #include "jargv.hpp"
 #include "junicode.hpp"
-#include "build-config.h"
 #include "esdlcmdutils.hpp"
 
 #include "esdlcmd_common.hpp"
@@ -82,7 +81,7 @@ esdlCmdOptionMatchIndicator EsdlCmdCommon::matchCommandLineOption(ArgvIterator &
     }
     if (iter.matchFlag(boolValue, ESDLOPT_VERSION))
     {
-        fprintf(stdout, "%s\n", BUILD_TAG);
+        fprintf(stdout, "%s\n", hpccBuildTag);
         return EsdlCmdOptionCompletion;
     }
 

+ 0 - 1
tools/esdlcmd/esdlcmd_core.cpp

@@ -19,7 +19,6 @@
 #include "jlog.hpp"
 #include "jfile.hpp"
 #include "jargv.hpp"
-#include "build-config.h"
 
 #include "esdlcmd_common.hpp"
 #include "esdlcmd_core.hpp"

+ 0 - 1
tools/esdlcmd/esdlcmd_monitor.cpp

@@ -19,7 +19,6 @@
 #include "jlog.hpp"
 #include "jfile.hpp"
 #include "jargv.hpp"
-#include "build-config.h"
 
 #include "esdlcmd_common.hpp"
 #include "esdlcmd_core.hpp"

+ 1 - 3
tools/esdlcmd/esdlcmd_shell.cpp

@@ -21,8 +21,6 @@
 #include "jargv.hpp"
 #include "jprop.hpp"
 
-#include "build-config.h"
-
 #include "esdlcmd.hpp"
 #include "esdlcmd_core.hpp"
 
@@ -157,7 +155,7 @@ bool EsdlCMDShell::parseCommandLineOptions(ArgvIterator &iter)
         }
         if (iter.matchFlag(boolValue, ESDLOPT_VERSION))
         {
-            fprintf(stdout, "%s\n", BUILD_TAG);
+            fprintf(stdout, "%s\n", hpccBuildTag);
             return false;
         }
         StringAttr tempArg;