Skip to content

Commit

Permalink
Merge pull request #18643 from ghalliday/issue31818
Browse files Browse the repository at this point in the history
HPCC-31818 Only preserve c++ files in containerized system when requested

Reviewed-by: Jake Smith <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored May 15, 2024
2 parents 2c9f7d7 + f409a1c commit d0bbb7c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions ecl/eclcc/eclcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,8 @@ void EclCC::instantECL(EclCompileInstance & instance, IWorkUnit *wu, const char
try
{
bool optSaveTemps = wu->getDebugValueBool("saveEclTempFiles", false);
bool optSaveCpp = optSaveTemps || optNoCompile || !optCompileBatchOut.isEmpty() || wu->getDebugValueBool("saveCppTempFiles", false) || wu->getDebugValueBool("saveCpp", false);
bool optPublishCpp = optSaveTemps || optNoCompile || wu->getDebugValueBool("saveCppTempFiles", false) || wu->getDebugValueBool("saveCpp", false);
bool optSaveCpp = optPublishCpp || !optCompileBatchOut.isEmpty();
//New scope - testing things are linked correctly
{
Owned<IHqlExprDllGenerator> generator = createDllGenerator(&errorProcessor, processName.str(), NULL, wu, optTargetClusterType, &instance, false, false);
Expand All @@ -972,7 +973,7 @@ void EclCC::instantECL(EclCompileInstance & instance, IWorkUnit *wu, const char
ForEachItemIn(i, resourceManifestFiles)
generator->addManifest(resourceManifestFiles.item(i));
}
generator->setSaveGeneratedFiles(optSaveCpp);
generator->setSaveGeneratedFiles(optSaveCpp, optPublishCpp);

if (optSaveQueryArchive && instance.wu && instance.archive)
{
Expand Down
10 changes: 5 additions & 5 deletions ecl/hqlcpp/hqlecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ class HqlDllGenerator : implements IHqlExprDllGenerator, implements IAbortReques
defaultMaxCompileThreads = 1;
generateTarget = EclGenerateNone;
code.setown(createCppInstance(wu, wuname));
deleteGenerated = false;
totalGeneratedSize = 0;
}
IMPLEMENT_IINTERFACE
Expand All @@ -184,7 +183,7 @@ class HqlDllGenerator : implements IHqlExprDllGenerator, implements IAbortReques
virtual void addManifest(const char *filename) override { code->addManifest(filename, ctxCallback); }
virtual void addManifestsFromArchive(IPropertyTree *archive) override { code->addManifestsFromArchive(archive, ctxCallback); }
virtual void addWebServiceInfo(IPropertyTree *wsinfo) override { code->addWebServiceInfo(wsinfo); }
virtual void setSaveGeneratedFiles(bool value) override { deleteGenerated = !value; }
virtual void setSaveGeneratedFiles(bool save, bool publish) override { deleteGenerated = !save; publishGenerated = publish; }

double getECLcomplexity(IHqlExpression * exprs);

Expand Down Expand Up @@ -225,7 +224,8 @@ class HqlDllGenerator : implements IHqlExprDllGenerator, implements IAbortReques
bool checkForLocalFileUploads;
bool noOutput;
EclGenerateTarget generateTarget;
bool deleteGenerated;
bool deleteGenerated = false;
bool publishGenerated = false;
bool okToAbort;
};

Expand Down Expand Up @@ -326,7 +326,7 @@ void HqlDllGenerator::expandCode(StringBuffer & filename, const char * codeTempl

totalGeneratedSize += out->size();

if (!deleteGenerated)
if (!publishGenerated)
{
unsigned minActivity, maxActivity;
code->getActivityRange(pass, minActivity, maxActivity);
Expand Down Expand Up @@ -579,7 +579,7 @@ bool HqlDllGenerator::generateCode(HqlQueryContext & query)
}

if (wu->getDebugValueBool("saveEclTempFiles", false) || wu->getDebugValueBool("saveCppTempFiles", false) || wu->getDebugValueBool("saveCpp", false))
setSaveGeneratedFiles(true);
setSaveGeneratedFiles(true, true);

doExpand(translator);
unsigned __int64 elapsed = cycle_to_nanosec(get_cycles_now() - startCycles);
Expand Down
2 changes: 1 addition & 1 deletion ecl/hqlcpp/hqlecl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ interface IHqlExprDllGenerator : extends IInterface
virtual void addManifest(const char *filename) = 0;
virtual void addManifestsFromArchive(IPropertyTree *archive) = 0;
virtual void addWebServiceInfo(IPropertyTree *wsinfo) = 0;
virtual void setSaveGeneratedFiles(bool value) = 0;
virtual void setSaveGeneratedFiles(bool save, bool publish) = 0;
virtual void addArchiveAsResource(StringBuffer &buf) = 0;
};

Expand Down

0 comments on commit d0bbb7c

Please sign in to comment.