Browse Source

HPCC-25627 Expose build/cmake definitions from 1 place

Avoid excessive recompilation when generated build-config.h
changes due to cmake definitions (e.g. versions) changing.

Signed-off-by: Jake Smith <jake.smith@lexisnexisrisk.com>
Jake Smith 4 years ago
parent
commit
532f7829dc
61 changed files with 252 additions and 211 deletions
  1. 4 3
      configuration/cli/envmod/envmod.cpp
  2. 1 2
      configuration/configmgr/configmgrlib/EnvironmentMgr.cpp
  3. 1 2
      dali/dfuplus/main.cpp
  4. 1 1
      dali/sasha/saserver.cpp
  5. 1 1
      dali/server/daserver.cpp
  6. 1 7
      deployment/configenv/xml_jlibpt/ComponentFromXSD.cpp
  7. 0 6
      deployment/configenv/xml_jlibpt/ComponentFromXSD.hpp
  8. 4 2
      deployment/configenv/xml_jlibpt/ConfigEnv.cpp
  9. 23 7
      deployment/configenv/xml_jlibpt/EnvHelper.cpp
  10. 0 5
      deployment/configenv/xml_jlibpt/EnvHelper.hpp
  11. 11 10
      deployment/configgen/main.cpp
  12. 1 2
      deployment/configutils/confighelper.cpp
  13. 0 1
      deployment/deployutils/configenvhelper.cpp
  14. 10 11
      deployment/deployutils/deployutils.cpp
  15. 1 4
      deployment/deployutils/wizardInputs.cpp
  16. 3 5
      deployment/envgen/main.cpp
  17. 1 1
      ecl/ecl-bundle/ecl-bundle.cpp
  18. 1 1
      ecl/ecl-package/ecl-package.cpp
  19. 3 3
      ecl/eclagent/eclagent.cpp
  20. 3 6
      ecl/eclcc/eclcc.cpp
  21. 1 3
      ecl/eclcmd/ecl.cpp
  22. 1 1
      ecl/eclcmd/eclcmd_common.cpp
  23. 2 6
      ecl/eclcmd/eclcmd_shell.cpp
  24. 1 3
      ecl/eclcmd/queries/ecl-queries.cpp
  25. 1 3
      ecl/eclcmd/roxie/ecl-roxie.cpp
  26. 4 4
      ecl/hql/hql.hpp
  27. 0 1
      ecl/hql/hqlerror.cpp
  28. 1 1
      ecl/hql/hqlexpr.cpp
  29. 1 1
      ecl/hqlcpp/hqlecl.cpp
  30. 1 1
      ecl/hqlcpp/hqlhtcpp.cpp
  31. 7 8
      esp/platform/application_config.cpp
  32. 2 3
      esp/platform/espp.cpp
  33. 26 26
      esp/services/WsDeploy/WsDeployService.cpp
  34. 1 2
      esp/services/WsDeploy/WsDeployService.hpp
  35. 1 2
      esp/services/esdl_svc_engine/esdl_binding.cpp
  36. 13 4
      esp/services/ws_configmgr/ws_configmgrService.cpp
  37. 1 1
      esp/services/ws_sql/ws_sqlService.cpp
  38. 0 2
      esp/services/ws_sql/ws_sqlService.hpp
  39. 0 2
      esp/services/ws_store/ws_storeService.hpp
  40. 3 4
      esp/services/ws_workunits/ws_workunitsService.cpp
  41. 1 1
      fs/dafilesrv/dafilesrv.cpp
  42. 1 2
      plugins/javaembed/javaembed.cpp
  43. 1 2
      plugins/kafka/kafka.cpp
  44. 2 3
      roxie/ccd/ccdmain.cpp
  45. 1 1
      roxie/ccd/ccdstate.cpp
  46. 41 4
      system/jlib/jutil.cpp
  47. 32 1
      system/jlib/jutil.hpp
  48. 11 7
      testing/unittests/configmgr/ConfigMgrHPCCTests.cpp
  49. 6 7
      testing/unittests/configmgr/ConfigMgrTemplateTests.cpp
  50. 2 3
      testing/unittests/configmgr/ConfigMgrUnitTests.cpp
  51. 1 1
      thorlcr/master/thgraphmanager.cpp
  52. 2 2
      thorlcr/master/thmastermain.cpp
  53. 3 3
      thorlcr/slave/thslavemain.cpp
  54. 1 1
      thorlcr/thorutil/thormisc.cpp
  55. 1 2
      tools/esdlcmd/esdl2ecl.cpp
  56. 1 4
      tools/esdlcmd/esdlcmd.cpp
  57. 1 1
      tools/esdlcmd/esdlcmd_common.cpp
  58. 4 4
      tools/esdlcmd/esdlcmd_core.cpp
  59. 1 1
      tools/esdlcmd/esdlcmd_monitor.cpp
  60. 1 1
      tools/esdlcmd/esdlcmd_shell.cpp
  61. 1 2
      tools/initldap/initldap.cpp

+ 4 - 3
configuration/cli/envmod/envmod.cpp

@@ -19,7 +19,6 @@
 #include <iostream>
 #include <string>
 #include <vector>
-#include "build-config.h"
 #include "platform.h"
 #include <exception>
 #include <sys/types.h>
@@ -49,9 +48,7 @@ std::vector<std::string> splitString(const std::string &input, const std::string
 EnvironmentType envType = XML;
 std::string masterSchemaFile = "environment.xsd";
 std::string configSchemaDir = "";
-std::string configSchemaRelativeDir = COMPONENTFILES_DIR PATHSEPSTR "configschema" PATHSEPSTR "xsd" PATHSEPSTR;
 std::string modTemplateFile;
-std::string modTemplateSchemaFile = COMPONENTFILES_DIR PATHSEPSTR "configschema" PATHSEPSTR "templates" PATHSEPSTR "schema" PATHSEPSTR "ModTemplateSchema.json";
 std::string configSchemaPluginsDir = "";
 std::string envFile, envOutputFile;
 struct InputDef {
@@ -115,9 +112,13 @@ void usage()
 
 int main(int argc, char *argv[])
 {
+    std::string configSchemaRelativeDir = std::string(hpccBuildInfo.componentDir) + PATHSEPSTR + "configschema" + PATHSEPSTR + "xsd" + PATHSEPSTR;
+    std::string modTemplateSchemaFile = std::string(hpccBuildInfo.componentDir) + PATHSEPSTR + "configschema" + PATHSEPSTR + "templates" + PATHSEPSTR + "schema" + PATHSEPSTR + "ModTemplateSchema.json";
+    
     //
     // Build the default directory for the schema files
     std::string processPath(queryCurrentProcessPath());
+
     configSchemaDir = processPath.substr(0, processPath.find_last_of(PATHSEPSTR)) + PATHSEPSTR + configSchemaRelativeDir;
 
     if (argc == 1)

+ 1 - 2
configuration/configmgr/configmgrlib/EnvironmentMgr.cpp

@@ -21,7 +21,6 @@
 #include "InsertableItem.hpp"
 #include "Utils.hpp"
 #include "jfile.hpp"
-#include "build-config.h"
 
 #ifndef WIN32
 #include <dlfcn.h>
@@ -74,7 +73,7 @@ bool EnvironmentMgr::loadSchema(const std::string &configPath, const std::string
         //
         // Load support libs based on the schema type which is read from the itemType property of the schema root node.
         std::string envType = m_pSchema->getItemType();
-        std::string libPath = LIB_DIR;
+        std::string libPath = hpccBuildInfo.libDir;
         std::string libMask = "libcfg" + envType + "_*";
         Owned<IFile> pDir = createIFile(libPath.c_str());
         if (pDir->exists())

+ 1 - 2
dali/dfuplus/main.cpp

@@ -16,14 +16,13 @@
 ############################################################################## */
 
 #pragma warning (disable : 4786)
-#include <build-config.h>
 #include "daftcfg.hpp"
 #include "dfuerror.hpp"
 #include "dfuplus.hpp"
 
 void printVersion()
 {
-    printf("DFU Version: %d %s\n", DAFT_VERSION, hpccBuildTag);
+    printf("DFU Version: %d %s\n", DAFT_VERSION, hpccBuildInfo.buildTag);
 }
 
 void handleSyntax()

+ 1 - 1
dali/sasha/saserver.cpp

@@ -368,7 +368,7 @@ int main(int argc, const char* argv[])
     #else
         setupContainerizedLogMsgHandler();
     #endif
-        DBGLOG("Build %s", hpccBuildTag);
+        DBGLOG("Build %s", hpccBuildInfo.buildTag);
 
         unsigned short port = serverConfig->getPropInt("@port");
         if (!port)

+ 1 - 1
dali/server/daserver.cpp

@@ -457,7 +457,7 @@ int main(int argc, const char* argv[])
 #else
         setupContainerizedLogMsgHandler();
 #endif
-        PROGLOG("Build %s", hpccBuildTag);
+        PROGLOG("Build %s", hpccBuildInfo.buildTag);
 
         StringBuffer dataPath;
         StringBuffer mirrorPath;

+ 1 - 7
deployment/configenv/xml_jlibpt/ComponentFromXSD.cpp

@@ -22,7 +22,6 @@
 //#include "xslprocessor.hpp"
 //#include "jwrapper.hpp"
 //#include "wizardInputs.hpp"
-#include "build-config.h"
 //#include "confighelper.hpp"
 #include "ComponentFromXSD.hpp"
 #include "EnvHelper.hpp"
@@ -32,11 +31,6 @@ namespace ech
 {
 #define TRACE_SCHEMA_NODE(msg, schemaNode)
 
-//#define CONFIGMGR_JSPATH "./"
-#define STANDARD_COMPFILESDIR INSTALL_DIR
-
-#define STANDARD_CONFIGXMLDIR COMPONENTFILES_DIR"/configxml"
-
 
 ComponentFromXSD::ComponentFromXSD(EnvHelper* peh):m_eh(peh), m_pCompTree(NULL),m_pDefTree(NULL),
   m_pSchemaRoot(NULL),m_numAttrs(0),m_allSubTypes(true),m_genOptional(true),m_wizFlag(true)
@@ -443,7 +437,7 @@ void ComponentFromXSD::getValueForTypeInXSD(IPropertyTree& attr,
       tempPath.clear().append("EnvSettings/path");
       wizDefVal.clear().append(m_pEnv->queryProp(tempPath.str()));
       if (!wizDefVal.length())
-        wizDefVal.append(STANDARD_COMPFILESDIR);
+        wizDefVal.append(hpccBuildInfo.installDir);
 
       wizDefVal.append(PATHSEPSTR"componentfiles");
     }

+ 0 - 6
deployment/configenv/xml_jlibpt/ComponentFromXSD.hpp

@@ -17,12 +17,6 @@
 #ifndef _COMPONENTFROMXSD_HPP_
 #define _COMPONENTFROMXSD_HPP_
 
-//#define TRACE_SCHEMA_NODE(msg, schemaNode)
-
-//#define CONFIGMGR_JSPATH "./"
-//#define STANDARD_COMPFILESDIR INSTALL_DIR
-
-//#define STANDARD_CONFIGXMLDIR COMPONENTFILES_DIR"/configxml"
 
 namespace ech
 {

+ 4 - 2
deployment/configenv/xml_jlibpt/ConfigEnv.cpp

@@ -19,15 +19,17 @@
 #include "ConfigEnv.hpp"
 #include "environment.hpp"
 #include "deployutils.hpp"
-#include "build-config.h"
 
 
 namespace ech
 {
 
+static std::string espConfigPath;
+
 ConfigEnv::ConfigEnv(IPropertyTree *config)
 {
    m_envHelper = new EnvHelper(config);
+   espConfigPath = std::string(hpccBuildInfo.configDir) + "/configmgr/esp.xml";
 }
 
 ConfigEnv::~ConfigEnv()
@@ -72,7 +74,7 @@ void ConfigEnv::create(IPropertyTree *params)
          espNodes=1, thorChannelsPerSlave=1, roxieChannelsPerSlave=1;
      bool roxieOnDemand = true;
      MapStringTo<StringAttr, const char *> dirMap;
-     Owned<IPropertyTree> pCfg = createPTreeFromXMLFile(ESP_CONFIG_PATH);
+     Owned<IPropertyTree> pCfg = createPTreeFromXMLFile(espConfigPath.c_str());
      StringArray arrAssignIPRanges;
      StringArray arrBuildSetWithAssignedIPs;
 

+ 23 - 7
deployment/configenv/xml_jlibpt/EnvHelper.cpp

@@ -15,7 +15,6 @@
     limitations under the License.
 ############################################################################## */
 
-#include "build-config.h"
 #include "EnvHelper.hpp"
 #include "Hardware.hpp"
 #include "Programs.hpp"
@@ -23,11 +22,16 @@
 #include "Software.hpp"
 #include "ComponentBase.hpp"
 #include "deployutils.hpp"
-#include "build-config.h"
 #include "confighelper.hpp"
 
 namespace ech
 {
+
+static std::string defaultEnvXml;
+static std::string defaultEnvOptions;
+static std::string defaultGenEnvRules;
+static std::string defaultBuildSet;
+
 EnvHelper::EnvHelper(IPropertyTree *config)
 {
    init(config);
@@ -100,7 +104,7 @@ void EnvHelper::init(IPropertyTree *config)
    if (optionsFileName && *optionsFileName)
       fileName.clear().append(optionsFileName);
    else
-      fileName.clear().append(DEFAULT_ENV_OPTIONS);
+      fileName.clear().append(defaultEnvOptions.c_str());
 
    m_envCfgOptions = new EnvConfigOptions(fileName.str());
 
@@ -108,7 +112,7 @@ void EnvHelper::init(IPropertyTree *config)
    if (genEnvRulesFileName && *genEnvRulesFileName)
       fileName.clear().append(genEnvRulesFileName);
    else
-      fileName.clear().append(DEFAULT_GEN_ENV_RULES);
+      fileName.clear().append(defaultGenEnvRules.c_str());
 
    m_genEnvRules = new GenEnvRules(fileName.str());
 
@@ -117,7 +121,7 @@ void EnvHelper::init(IPropertyTree *config)
    if (buildSetFileName && * buildSetFileName)
       fileName.clear().append(buildSetFileName);
    else
-      fileName.clear().append(DEFAULT_BUILDSET);
+      fileName.clear().append(defaultBuildSet.c_str());
    m_buildSetTree.setown(createPTreeFromXMLFile(fileName.str()));
 
    const char* envXmlFileName = m_config->queryProp("@env-in");
@@ -128,8 +132,11 @@ void EnvHelper::init(IPropertyTree *config)
       m_envTree.setown(createPTreeFromXMLString("<" XML_HEADER "><" XML_TAG_ENVIRONMENT "></" XML_TAG_ENVIRONMENT ">"));
 
       //Initialize CConfigHelper
-      const char* espConfigPath =  (m_config->hasProp("@esp-config"))?
-         m_config->queryProp("@esp-config") : ESP_CONFIG_PATH;
+      StringBuffer espConfigPath;
+      if (m_config->hasProp("@esp-config"))
+         m_config->getProp("@esp-config", espConfigPath);
+      else
+         espConfigPath.append(hpccBuildInfo.configDir).append("/configmgr/esp.xml");
       Owned<IPropertyTree> espCfg = createPTreeFromXMLFile(espConfigPath);
 
       const char* espServiceName =  (m_config->hasProp("@esp-service"))?
@@ -374,3 +381,12 @@ IPropertyTree * EnvHelper::clonePTree(IPropertyTree *src)
 }
 
 }
+
+MODULE_INIT(INIT_PRIORITY_STANDARD)
+{
+   ech::defaultEnvXml = std::string(hpccBuildInfo.configDir) + "/environment.xml";
+   ech::defaultEnvOptions = std::string(hpccBuildInfo.configDir) + "/environment.conf";
+   ech::defaultGenEnvRules = std::string(hpccBuildInfo.configDir) + "/genenvrules.conf";
+   ech::defaultBuildSet = std::string(hpccBuildInfo.componentDir) + "/configxml/buildset.xml";
+   return true;
+}

+ 0 - 5
deployment/configenv/xml_jlibpt/EnvHelper.hpp

@@ -42,11 +42,6 @@ interface IConfigComp : public IInterface
   virtual void remove(IPropertyTree *params) = 0;
 };
 
-#define DEFAULT_ENV_XML CONFIG_DIR"/environment.xml"
-#define DEFAULT_ENV_OPTIONS CONFIG_DIR"/environment.conf"
-#define DEFAULT_GEN_ENV_RULES CONFIG_DIR"/genenvrules.conf"
-#define DEFAULT_BUILDSET COMPONENTFILES_DIR"/configxml/buildset.xml"
-#define ESP_CONFIG_PATH INSTALL_DIR "" CONFIG_DIR "/configmgr/esp.xml"
 
 #define USE_WIZARD 1
 

+ 11 - 10
deployment/configgen/main.cpp

@@ -18,13 +18,12 @@
 #include "XMLTags.h"
 #include "configengcallback.hpp"
 #include "deploy.hpp"
-#include "build-config.h"
 #include "jutil.hpp"
 #include "jhash.ipp"
 #include "portlist.h"
 
-#define STANDARD_INDIR COMPONENTFILES_DIR"/configxml"
-#define STANDARD_OUTDIR RUNTIME_DIR
+
+static std::string configXmlDir;
 
 void usage()
 {
@@ -48,11 +47,11 @@ void usage()
   puts("          configgencomplist.xml. If not specified, the following ");
   puts("          defaults are used. ");
   puts("          For win32, 'c:\\trunk\\initfiles\\componentfiles\\configxml'");
-  puts("          For Linux, '" COMPONENTFILES_DIR "/configxml/'");
+  printf("          For Linux, '%s'", configXmlDir.c_str());
   puts("   -od <output directory>: The output directory for the generated files.");
   puts("          If not specified, the following defaults are used. ");
   puts("          For win32, '.'");
-  puts("          For Linux, '" CONFIG_DIR "'");
+  printf("          For Linux, '%s'", hpccBuildInfo.configDir);
   puts("   -ldapconfig : Generates a .ldaprc file and puts it in the specified");
   puts("          output directory. If output directory is not specified,");
   puts("          default output directory is used as mentioned in -od option");
@@ -731,12 +730,12 @@ int processRequest(const char* in_cfgname, const char* out_dirname, const char*
             {
                out.appendf("%s,%s,%s,%s,%s,%s%c%s,%s\n", processName.str(),
                  pComponent->queryProp("@name"), netAddr.str(),pInst->queryProp("@slaveport"), pInst->queryProp("@slavesPerNode"),
-                 STANDARD_OUTDIR, PATHSEPCHAR, pComponent->queryProp("@name"), pComponent->queryProp("@logDir"));
+                 hpccBuildInfo.runtimeDir, PATHSEPCHAR, pComponent->queryProp("@name"), pComponent->queryProp("@logDir"));
             }
             else
                out.appendf("%s,%s,%s,%s,%s%c%s,%s\n", processName.str(),
                  pComponent->queryProp("@name"), netAddr.str(), port.str(),
-                 STANDARD_OUTDIR, PATHSEPCHAR, pComponent->queryProp("@name"), pComponent->queryProp("@logDir"));
+                 hpccBuildInfo.runtimeDir, PATHSEPCHAR, pComponent->queryProp("@name"), pComponent->queryProp("@logDir"));
           }
         }
         else 
@@ -745,7 +744,7 @@ int processRequest(const char* in_cfgname, const char* out_dirname, const char*
           port.clear().append(pComponent->queryProp("@port"));
           out.appendf("%s,%s,%s,%s,%s%c%s,%s\n", pComponent->queryName(), 
             pComponent->queryProp("@name"), netAddr.str(), port.str(), 
-              STANDARD_OUTDIR, PATHSEPCHAR, pComponent->queryProp("@name"), pComponent->queryProp("@logDir"));
+              hpccBuildInfo.runtimeDir, PATHSEPCHAR, pComponent->queryProp("@name"), pComponent->queryProp("@logDir"));
         }
       }
     }
@@ -760,11 +759,13 @@ int main(int argc, char** argv)
 {
   InitModuleObjects();
 
+  configXmlDir = std::string(hpccBuildInfo.componentDir) + "/configxml";
+
   Owned<IProperties> globals = createProperties(true);
   const char* in_filename = NULL;
   const char* in_cfgname = NULL;
-  const char* out_dirname = STANDARD_OUTDIR;
-  const char* in_dirname = STANDARD_INDIR;
+  const char* out_dirname = hpccBuildInfo.runtimeDir;
+  const char* in_dirname = configXmlDir.c_str();
   const char* out_filename = NULL;
   const char* compName = NULL;
   const char* compType = NULL;

+ 1 - 2
deployment/configutils/confighelper.cpp

@@ -6,7 +6,6 @@
 #include "jptree.hpp"
 #include "XMLTags.h"
 #include "deploy.hpp"
-#include "build-config.h"
 #include "confighelper.hpp"
 
 #define STANDARD_CONFIG_BUILDSETFILE "buildset.xml"
@@ -62,7 +61,7 @@ CConfigHelper* CConfigHelper::getInstance(const IPropertyTree *cfg, const char*
 
             if (p_sConfigHelper->m_strConfigXMLDir.length() == 0)
             {
-              p_sConfigHelper->m_strConfigXMLDir = INSTALL_DIR;
+                p_sConfigHelper->m_strConfigXMLDir = hpccBuildInfo.installDir;
             }
 
             p_sConfigHelper->m_strBuildSetFileName = pParams->queryProp(TAG_BUILDSET);

+ 0 - 1
deployment/deployutils/configenvhelper.cpp

@@ -19,7 +19,6 @@
 #include "XMLTags.h"
 #include "configenvhelper.hpp"
 #include "deployutils.hpp"
-#include "build-config.h"
 #include "confighelper.hpp"
 
 bool CConfigEnvHelper::handleRoxieOperation(const char* cmd, const char* xmlStr)

+ 10 - 11
deployment/deployutils/deployutils.cpp

@@ -26,15 +26,11 @@
 #include "xslprocessor.hpp"
 #include "jwrapper.hpp"
 #include "wizardInputs.hpp"
-#include "build-config.h"
 #include "confighelper.hpp"
 
 #define TRACE_SCHEMA_NODE(msg, schemaNode)
 
 #define CONFIGMGR_JSPATH "./"
-#define STANDARD_COMPFILESDIR INSTALL_DIR
-
-#define STANDARD_CONFIGXMLDIR COMPONENTFILES_DIR"/configxml"
 
 bool schemaNodeHasAttributes(IPropertyTree* pNode)
 {
@@ -125,7 +121,7 @@ void getInstalledComponents(const char* pszInstallDir, StringBuffer& sbOutComps,
   if (pszInstallDir && *pszInstallDir)
     sbDir.append(pszInstallDir);
   else
-    sbDir.append(COMPONENTFILES_DIR"/configxml");
+    sbDir.append(hpccBuildInfo.componentDir).append("/configxml");
 
   bool getFromDirs = false;
   if (getFromDirs)
@@ -1575,7 +1571,7 @@ public:
              tempPath.clear().append("EnvSettings/path");
              wizDefVal.clear().append(m_pEnv->queryProp(tempPath.str()));
              if(!wizDefVal.length())
-                wizDefVal.append(STANDARD_COMPFILESDIR);
+                wizDefVal.append(hpccBuildInfo.installDir);
 
              wizDefVal.append(PATHSEPSTR"componentfiles");
            }
@@ -1909,7 +1905,7 @@ IPropertyTree* generateTreeFromXsd(const IPropertyTree* pEnv, IPropertyTree* pSc
       const char* cfgpath = pEnvParams->queryProp("configs");
 
       if (!cfgpath || !*cfgpath)
-        cfgpath = CONFIG_DIR;
+        cfgpath = hpccBuildInfo.configDir;
 
       genEnvConf.clear().append(cfgpath);
 
@@ -3367,7 +3363,7 @@ void addInstanceToCompTree(const IPropertyTree* pEnvRoot,const IPropertyTree* pI
         {
           StringBuffer rundir;
           if (!getConfigurationDirectory(pEnvRoot->queryPropTree("Software/Directories"), "run", processName, compName, rundir))
-            sb.clear().appendf(RUNTIME_DIR"/%s", compName);
+            sb.clear().append(hpccBuildInfo.runtimeDir).appendf("/%s", compName);
           else
             sb.clear().append(rundir);
 
@@ -3945,10 +3941,13 @@ bool validateEnv(IConstEnvironment* pConstEnv, bool abortOnException)
     CConfigEngCallback callback(false, abortOnException);
     Owned<IEnvDeploymentEngine> configGenMgr;
     Owned<IPropertyTree> pEnvRoot = &pConstEnv->getPTree();
+    StringBuffer sb;
     const char* inDir = pEnvRoot->queryProp(XML_TAG_ENVSETTINGS"/path");
-    StringBuffer sb(inDir);
-    sb.append("/componentfiles/configxml");
-    configGenMgr.setown(createConfigGenMgr(*pConstEnv, callback, NULL, inDir?sb.str():STANDARD_CONFIGXMLDIR, tempdir, NULL, NULL, NULL));
+    if (inDir)
+      sb.append("/componentfiles/configxml");
+    else
+      sb.append(hpccBuildInfo.componentDir).append("/configxml");
+    configGenMgr.setown(createConfigGenMgr(*pConstEnv, callback, NULL, sb.str(), tempdir, NULL, NULL, NULL));
     configGenMgr->deploy(DEFLAGS_CONFIGFILES, DEBACKUP_NONE, false, false);
     deleteRecursive(tempdir);
     const char* msg = callback.getErrorMsg();

+ 1 - 4
deployment/deployutils/wizardInputs.cpp

@@ -25,10 +25,7 @@
 #include "jencrypt.hpp"
 #include "buildset.hpp"
 #include "confighelper.hpp"
-#include "build-config.h"
 
-#define STANDARD_CONFIGXMLDIR COMPONENTFILES_DIR"/configxml/"
-#define STANDARD_CONFIG_DIR CONFIG_DIR
 
 CInstDetails::CInstDetails(const char * compName, const StringArray &ipAssigned) : m_compName(compName)
 {
@@ -175,7 +172,7 @@ void CWizardInputs::setEnvironment()
 
      m_buildSetTree.setown(pBuildSet);
      
-     fileName.clear().append((pEnvParams->queryProp("configs") != NULL ? (sb.clear().append(pEnvParams->queryProp("configs")).append("/")): STANDARD_CONFIG_DIR));
+     fileName.clear().append((pEnvParams->queryProp("configs") != NULL ? (sb.clear().append(pEnvParams->queryProp("configs")).append("/")): hpccBuildInfo.configDir));
      fileName.append((pParams->queryProp("wizardalgorithm") != NULL ? (sb.clear().append(pParams->queryProp("wizardalgorithm"))) : STANDARD_CONFIG_ALGORITHMFILE));
      
      if(fileName.length() && checkFileExists(fileName.str()))

+ 3 - 5
deployment/envgen/main.cpp

@@ -17,11 +17,7 @@
 #include "jliball.hpp"
 #include "XMLTags.h"
 #include "deployutils.hpp"
-#include "build-config.h"
 
-#define ENVGEN_PATH_TO_ESP_CONFIG INSTALL_DIR "" CONFIG_DIR "/configmgr/esp.xml"
-#define STANDARD_CONFIGXMLDIR COMPONENTFILES_DIR"/configxml/"
-#define STANDARD_CONFIG_BUILDSETFILE "buildset.xml"
 
 bool validateInteger(const char *str,int &out)
 {
@@ -320,7 +316,9 @@ int main(int argc, char** argv)
 
     StringBuffer optionsXml, envXml;
     const char* pServiceName = "WsDeploy_wsdeploy_esp";
-    Owned<IPropertyTree> pCfg = createPTreeFromXMLFile(ENVGEN_PATH_TO_ESP_CONFIG);
+    StringBuffer envGenPathToEspConfig(hpccBuildInfo.configDir);
+    envGenPathToEspConfig.append("/configmgr/esp.xml");
+    Owned<IPropertyTree> pCfg = createPTreeFromXMLFile(envGenPathToEspConfig);
 
     optionsXml.appendf("<XmlArgs supportNodes=\"%d\" roxieNodes=\"%d\" thorNodes=\"%d\" espNodes=\"%d\" slavesPerNode=\"%d\" thorChannelsPerSlave=\"%d\" roxieChannelsPerSlave=\"%d\" roxieOnDemand=\"%s\" ipList=\"%s\"/>", supportNodes, roxieNodes,
       thorNodes, espNodes, slavesPerNode, thorChannelsPerSlave, roxieChannelsPerSlave, roxieOnDemand?"true":"false", ipAddrs.str());

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

@@ -1837,7 +1837,7 @@ public:
 
 static int doMain(int argc, const char *argv[])
 {
-    BundleCMDShell processor(argc, argv, createBundleSubCommand, hpccBuildTag);
+    BundleCMDShell processor(argc, argv, createBundleSubCommand, hpccBuildInfo.buildTag);
     return processor.run();
 }
 

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

@@ -1642,7 +1642,7 @@ public:
 
 static int doMain(int argc, const char *argv[])
 {
-    PackageCMDShell processor(argc, argv, createPackageSubCommand, hpccBuildTag);
+    PackageCMDShell processor(argc, argv, createPackageSubCommand, hpccBuildInfo.buildTag);
     return processor.run();
 }
 

+ 3 - 3
ecl/eclagent/eclagent.cpp

@@ -1857,7 +1857,7 @@ void EclAgent::doProcess()
             LOG(MCrunlock, unknownJob, "Obtained workunit lock");
             if (w->hasDebugValue("traceLevel"))
                 traceLevel = w->getDebugValueInt("traceLevel", 10);
-            w->setTracingValue("EclAgentBuild", hpccBuildTag);
+            w->setTracingValue("EclAgentBuild", hpccBuildInfo.buildTag);
             if (agentTopology->hasProp("@name"))
                 w->addProcess("EclAgent", agentTopology->queryProp("@name"), GetCurrentProcessId(), 0, nullptr, false, logname.str());
 
@@ -3473,7 +3473,7 @@ extern int HTHOR_API eclagent_main(int argc, const char *argv[], StringBuffer *
     if (traceLevel)
     {
         printStart(argc, argv);
-        DBGLOG("Build %s", hpccBuildTag);
+        DBGLOG("Build %s", hpccBuildInfo.buildTag);
     }
 
     // Extract any params into stored - primarily for standalone case but handy for debugging eclagent sometimes too
@@ -3661,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", hpccBuildTag);
+        LOG(MCoperatorInfo, "hthor build %s", hpccBuildInfo.buildTag);
 
 #ifdef MONITOR_ECLAGENT_STATUS
         if (serverstatus)

+ 3 - 6
ecl/eclcc/eclcc.cpp

@@ -22,7 +22,6 @@
 #include "jargv.hpp"
 #include "junicode.hpp"
 
-#include "build-config.h"
 #include "workunit.hpp"
 #include "thorplugin.hpp"
 #ifndef _WIN32
@@ -75,9 +74,7 @@
 //#define TEST_LEGACY_DEPENDENCY_CODE
 
 #define INIFILE "eclcc.ini"
-#define SYSTEMCONFDIR CONFIG_DIR
 #define DEFAULTINIFILE "eclcc.ini"
-#define SYSTEMCONFFILE ENV_CONF_FILE
 #define DEFAULT_OUTPUTNAME  "a.out"
 
 //=========================================================================================
@@ -177,7 +174,7 @@ static bool getHomeFolder(StringBuffer & homepath)
 #ifndef WIN32
     homepath.append('.');
 #endif
-    homepath.append(DIR_NAME);
+    homepath.append(hpccBuildInfo.dirName);
     return true;
 }
 
@@ -637,7 +634,7 @@ void EclCC::loadOptions()
             optIniFilename.set(INIFILE);
         else
         {
-            StringBuffer fn(SYSTEMCONFDIR);
+            StringBuffer fn(hpccBuildInfo.configDir);
             fn.append(PATHSEPSTR).append(DEFAULTINIFILE);
             if (checkFileExists(fn))
                 optIniFilename.set(fn);
@@ -2869,7 +2866,7 @@ int EclCC::parseCommandLineOptions(int argc, const char* argv[])
         }
         else if (strcmp(arg, "--version")==0)
         {
-            fprintf(stdout,"%s %s\n", LANGUAGE_VERSION, hpccBuildTag);
+            fprintf(stdout,"%s %s\n", LANGUAGE_VERSION, hpccBuildInfo.buildTag);
             return 1;
         }
         else if (startsWith(arg, "-Wc,"))

+ 1 - 3
ecl/eclcmd/ecl.cpp

@@ -26,16 +26,14 @@
 #include "eclcmd_core.hpp"
 
 #define INIFILE "ecl.ini"
-#define SYSTEMCONFDIR CONFIG_DIR
 #define DEFAULTINIFILE "ecl.ini"
-#define SYSTEMCONFFILE ENV_CONF_FILE
 
 
 //=========================================================================================
 
 static int doMain(int argc, const char *argv[])
 {
-    EclCMDShell processor(argc, argv, createCoreEclCommand, hpccBuildTag, true);
+    EclCMDShell processor(argc, argv, createCoreEclCommand, hpccBuildInfo.buildTag, true);
     return processor.run();
 }
 

+ 1 - 1
ecl/eclcmd/eclcmd_common.cpp

@@ -331,7 +331,7 @@ eclCmdOptionMatchIndicator EclCmdCommon::matchCommandLineOption(ArgvIterator &it
     }
     if (iter.matchFlag(boolValue, ECLOPT_VERSION))
     {
-        fprintf(stdout, "%s\n", hpccBuildTag);
+        fprintf(stdout, "%s\n", hpccBuildInfo.buildTag);
         return EclCmdOptionCompletion;
     }
     if (iter.matchOption(optServer, ECLOPT_SERVER)||iter.matchOption(optServer, ECLOPT_SERVER_S))

+ 2 - 6
ecl/eclcmd/eclcmd_shell.cpp

@@ -20,15 +20,11 @@
 #include "jargv.hpp"
 #include "jprop.hpp"
 
-#include "build-config.h"
-
 #include "eclcmd.hpp"
 #include "eclcmd_core.hpp"
 
 #define INIFILE "ecl.ini"
-#define SYSTEMCONFDIR CONFIG_DIR
 #define DEFAULTINIFILE "ecl.ini"
-#define SYSTEMCONFFILE ENV_CONF_FILE
 
 //=========================================================================================
 
@@ -134,7 +130,7 @@ int EclCMDShell::run()
                 optIniFilename.set(INIFILE);
             else if (getHomeDir(fn) && checkFileExists(addPathSepChar(fn).append(INIFILE)))
                 optIniFilename.set(fn);
-            else if (fn.set(SYSTEMCONFDIR).append(PATHSEPSTR).append(DEFAULTINIFILE))
+            else if (fn.set(hpccBuildInfo.configDir).append(PATHSEPSTR).append(DEFAULTINIFILE))
                 optIniFilename.set(fn);
         }
 
@@ -184,7 +180,7 @@ bool EclCMDShell::parseCommandLineOptions(ArgvIterator &iter)
         }
         if (iter.matchFlag(boolValue, "--version"))
         {
-            fprintf(stdout, "%s\n", hpccBuildTag);
+            fprintf(stdout, "%s\n", hpccBuildInfo.buildTag);
             return false;
         }
         StringAttr tempArg;

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

@@ -28,9 +28,7 @@
 #include "workunit.hpp"
 
 #define INIFILE "ecl.ini"
-#define SYSTEMCONFDIR CONFIG_DIR
 #define DEFAULTINIFILE "ecl.ini"
-#define SYSTEMCONFFILE ENV_CONF_FILE
 
 //=========================================================================================
 
@@ -1583,7 +1581,7 @@ public:
 
 static int doMain(int argc, const char *argv[])
 {
-    EclQueriesCMDShell processor(argc, argv, createEclQueriesCommand, hpccBuildTag);
+    EclQueriesCMDShell processor(argc, argv, createEclQueriesCommand, hpccBuildInfo.buildTag);
     return processor.run();
 }
 

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

@@ -29,9 +29,7 @@
 #include "ws_dfu.hpp"
 
 #define INIFILE "ecl.ini"
-#define SYSTEMCONFDIR CONFIG_DIR
 #define DEFAULTINIFILE "ecl.ini"
-#define SYSTEMCONFFILE ENV_CONF_FILE
 
 //=========================================================================================
 
@@ -563,7 +561,7 @@ public:
 
 static int doMain(int argc, const char *argv[])
 {
-    EclRoxieCMDShell processor(argc, argv, createEclRoxieCommand, hpccBuildTag);
+    EclRoxieCMDShell processor(argc, argv, createEclRoxieCommand, hpccBuildInfo.buildTag);
     return processor.run();
 }
 

+ 4 - 4
ecl/hql/hql.hpp

@@ -49,11 +49,11 @@ Relevant changes include
 
 */
 
-#define LANGUAGE_VERSION_MAJOR      BUILD_VERSION_MAJOR
-#define LANGUAGE_VERSION_MINOR      BUILD_VERSION_MINOR
-#define LANGUAGE_VERSION_SUB        BUILD_VERSION_POINT
+#define LANGUAGE_VERSION_MAJOR      hpccBuildInfo.buildVersionMajor
+#define LANGUAGE_VERSION_MINOR      hpccBuildInfo.buildVersionMinor
+#define LANGUAGE_VERSION_SUB        hpccBuildInfo.buildVersionPoint
 
-#define LANGUAGE_VERSION   estringify(LANGUAGE_VERSION_MAJOR) "." estringify(LANGUAGE_VERSION_MINOR) "." estringify(LANGUAGE_VERSION_SUB)
+#define LANGUAGE_VERSION  hpccBuildInfo.buildVersion
 
 
 #define DEFAULT_INT_SIZE 8

+ 0 - 1
ecl/hql/hqlerror.cpp

@@ -16,7 +16,6 @@
 ############################################################################## */
 
 #include "jlog.hpp"
-#include "build-config.h"
 
 #include "hqlerror.hpp"
 #include "hqlerrors.hpp"

+ 1 - 1
ecl/hql/hqlexpr.cpp

@@ -1298,7 +1298,7 @@ void HqlParseContext::getCacheBaseFilename(StringBuffer & fullName, StringBuffer
 extern HQL_API IPropertyTree * createAttributeArchive()
 {
     Owned<IPropertyTree> archive = createPTree("Archive");
-    archive->setProp("@build", hpccBuildTag);
+    archive->setProp("@build", hpccBuildInfo.buildTag);
     archive->setProp("@eclVersion", LANGUAGE_VERSION);
     return archive.getClear();
 }

+ 1 - 1
ecl/hqlcpp/hqlecl.cpp

@@ -846,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(hpccBuildTag, strlen(hpccBuildTag), ACTIVITY_INTERFACE_VERSION);
+    unsigned cacheCRC = crc32(hpccBuildInfo.buildTag, strlen(hpccBuildInfo.buildTag), ACTIVITY_INTERFACE_VERSION);
     cacheCRC += getExpressionCRC(expr);
 #ifdef _WIN32
     cacheCRC++; // make sure CRC is different in windows/linux

+ 1 - 1
ecl/hqlcpp/hqlhtcpp.cpp

@@ -6066,7 +6066,7 @@ bool HqlCppTranslator::buildCpp(IHqlCppInstance & _code, HqlQueryContext & query
 
     try
     {
-        wu()->setCodeVersion(ACTIVITY_INTERFACE_VERSION,hpccBuildTag,LANGUAGE_VERSION);
+        wu()->setCodeVersion(ACTIVITY_INTERFACE_VERSION,hpccBuildInfo.buildTag,LANGUAGE_VERSION);
         cacheOptions();
 
         if (options.obfuscateOutput)

+ 7 - 8
esp/platform/application_config.cpp

@@ -27,7 +27,6 @@
 #include "espcfg.ipp"
 #include "esplog.hpp"
 #include "espcontext.hpp"
-#include "build-config.h"
 
 enum class LdapType { LegacyAD, AzureAD };
 
@@ -45,9 +44,9 @@ IPropertyTree *loadApplicationConfig(const char *application, const char* argv[]
     Owned<IPropertyTree> applicationConfig = createPTree(application);
     IPropertyTree *defaultConfig = applicationConfig->addPropTree("esp");
 
-    char sepchar = getPathSepChar(COMPONENTFILES_DIR);
+    char sepchar = getPathSepChar(hpccBuildInfo.componentDir);
 
-    StringBuffer path(COMPONENTFILES_DIR);
+    StringBuffer path(hpccBuildInfo.componentDir);
     addPathSepChar(path, sepchar).append("applications").append(sepchar).append("common").append(sepchar);
     if (checkDirExists(path))
     {
@@ -56,7 +55,7 @@ IPropertyTree *loadApplicationConfig(const char *application, const char* argv[]
             appendPTreeFromYamlFile(defaultConfig, common_dir->query().queryFilename(), true);
     }
 
-    path.set(COMPONENTFILES_DIR);
+    path.set(hpccBuildInfo.componentDir);
     addPathSepChar(path, sepchar).append("applications").append(sepchar).append(application).append(sepchar);
     if (!checkDirExists(path))
         throw MakeStringException(-1, "Can't find esp application %s (dir %s)", application, path.str());
@@ -96,8 +95,8 @@ bool addLdapSecurity(IPropertyTree *legacyEsp, IPropertyTree *appEsp, StringBuff
     if (isEmptyString(ldapAddress))
         throw MakeStringException(-1, "LDAP not configured.  To run without security set auth=none");
 
-    StringBuffer path(COMPONENTFILES_DIR);
-    char sepchar = getPathSepChar(COMPONENTFILES_DIR);
+    StringBuffer path(hpccBuildInfo.componentDir);
+    char sepchar = getPathSepChar(hpccBuildInfo.componentDir);
     addPathSepChar(path, sepchar).append("applications").append(sepchar).append("common").append(sepchar).append("ldap").append(sepchar);
     if (ldapType == LdapType::LegacyAD)
         path.append("ldap.yaml");
@@ -364,11 +363,11 @@ IPropertyTree *buildApplicationLegacyConfig(const char *application, const char*
     if (!legacyEsp->hasProp("@directory"))
     {
         const char *componentName = legacyEsp->queryProp("@name");
-        VStringBuffer s("%s/%s", RUNTIME_DIR, isEmptyString(componentName) ? application : componentName);
+        VStringBuffer s("%s/%s", hpccBuildInfo.runtimeDir, isEmptyString(componentName) ? application : componentName);
         legacyEsp->setProp("@directory", s.str());
     }
     if (!legacyEsp->hasProp("@componentfilesDir"))
-        legacyEsp->setProp("@componentfilesDir", COMPONENTFILES_DIR);
+        legacyEsp->setProp("@componentfilesDir", hpccBuildInfo.componentDir);
 
     bool tls = addProtocol(legacyEsp, appEspConfig);
 

+ 2 - 3
esp/platform/espp.cpp

@@ -44,7 +44,6 @@
 #include "espcfg.ipp"
 #include "esplog.hpp"
 #include "espcontext.hpp"
-#include "build-config.h"
 #include "rmtfile.hpp"
 #include "dafdesc.hpp"
 
@@ -479,7 +478,7 @@ int init_main(int argc, const char* argv[])
         procpt->setProp("@daliServers", queryComponentConfig().queryProp("@daliServers"));
 #endif
 
-        const char* build_ver = hpccBuildTag;
+        const char* build_ver = hpccBuildInfo.buildTag;
         setBuildVersion(build_ver);
 
         const char * processName = procpt->queryProp("@name");
@@ -487,7 +486,7 @@ int init_main(int argc, const char* argv[])
 
         openEspLogFile(envpt.get(), procpt.get());
 
-        DBGLOG("Esp starting %s", hpccBuildTag);
+        DBGLOG("Esp starting %s", hpccBuildInfo.buildTag);
 
         StringBuffer componentfilesDir;
         if(procpt->hasProp("@componentfilesDir"))

+ 26 - 26
esp/services/WsDeploy/WsDeployService.cpp

@@ -30,27 +30,13 @@
 #define strlwr _strlwr
 #endif
 
-#define STANDARD_CONFIG_BACKUPDIR CONFIG_DIR"/backup"
-#define STANDARD_CONFIG_SOURCEDIR CONFIG_DIR
-#define STANDARD_CONFIG_STAGED_PATH CONFIG_DIR "/" ENV_XML_FILE
-
-#define DEFAULT_DIRECTORIES "<Directories name=\"" DIR_NAME "\">\
-      <Category dir=\"" EXEC_PREFIX "/log/[NAME]/[INST]\" name=\"log\"/>\
-      <Category dir=\"" EXEC_PREFIX "/lib/[NAME]/[INST]\" name=\"run\"/>\
-      <Category dir=\"" CONFIG_PREFIX "/[NAME]/[INST]\" name=\"conf\"/>\
-      <Category dir=\"" EXEC_PREFIX "/lib/[NAME]/[INST]/temp\" name=\"temp\"/> \
-      <Category dir=\"" EXEC_PREFIX "/lib/[NAME]/hpcc-data/[COMPONENT]\" name=\"data\"/> \
-      <Category dir=\"" EXEC_PREFIX "/lib/[NAME]/hpcc-data2/[COMPONENT]\" name=\"data2\"/> \
-      <Category dir=\"" EXEC_PREFIX "/lib/[NAME]/hpcc-data3/[COMPONENT]\" name=\"data3\"/> \
-      <Category dir=\"" EXEC_PREFIX "/lib/[NAME]/hpcc-mirror/[COMPONENT]\" name=\"mirror\"/> \
-      <Category dir=\"" EXEC_PREFIX "/lib/[NAME]/queries/[INST]\" name=\"query\"/> \
-      <Category dir=\"" EXEC_PREFIX "/lock/[NAME]/[INST]\" name=\"lock\"/> \
-      </Directories>"
 #include <vector>
 
 using namespace std;
 typedef vector<IPropertyTree*> IPropertyTreePtrArray;
 
+static std::string defaultDirectories;
+
 bool CCloudTaskThread::s_abort = false;
 
 bool supportedInEEOnly()
@@ -232,6 +218,19 @@ void CWsDeployFileInfo::activeUserNotResponding()
 
 void CWsDeployExCE::init(IPropertyTree *cfg, const char *process, const char *service)
 {
+  defaultDirectories = "<Directories name=\"" + std::string(hpccBuildInfo.dirName) + "\"> \
+      <Category dir=\"" + std::string(hpccBuildInfo.execPrefix) + "/log/[NAME]/[INST]\" name=\"log\"/> \
+      <Category dir=\"" + std::string(hpccBuildInfo.execPrefix) + "/lib/[NAME]/[INST]\" name=\"run\"/> \
+      <Category dir=\"" + std::string(hpccBuildInfo.configPrefix) + "/[NAME]/[INST]\" name=\"conf\"/> \
+      <Category dir=\"" + std::string(hpccBuildInfo.execPrefix) + "/lib/[NAME]/[INST]/temp\" name=\"temp\"/> \
+      <Category dir=\"" + std::string(hpccBuildInfo.execPrefix) + "/lib/[NAME]/hpcc-data/[COMPONENT]\" name=\"data\"/> \
+      <Category dir=\"" + std::string(hpccBuildInfo.execPrefix) + "/lib/[NAME]/hpcc-data2/[COMPONENT]\" name=\"data2\"/> \
+      <Category dir=\"" + std::string(hpccBuildInfo.execPrefix) + "/lib/[NAME]/hpcc-data3/[COMPONENT]\" name=\"data3\"/> \
+      <Category dir=\"" + std::string(hpccBuildInfo.execPrefix) + "/lib/[NAME]/hpcc-mirror/[COMPONENT]\" name=\"mirror\"/> \
+      <Category dir=\"" + std::string(hpccBuildInfo.execPrefix) + "/lib/[NAME]/queries/[INST]\" name=\"query\"/> \
+      <Category dir=\"" + std::string(hpccBuildInfo.execPrefix) + "/lock/[NAME]/[INST]\" name=\"lock\"/> \
+      </Directories>";
+
   if (m_lastStarted.isNull())
     m_lastStarted.setNow();
 
@@ -259,16 +258,16 @@ void CWsDeployExCE::init(IPropertyTree *cfg, const char *process, const char *se
     Owned<IProperties> pParams = createProperties(tmp);
     m_sourceDir.clear().append(pParams->queryProp("sourcedir"));
     if (!m_sourceDir.length())
-      m_sourceDir.clear().append(STANDARD_CONFIG_SOURCEDIR);
+      m_sourceDir.clear().append(hpccBuildInfo.configDir);
 
     m_backupDir.clear().append(m_sourceDir).append(PATHSEPSTR"backup");
   }
 
   if (m_backupDir.length() == 0)
-    m_backupDir.clear().append(STANDARD_CONFIG_BACKUPDIR);
+    m_backupDir.clear().append(hpccBuildInfo.configDir).append("/backup");
 
   if (!m_sourceDir.length())
-    m_sourceDir.clear().append(STANDARD_CONFIG_SOURCEDIR);
+    m_sourceDir.clear().append(hpccBuildInfo.configDir);
 
   xpath.clear().appendf("Software/EspProcess/EspService[@name='%s']/LocalEnvFile", service);
   const char* pEnvFile = cfg->queryProp(xpath.str());
@@ -1378,7 +1377,7 @@ bool CWsDeployFileInfo::saveSetting(IEspContext &context, IEspSaveSettingRequest
             StringBuffer rundir;
 
             if (!getConfigurationDirectory(pEnvRoot->queryPropTree("Software/Directories"), "run", pszCompType, pszNewValue, rundir))
-              rundir.clear().appendf(RUNTIME_DIR"/%s", pszNewValue);
+              rundir.clear().append(hpccBuildInfo.runtimeDir).appendf("/%s", pszNewValue);
 
             Owned<IPropertyTreeIterator> iterInsts = pComp->getElements(XML_TAG_INSTANCE);
 
@@ -1485,7 +1484,7 @@ bool CWsDeployFileInfo::saveSetting(IEspContext &context, IEspSaveSettingRequest
               StringBuffer sb;
               StringBuffer rundir;
               if (!getConfigurationDirectory(pEnvRoot->queryPropTree("Software/Directories"), "run", pszCompType, pszCompName, rundir))
-                sb.clear().appendf(RUNTIME_DIR"/%s", pszCompName);
+                sb.clear().append(hpccBuildInfo.runtimeDir).appendf("/%s", pszCompName);
               else
                 sb.clear().append(rundir);
 
@@ -4405,7 +4404,7 @@ bool CWsDeployFileInfo::handleInstance(IEspContext &context, IEspHandleInstanceR
           {
             StringBuffer rundir;
             if (!getConfigurationDirectory(pEnvRoot->queryPropTree("Software/Directories"),"run",buildSet,compName,rundir))
-              sb.clear().appendf(RUNTIME_DIR"/%s", compName);
+              sb.clear().append(hpccBuildInfo.runtimeDir).appendf("/%s", compName);
             else
               sb.clear().append(rundir);
 
@@ -5613,7 +5612,7 @@ const char* CWsDeployFileInfo::GetDisplayProcessName(const char* processName, ch
 
 void CWsDeployFileInfo::setFilePath(StringBuffer &filePath, const char* targetName)
 {
-  filePath.clear().append(CONFIG_SOURCE_DIR);
+  filePath.clear().append(hpccBuildInfo.configSourceDir);
 
   if (filePath.charAt(filePath.length() - 1) != PATHSEPCHAR)
     filePath.append(PATHSEPCHAR);
@@ -6344,7 +6343,7 @@ void CWsDeployFileInfo::initFileInfo(bool createOrOverwrite, bool bClearEnv)
     if(!pNewTree->queryPropTree(XML_TAG_SOFTWARE))
     {
       pNewTree->addPropTree(XML_TAG_SOFTWARE, createPTree());
-      pNewTree->addPropTree("./Software/Directories", createPTreeFromXMLString(DEFAULT_DIRECTORIES));
+      pNewTree->addPropTree("./Software/Directories", createPTreeFromXMLString(defaultDirectories.c_str()));
     }
     pNewTree->addPropTree(XML_TAG_HARDWARE, createPTree());
 
@@ -6698,7 +6697,8 @@ bool CWsDeployExCE::onGetValue(IEspContext &context, IEspGetValueRequest &req, I
     Owned<IFile> pDir = createIFile(getSourceDir());
 
     StringBuffer activeConfig_md5sum, config_md5sum;
-    md5_filesum(STANDARD_CONFIG_STAGED_PATH, activeConfig_md5sum);
+    std::string standardConfigStagedPath = std::string(hpccBuildInfo.configDir) + "/" + hpccBuildInfo.envXmlFile;
+    md5_filesum(standardConfigStagedPath.c_str(), activeConfig_md5sum);
 
     if (pDir->exists())
     {
@@ -7319,7 +7319,7 @@ bool CWsDeployFileInfo::checkForRequiredComponents(IPropertyTree* pEnvRoot, cons
       const char* cfgpath = pEnvParams->queryProp("configs");
 
       if (!cfgpath || !*cfgpath)
-        cfgpath = CONFIG_DIR;
+        cfgpath = hpccBuildInfo.configDir;
 
       genEnvConf.clear().append(cfgpath);
 

+ 1 - 2
esp/services/WsDeploy/WsDeployService.hpp

@@ -28,7 +28,6 @@
 #include "XMLTags.h"
 #include "httpclient.hpp"
 #include "jqueue.tpp"
-#include "build-config.h"
 
 typedef enum EnvAction_
 {
@@ -240,7 +239,7 @@ private:
 
       virtual void threadmain() override
       {
-        Owned<IFile> configFiles = createIFile(CONFIG_SOURCE_DIR);
+        Owned<IFile> configFiles = createIFile(hpccBuildInfo.configSourceDir);
 
         while ( m_quitThread == false )
         {

+ 1 - 2
esp/services/esdl_svc_engine/esdl_binding.cpp

@@ -35,7 +35,6 @@
 #include "thorxmlwrite.hpp" //JSON WRITER
 #include "workunit.hpp"
 #include "wuwebview.hpp"
-#include "build-config.h"
 #include "jsmartsock.ipp"
 #include "esdl_monitor.hpp"
 #include "EsdlAccessMapGenerator.hpp"
@@ -599,7 +598,7 @@ void EsdlServiceImpl::configureTargets(IPropertyTree *cfg, const char *service)
         if (envConf.hasProp("classpath"))
             envConf.getProp("classpath", classPath);
         else
-            classPath.append(INSTALL_DIR).append(PATHSEPCHAR).append("classes");
+            classPath.append(hpccBuildInfo.installDir).append(PATHSEPCHAR).append("classes");
 
         MapStringToMyClass<IEspPlugin> localCppPluginMap;
 

+ 13 - 4
esp/services/ws_configmgr/ws_configmgrService.cpp

@@ -25,10 +25,19 @@
 #include "Exceptions.hpp"
 
 static const std::string CFGMGR_MASTER_CONFIG_FILE = "environment.xsd";
-static const std::string CFGMGR_CONFIG_DIR = COMPONENTFILES_DIR PATHSEPSTR "configschema" PATHSEPSTR "xsd" PATHSEPSTR;
-static const std::string CFGMGR_PLUGINS_DIR = COMPONENTFILES_DIR PATHSEPSTR "configschema" PATHSEPSTR "xsd" PATHSEPSTR "plugins" PATHSEPSTR;
-static const std::string CFGMGR_SOURCE_DIR = CONFIG_SOURCE_DIR;
-static const std::string ACTIVE_ENVIRONMENT_FILE = CONFIG_DIR PATHSEPSTR ENV_XML_FILE;
+static const std::string CFGMGR_CONFIG_DIR;
+static const std::string CFGMGR_PLUGINS_DIR;
+static const std::string CFGMGR_SOURCE_DIR;
+static const std::string ACTIVE_ENVIRONMENT_FILE;
+
+MODULE_INIT(INIT_PRIORITY_STANDARD)
+{
+   CFGMGR_CONFIG_DIR = std::string(hpccBuildInfo.componentDir) + PATHSEPSTR + "configschema" + PATHSEPSTR + "xsd" + PATHSEPSTR;
+   CFGMGR_PLUGINS_DIR = CFGMGR_CONFIG_DIR + "plugins" PATHSEPSTR;
+   CFGMGR_SOURCE_DIR = std::string(hpccBuildInfo.configSourceDir);
+   ACTIVE_ENVIRONMENT_FILE = std::string(hpccBuildInfo.configDir) + PATHSEPSTR + hpccBuildInfo.envXmlFile;
+   return true;
+}
 
 Cws_configMgrEx::Cws_configMgrEx()
 {

+ 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(hpccBuildTag);
+    setWsSqlBuildVersion(hpccBuildInfo.buildTag);
 }
 
 bool CwssqlEx::onEcho(IEspContext &context, IEspEchoRequest &req, IEspEchoResponse &resp)

+ 0 - 2
esp/services/ws_sql/ws_sqlService.hpp

@@ -18,8 +18,6 @@ limitations under the License.
 #ifndef _ESPWIZ_WS_SQL_HPP__
 #define _ESPWIZ_WS_SQL_HPP__
 
-#include <build-config.h>
-
 #include "ws_sql.hpp"
 #include "ws_sql_esp.ipp"
 

+ 0 - 2
esp/services/ws_store/ws_storeService.hpp

@@ -18,8 +18,6 @@ limitations under the License.
 #ifndef _ESPWIZ_WS_STORE_HPP__
 #define _ESPWIZ_WS_STORE_HPP__
 
-#include <build-config.h>
-
 #include "ws_store.hpp"
 #include "ws_store_esp.ipp"
 

+ 3 - 4
esp/services/ws_workunits/ws_workunitsService.cpp

@@ -53,7 +53,6 @@
 #include "rtlformat.hpp"
 
 #include "package.h"
-#include "build-config.h"
 
 #ifdef _USE_ZLIB
 #include "zcrypt.hpp"
@@ -4973,9 +4972,9 @@ bool CWsWorkunitsEx::onWUGetZAPInfo(IEspContext &context, IEspWUGetZAPInfoReques
 
 bool CWsWorkunitsEx::onWUCheckFeatures(IEspContext &context, IEspWUCheckFeaturesRequest &req, IEspWUCheckFeaturesResponse &resp)
 {
-    resp.setBuildVersionMajor(BUILD_VERSION_MAJOR);
-    resp.setBuildVersionMinor(BUILD_VERSION_MINOR);
-    resp.setBuildVersionPoint(BUILD_VERSION_POINT);
+    resp.setBuildVersionMajor(hpccBuildInfo.buildVersionMajor);
+    resp.setBuildVersionMinor(hpccBuildInfo.buildVersionMinor);
+    resp.setBuildVersionPoint(hpccBuildInfo.buildVersionPoint);
     resp.setMaxRequestEntityLength(maxRequestEntityLength);
     resp.updateDeployment().setUseCompression(true);
     return true;

+ 1 - 1
fs/dafilesrv/dafilesrv.cpp

@@ -799,7 +799,7 @@ int main(int argc,char **argv)
 #endif
 
     write_pidfile(componentName.str());
-    PROGLOG("Dafilesrv starting - Build %s", hpccBuildTag);
+    PROGLOG("Dafilesrv starting - Build %s", hpccBuildInfo.buildTag);
     PROGLOG("Parallel request limit = %d, throttleDelayMs = %d, throttleCPULimit = %d", parallelRequestLimit, throttleDelayMs, throttleCPULimit);
 
     const char * verstring = remoteServerVersionString();

+ 1 - 2
plugins/javaembed/javaembed.cpp

@@ -28,7 +28,6 @@
 #include "rtlfield.hpp"
 #include "rtlds_imp.hpp"
 #include "jprop.hpp"
-#include "build-config.h"
 #include "roxiemem.hpp"
 #include "nbcd.hpp"
 #include "rtlformat.hpp"
@@ -907,7 +906,7 @@ static StringBuffer &appendClassPath(StringBuffer &classPath)
     }
     else
     {
-        classPath.append(INSTALL_DIR).append(PATHSEPCHAR).append("classes").append(ENVSEPCHAR);
+        classPath.append(hpccBuildInfo.installDir).append(PATHSEPCHAR).append("classes").append(ENVSEPCHAR);
     }
     return classPath;
 }

+ 1 - 2
plugins/kafka/kafka.cpp

@@ -22,7 +22,6 @@
 #include "jmutex.hpp"
 #include "jprop.hpp"
 #include "jfile.hpp"
-#include "build-config.h"
 
 #include "librdkafka/rdkafka.h"
 
@@ -78,7 +77,7 @@ namespace KafkaPlugin
             std::string errStr;
             StringBuffer fullConfigPath;
 
-            fullConfigPath.append(CONFIG_DIR).append(PATHSEPSTR).append(configFilePath);
+            fullConfigPath.append(hpccBuildInfo.configDir).append(PATHSEPSTR).append(configFilePath);
 
             Owned<IProperties> properties = createProperties(fullConfigPath.str(), true);
             Owned<IPropertyIterator> props = properties->getIterator();

+ 2 - 3
roxie/ccd/ccdmain.cpp

@@ -29,7 +29,6 @@
 #include <jencrypt.hpp>
 #include "jutil.hpp"
 #include "jsecrets.hpp"
-#include <build-config.h>
 #include <udptopo.hpp>
 
 #include "rtlformat.hpp"
@@ -857,14 +856,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(), hpccBuildTag);
+                DBGLOG("Roxie restarting: restarts = %d build = %s", restarts.load(), hpccBuildInfo.buildTag);
             setStartRuid(restarts);
         }
         else
         {
             if (traceLevel)
             {
-                DBGLOG("Roxie starting, build = %s", hpccBuildTag);
+                DBGLOG("Roxie starting, build = %s", hpccBuildInfo.buildTag);
             }
         }
 

+ 1 - 1
roxie/ccd/ccdstate.cpp

@@ -2343,7 +2343,7 @@ private:
             }
             else if (stricmp(queryName, "control:getBuildVersion")==0)
             {
-                reply.appendf("<version id='%s'/>", hpccBuildTag);
+                reply.appendf("<version id='%s'/>", hpccBuildInfo.buildTag);
             }
             else
                 unknown = true;

+ 41 - 4
system/jlib/jutil.cpp

@@ -68,7 +68,45 @@ static CriticalSection * protectedGeneratorCs;
 mach_timebase_info_data_t timebase_info  = { 1,1 };
 #endif
 
-const char *hpccBuildTag = nullptr;
+HPCCBuildInfo hpccBuildInfo;
+
+#define stringify(x) # x
+#define estringify(x) stringify(x)
+
+static void initBuildVars()
+{
+    /* NB: picking up HPCC_BUILD_TAG from an environment variable is mainly so variants (like internal)
+     * can customize the buildtag, which is shown in Eclwatch and logging.
+     */
+    hpccBuildInfo.buildTag = getenv("HPCC_BUILD_TAG");
+    if (isEmptyString(hpccBuildInfo.buildTag))
+        hpccBuildInfo.buildTag = BUILD_TAG;
+
+    hpccBuildInfo.buildVersionMajor = BUILD_VERSION_MAJOR;
+    hpccBuildInfo.buildVersionMinor = BUILD_VERSION_MINOR;
+    hpccBuildInfo.buildVersionPoint = BUILD_VERSION_POINT;
+    hpccBuildInfo.buildVersion = estringify(LANGUAGE_VERSION_MAJOR) "." estringify(LANGUAGE_VERSION_MINOR) "." estringify(LANGUAGE_VERSION_SUB);
+
+    hpccBuildInfo.dirName = DIR_NAME;
+    hpccBuildInfo.prefix = PREFIX;
+    hpccBuildInfo.execPrefix = EXEC_PREFIX;
+    hpccBuildInfo.configPrefix = CONFIG_PREFIX;
+    hpccBuildInfo.installDir = INSTALL_DIR;
+    hpccBuildInfo.libDir = LIB_DIR;
+    hpccBuildInfo.execDir = EXEC_DIR;
+    hpccBuildInfo.componentDir = COMPONENTFILES_DIR;
+    hpccBuildInfo.configDir = CONFIG_DIR;
+    hpccBuildInfo.configSourceDir = CONFIG_SOURCE_DIR;
+    hpccBuildInfo.adminDir = ADMIN_DIR;
+    hpccBuildInfo.pluginsDir = PLUGINS_DIR;
+    hpccBuildInfo.runtimeDir = RUNTIME_DIR;
+    hpccBuildInfo.lockDir = LOCK_DIR;
+    hpccBuildInfo.pidDir = PID_DIR;
+    hpccBuildInfo.logDir = LOG_DIR;
+
+    hpccBuildInfo.envXmlFile = ENV_XML_FILE;
+    hpccBuildInfo.envConfFile = ENV_CONF_FILE;
+}
 
 MODULE_INIT(INIT_PRIORITY_SYSTEM)
 {
@@ -81,9 +119,8 @@ 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;
+
+    initBuildVars();
 
     return true;
 }

+ 32 - 1
system/jlib/jutil.hpp

@@ -585,7 +585,38 @@ public:
     }
 };
 
-extern jlib_decl const char *hpccBuildTag;
+struct HPCCBuildInfo
+{
+    const char *buildTag;
+
+    const char *dirName;
+    const char *prefix;
+    const char *execPrefix;
+    const char *configPrefix;
+    const char *installDir;
+    const char *libDir;
+    const char *execDir;
+    const char *componentDir;
+    const char *configDir;
+    const char *configSourceDir;
+    const char *adminDir;
+    const char *pluginsDir;
+    const char *runtimeDir;
+    const char *lockDir;
+    const char *pidDir;
+    const char *logDir;
+
+    const char *envXmlFile;
+    const char *envConfFile;
+
+    unsigned buildVersionMajor;
+    unsigned buildVersionMinor;
+    unsigned buildVersionPoint;
+    const char *buildVersion;
+};
+
+extern jlib_decl HPCCBuildInfo hpccBuildInfo;
+
 
 #endif
 

+ 11 - 7
testing/unittests/configmgr/ConfigMgrHPCCTests.cpp

@@ -30,7 +30,6 @@
 #include "mod_template_support/TemplateException.hpp"
 #include "mod_template_support/TemplateExecutionException.hpp"
 #include "EnvironmentMgr.hpp"
-#include "build-config.h"
 #include <string>
 #include <iterator>
 #include <algorithm>
@@ -40,6 +39,13 @@
 class ConfigMgrHPCCTests : public CppUnit::TestFixture
 {
     public:
+        ConfigMgrHPCCTests()
+        {
+            m_templateDir = std::string(hpccBuildInfo.installDir) + PATHSEPSTR + "testing/configmgr/templates/";
+            CFG2_CONFIG_DIR = std::string(hpccBuildInfo.componentDir) + PATHSEPSTR + "configschema" + PATHSEPSTR + "xsd" + PATHSEPSTR;
+            CFG2_SOURCE_DIR = hpccBuildInfo.configDir;
+            m_xmlEnvDir = std::string(hpccBuildInfo.installDir) + PATHSEPSTR + "testing/configmgr/schema/environments/";
+        }
 
         CPPUNIT_TEST_SUITE(ConfigMgrHPCCTests);
             CPPUNIT_TEST(duplicatePortSameService);
@@ -47,9 +53,7 @@ class ConfigMgrHPCCTests : public CppUnit::TestFixture
             CPPUNIT_TEST(portConflictAccrossProcesses);
         CPPUNIT_TEST_SUITE_END();
 
-
     protected:
-
         bool loadEnvironment(const std::string &envFile)
         {
             bool rc;
@@ -123,11 +127,11 @@ class ConfigMgrHPCCTests : public CppUnit::TestFixture
     private:
 
         EnvironmentMgr  *m_pEnvMgr = nullptr;
-        std::string m_templateDir = INSTALL_DIR PATHSEPSTR "testing/configmgr/templates/";
+        std::string m_templateDir;
         std::string CFG2_MASTER_CONFIG_FILE = "environment.xsd";
-        std::string CFG2_CONFIG_DIR = COMPONENTFILES_DIR  PATHSEPSTR "configschema" PATHSEPSTR "xsd" PATHSEPSTR;
-        std::string CFG2_SOURCE_DIR = CONFIG_SOURCE_DIR;
-        std::string m_xmlEnvDir = INSTALL_DIR PATHSEPSTR "testing/configmgr/schema/environments/";
+        std::string CFG2_CONFIG_DIR;
+        std::string CFG2_SOURCE_DIR;
+        std::string m_xmlEnvDir;
 
 };
 

+ 6 - 7
testing/unittests/configmgr/ConfigMgrTemplateTests.cpp

@@ -30,7 +30,6 @@
 #include "mod_template_support/TemplateException.hpp"
 #include "mod_template_support/TemplateExecutionException.hpp"
 #include "EnvironmentMgr.hpp"
-#include "build-config.h"
 #include <string>
 #include <iterator>
 #include <algorithm>
@@ -72,7 +71,7 @@ class ConfigMgrTemplateTests : public CppUnit::TestFixture
         {
             bool rc = true;
             CPPUNIT_ASSERT_MESSAGE("No envionrment manager loaded", m_pEnvMgr != nullptr);
-            std::string xmlEnvDir = INSTALL_DIR PATHSEPSTR "testing/configmgr/schema/environments/";
+            std::string xmlEnvDir = std::string(hpccBuildInfo.installDir) + PATHSEPSTR + "testing/configmgr/schema/environments/";
             m_pEnvMgr->discardEnvironment();   // in case one is currently loaded
 
             if (!m_pEnvMgr->loadEnvironment(xmlEnvDir + envFilename))
@@ -89,7 +88,7 @@ class ConfigMgrTemplateTests : public CppUnit::TestFixture
         {
             //
             // Standard configuration for HPCC
-            std::string schemaXSDDir = INSTALL_DIR PATHSEPSTR "testing/configmgr/schema/xsd/";
+            std::string schemaXSDDir = std::string(hpccBuildInfo.installDir) + PATHSEPSTR + "testing/configmgr/schema/xsd/";
 
             //
             // Create an environment manager and load a schema and environment
@@ -113,7 +112,7 @@ class ConfigMgrTemplateTests : public CppUnit::TestFixture
         {
             CPPUNIT_ASSERT_MESSAGE("No envionrment manager loaded", m_pEnvMgr != nullptr);
             printf("\n  Instantiating template %s ...", templateFilename.c_str());
-            std::string templateSchema = INSTALL_DIR PATHSEPSTR "componentfiles/configschema/templates/schema/ModTemplateSchema.json";
+            std::string templateSchema = std::string(hpccBuildInfo.installDir) + PATHSEPSTR + "componentfiles/configschema/templates/schema/ModTemplateSchema.json";
             if (m_pTemplate != nullptr)
                 delete m_pTemplate;
             m_pTemplate = new EnvModTemplate(m_pEnvMgr, templateSchema);
@@ -134,7 +133,7 @@ class ConfigMgrTemplateTests : public CppUnit::TestFixture
             {
                 if (info.json.find(".json") != std::string::npos)
                 {
-                    std::string templateDir = INSTALL_DIR PATHSEPSTR "testing/configmgr/templates/";
+                    std::string templateDir = std::string(hpccBuildInfo.installDir) + PATHSEPSTR + "testing/configmgr/templates/";
                     m_pTemplate->loadTemplateFromFile(templateDir + info.json);
                 }
                 else
@@ -197,7 +196,7 @@ class ConfigMgrTemplateTests : public CppUnit::TestFixture
             //
             // Simple template create
             printf("\n  Instantiating a template...");
-            std::string templateSchema = INSTALL_DIR PATHSEPSTR "componentfiles/configschema/templates/schema/ModTemplateSchema.json";
+            std::string templateSchema = std::string(hpccBuildInfo.installDir) + PATHSEPSTR + "componentfiles/configschema/templates/schema/ModTemplateSchema.json";
             auto *pTemplate = new EnvModTemplate(m_pEnvMgr, templateSchema);
             printf("complete.");
 
@@ -546,7 +545,7 @@ class ConfigMgrTemplateTests : public CppUnit::TestFixture
     private:
 
         EnvironmentMgr  *m_pEnvMgr;
-        std::string m_templateDir = INSTALL_DIR PATHSEPSTR "testing/configmgr/templates/";
+        std::string m_templateDir = std::string(hpccBuildInfo.installDir) + PATHSEPSTR + "testing/configmgr/templates/";
         EnvModTemplate *m_pTemplate;
 };
 

+ 2 - 3
testing/unittests/configmgr/ConfigMgrUnitTests.cpp

@@ -31,7 +31,6 @@
 #include "jexcept.hpp"
 #include "Exceptions.hpp"
 #include "EnvironmentMgr.hpp"
-#include "build-config.h"
 #include <iterator>
 #include <algorithm>
 
@@ -54,8 +53,8 @@ class ConfigMgr2ValidateXSDs : public CppUnit::TestFixture
             //
             // Standard configuration for HPCC
             std::string CFG2_MASTER_CONFIG_FILE = "environment.xsd";
-            std::string CFG2_CONFIG_DIR = COMPONENTFILES_DIR  PATHSEPSTR "configschema" PATHSEPSTR "xsd" PATHSEPSTR;
-            std::string CFG2_SOURCE_DIR = CONFIG_SOURCE_DIR;
+            std::string CFG2_CONFIG_DIR = std::string(hpccBuildInfo.componentDir) + PATHSEPSTR + "configschema" + PATHSEPSTR + "xsd" + PATHSEPSTR;
+            std::string CFG2_SOURCE_DIR = hpccBuildInfo.configSourceDir;
 
             //
             // Create the environment

+ 1 - 1
thorlcr/master/thgraphmanager.cpp

@@ -906,7 +906,7 @@ bool CJobManager::executeGraph(IConstWorkUnit &workunit, const char *graphName,
     timestamp_type startTs = getTimeStampNowValue();
     {
         Owned<IWorkUnit> wu = &workunit.lock();
-        wu->setTracingValue("ThorBuild", hpccBuildTag);
+        wu->setTracingValue("ThorBuild", hpccBuildInfo.buildTag);
 #ifndef _CONTAINERIZED
         updateWorkUnitLog(*wu);
 #endif

+ 2 - 2
thorlcr/master/thmastermain.cpp

@@ -604,7 +604,7 @@ int main( int argc, const char *argv[]  )
 #endif
     setStatisticsComponentName(SCTthor, globals->queryProp("@name"), true);
 
-    globals->setProp("@masterBuildTag", hpccBuildTag);
+    globals->setProp("@masterBuildTag", hpccBuildInfo.buildTag);
 
     setIORetryCount(globals->getPropInt("Debug/@ioRetries")); // default == 0 == off
     StringBuffer daliServer;
@@ -673,7 +673,7 @@ int main( int argc, const char *argv[]  )
         logHandler = queryStderrLogMsgHandler();
         logUrl.set("stderr");
 #endif
-        LOG(MCdebugProgress, thorJob, "Build %s", hpccBuildTag);
+        LOG(MCdebugProgress, thorJob, "Build %s", hpccBuildInfo.buildTag);
 
         Owned<IGroup> serverGroup = createIGroupRetry(daliServer.str(), DALI_SERVER_PORT);
 

+ 3 - 3
thorlcr/slave/thslavemain.cpp

@@ -169,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(hpccBuildTag, _masterBuildTag))
+        if (!_masterBuildTag || 0 != strcmp(hpccBuildInfo.buildTag, _masterBuildTag))
         {
             StringBuffer errStr("Thor master/slave build mismatch, master = ");
-            errStr.append(masterBuildTag).append(", slave = ").append(hpccBuildTag);
+            errStr.append(masterBuildTag).append(", slave = ").append(hpccBuildInfo.buildTag);
             OERRLOG("%s", errStr.str());
 #ifndef _DEBUG
             replyError(TE_FailedToRegisterSlave, errStr.str());
@@ -299,7 +299,7 @@ ILogMsgHandler *startSlaveLog()
     logHandler = queryStderrLogMsgHandler();
 #endif
     //setupContainerizedStorageLocations();
-    LOG(MCdebugProgress, thorJob, "Build %s", hpccBuildTag);
+    LOG(MCdebugProgress, thorJob, "Build %s", hpccBuildInfo.buildTag);
     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", hpccBuildTag);
+    PROGLOG("Build %s", hpccBuildInfo.buildTag);
 }
 #endif
 

+ 1 - 2
tools/esdlcmd/esdl2ecl.cpp

@@ -19,7 +19,6 @@
 #include "xslprocessor.hpp"
 
 #include "esdlcmd_core.hpp"
-#include "build-config.h"
 
 typedef IPropertyTree * IPTreePtr;
 
@@ -192,7 +191,7 @@ public:
         if (getComponentFilesRelPathFromBin(componentsfolder))
             optHPCCCompFilesDir.set(componentsfolder.str());
         else
-            optHPCCCompFilesDir.set(COMPONENTFILES_DIR);
+            optHPCCCompFilesDir.set(hpccBuildInfo.componentDir);
     }
 
     virtual bool parseCommandLineOptions(ArgvIterator &iter)

+ 1 - 4
tools/esdlcmd/esdlcmd.cpp

@@ -23,15 +23,12 @@
 #include "esdlcmd_common.hpp"
 #include "esdlcmd_core.hpp"
 
-#define SYSTEMCONFDIR CONFIG_DIR
-#define SYSTEMCONFFILE ENV_CONF_FILE
-
 
 //=========================================================================================
 
 static int doMain(int argc, const char *argv[])
 {
-    EsdlCMDShell processor(argc, argv, createCoreEsdlCommand, hpccBuildTag, true);
+    EsdlCMDShell processor(argc, argv, createCoreEsdlCommand, hpccBuildInfo.buildTag, true);
     return processor.run();
 }
 

+ 1 - 1
tools/esdlcmd/esdlcmd_common.cpp

@@ -81,7 +81,7 @@ esdlCmdOptionMatchIndicator EsdlCmdCommon::matchCommandLineOption(ArgvIterator &
     }
     if (iter.matchFlag(boolValue, ESDLOPT_VERSION))
     {
-        fprintf(stdout, "%s\n", hpccBuildTag);
+        fprintf(stdout, "%s\n", hpccBuildInfo.buildTag);
         return EsdlCmdOptionCompletion;
     }
 

+ 4 - 4
tools/esdlcmd/esdlcmd_core.cpp

@@ -154,7 +154,7 @@ public:
             if (getComponentFilesRelPathFromBin(tmp))
                 optXsltPath.set(tmp.str());
             else
-                optXsltPath.set(COMPONENTFILES_DIR);
+                optXsltPath.set(hpccBuildInfo.componentDir);
         }
 
         fullxsltpath.set(optXsltPath);
@@ -686,7 +686,7 @@ public:
             if (checkFileExists(temp.append(binXsltPath).append(XSLT_ESDL2JAVABASE)))
                 optXsltPath.set(binXsltPath);
             else
-                optXsltPath.set(temp.set(COMPONENTFILES_DIR).append("/xslt/"));
+                optXsltPath.set(temp.set(hpccBuildInfo.componentDir).append("/xslt/"));
         }
         cmdHelper.verbose = optVerbose;
         return true;
@@ -918,7 +918,7 @@ public:
             if (checkFileExists(temp.append(binXsltPath).append(XSLT_ESDL2CPPBASEHPP)))
                 optXsltPath.set(binXsltPath);
             else
-                optXsltPath.set(temp.set(COMPONENTFILES_DIR).append("/xslt/"));
+                optXsltPath.set(temp.set(hpccBuildInfo.componentDir).append("/xslt/"));
         }
         cmdHelper.verbose = optVerbose;
         return true;
@@ -1023,7 +1023,7 @@ public:
         else
         {
             Owned<IProperties> params = createProperties();
-            setXpathQuotedParam(params, "installdir", INSTALL_DIR);
+            setXpathQuotedParam(params, "installdir", hpccBuildInfo.installDir);
             cmdHelper.defHelper->loadTransform( xsltpath, params.get(), EsdlXslToCppCMake);
             cmdHelper.defHelper->toMicroService( *structs, outputBuffer, EsdlXslToCppCMake, NULL, optFlags );
             saveAsFile(sourcedir.str(), "CMakeLists.txt", outputBuffer.str(), NULL);

+ 1 - 1
tools/esdlcmd/esdlcmd_monitor.cpp

@@ -88,7 +88,7 @@ StringBuffer &getEsdlCmdComponentFilesPath(StringBuffer & path)
 {
     if (getComponentFilesRelPathFromBin(path))
         return path;
-    return path.set(COMPONENTFILES_DIR);
+    return path.set(hpccBuildInfo.componentDir);
 }
 
 class EsdlMonitorTemplateCmd : public EsdlConvertCmd

+ 1 - 1
tools/esdlcmd/esdlcmd_shell.cpp

@@ -155,7 +155,7 @@ bool EsdlCMDShell::parseCommandLineOptions(ArgvIterator &iter)
         }
         if (iter.matchFlag(boolValue, ESDLOPT_VERSION))
         {
-            fprintf(stdout, "%s\n", hpccBuildTag);
+            fprintf(stdout, "%s\n", hpccBuildInfo.buildTag);
             return false;
         }
         StringAttr tempArg;

+ 1 - 2
tools/initldap/initldap.cpp

@@ -16,7 +16,6 @@
 ############################################################################## */
 #include "ldapsecurity.ipp"
 #include "ldapsecurity.hpp"
-#include "build-config.h"
 
 #ifndef _WIN32
 #include <unistd.h>
@@ -179,7 +178,7 @@ int main(int argc, char* argv[])
 
     //execute configgen to query the LDAP Server configuration(s)
     StringBuffer cmd;
-    cmd.appendf("%s%cconfiggen -env %s%c%s -listldapservers", ADMIN_DIR,PATHSEPCHAR,CONFIG_DIR, PATHSEPCHAR, ENV_XML_FILE);
+    cmd.appendf("%s%cconfiggen -env %s%c%s -listldapservers", hpccBuildInfo.adminDir,PATHSEPCHAR,hpccBuildInfo.configDir, PATHSEPCHAR, hpccBuildInfo.envXmlFile);
 
     char * configBuffer = NULL;