Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/candidate-8.12.x' into candidate…
Browse files Browse the repository at this point in the history
…-9.0.x

Signed-off-by: Gordon Smith <[email protected]>

# Conflicts:
#	helm/hpcc/Chart.yaml
#	helm/hpcc/templates/_helpers.tpl
#	helm/hpcc/templates/dafilesrv.yaml
#	helm/hpcc/templates/dali.yaml
#	helm/hpcc/templates/dfuserver.yaml
#	helm/hpcc/templates/eclagent.yaml
#	helm/hpcc/templates/eclccserver.yaml
#	helm/hpcc/templates/eclscheduler.yaml
#	helm/hpcc/templates/esp.yaml
#	helm/hpcc/templates/localroxie.yaml
#	helm/hpcc/templates/roxie.yaml
#	helm/hpcc/templates/sasha.yaml
#	helm/hpcc/templates/thor.yaml
#	version.cmake
  • Loading branch information
GordonSmith committed Aug 25, 2023
2 parents 82ea912 + 587e38f commit 3e9b248
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
1 change: 0 additions & 1 deletion dockerfiles/buildall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ if [[ -n "$BUILD_LN" ]]; then
GITHUB_TOKEN=${LNB_TOKEN}
lnBuildTag=${BUILD_TAG/community_/internal_}
build_image platform-build-ln ${BUILD_LABEL} ${lnBuildTag}
${SCRIPT_DIR}/cleanup.sh
build_image platform-core-ln ${BUILD_LABEL} ${lnBuildTag} --build-arg BUILD_TAG_OVERRIDE=${HPCC_LONG_TAG}
elif [[ -z "$BUILD_ML" ]]; then
build_image platform-build
Expand Down
8 changes: 4 additions & 4 deletions ecl/eclcc/eclcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1749,7 +1749,7 @@ void EclCC::processXmlFile(EclCompileInstance & instance, const char *archiveXML
localRepositoryManager.processArchive(archiveTree);

if (queryAttributePackage)
instance.dataServer.set(localRepositoryManager.queryDependentRepository(nullptr, queryAttributePackage, nullptr));
instance.dataServer.set(localRepositoryManager.queryRepositoryAsRoot(queryAttributePackage, nullptr));
else
instance.dataServer.setown(localRepositoryManager.createPackage(nullptr));

Expand Down Expand Up @@ -1875,7 +1875,7 @@ void EclCC::processFile(EclCompileInstance & instance)
if (attributePackage)
{
//If attribute package is specified, resolve that package as the source for the query
instance.dataServer.set(localRepositoryManager.queryDependentRepository(nullptr, attributePackage, inputFileCollection));
instance.dataServer.set(localRepositoryManager.queryRepositoryAsRoot(attributePackage, inputFileCollection));
}
else
{
Expand Down Expand Up @@ -2065,7 +2065,7 @@ void EclCC::processReference(EclCompileInstance & instance, const char * queryAt

if (!isEmptyString(queryAttributePackage))
{
instance.dataServer.set(localRepositoryManager.queryDependentRepository(nullptr, queryAttributePackage, nullptr));
instance.dataServer.set(localRepositoryManager.queryRepositoryAsRoot(queryAttributePackage, nullptr));
}
else
{
Expand All @@ -2075,7 +2075,7 @@ void EclCC::processReference(EclCompileInstance & instance, const char * queryAt

if (looksLikeGitPackage(searchPath))
{
instance.dataServer.set(localRepositoryManager.queryDependentRepository(nullptr, searchPath, nullptr));
instance.dataServer.set(localRepositoryManager.queryRepositoryAsRoot(searchPath, nullptr));
}
else
{
Expand Down
26 changes: 22 additions & 4 deletions ecl/hql/hqlrepository.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ IHqlExpression * CNewEclRepository::createSymbol(IHqlRemoteScope * rScope, IEclS
{
const char * defaultUrl = source->queryPath();
Owned<IProperties> props = source->getProperties();
IEclRepository * repo = container->queryDependentRepository(eclId, defaultUrl, nullptr);
IEclRepository * repo = container->queryDependentRepository(eclId, defaultUrl);
IHqlScope * childScope = repo->queryRootScope();
body.set(queryExpression(childScope));
break;
Expand Down Expand Up @@ -604,6 +604,7 @@ void EclRepositoryManager::addQuerySourceFileEclRepository(IErrorReceiver *errs,
void EclRepositoryManager::addSingleDefinitionEclRepository(const char * moduleName, const char * attrName, IFileContents * contents, bool includeInArchive)
{
Owned<IEclRepository> repo = createSingleDefinitionEclRepository(moduleName, attrName, contents, includeInArchive);
overrideSources.append(*repo.getLink());
allSources.append(*repo.getClear());
}

Expand Down Expand Up @@ -673,7 +674,7 @@ void EclRepositoryManager::processArchive(IPropertyTree * archiveTree)
addRepository(archiveCollection, nullptr, true);
}

IEclPackage * EclRepositoryManager::queryDependentRepository(IIdAtom * name, const char * defaultUrl, IEclSourceCollection * overrideSources)
IEclPackage * EclRepositoryManager::queryRepository(IIdAtom * name, const char * defaultUrl, IEclSourceCollection * overrideSource, bool includeDefinitions)
{
//Check to see if the reference is to a filename. Should possibly be disabled on a switch.
const char * filename = queryExtractFilename(defaultUrl);
Expand Down Expand Up @@ -719,12 +720,17 @@ IEclPackage * EclRepositoryManager::queryDependentRepository(IIdAtom * name, con
//Create a new repository for the directory that contains the dependent package
allSources.kill();
Owned<IErrorReceiver> errs = createThrowingErrorReceiver();
if (includeDefinitions)
{
ForEachItemIn(iDefs, overrideSources)
allSources.append(OLINK(overrideSources.item(iDefs)));
}
ForEachItemIn(iShared, sharedSources)
allSources.append(OLINK(sharedSources.item(iShared)));

//Explicitly provided sources take precedence over the contents of the repository
if (overrideSources)
addRepository(overrideSources, nullptr, true);
if (overrideSource)
addRepository(overrideSource, nullptr, true);

unsigned flags = ESFdependencies;
Owned<IEclRepository> repo;
Expand All @@ -740,6 +746,18 @@ IEclPackage * EclRepositoryManager::queryDependentRepository(IIdAtom * name, con
}


IEclPackage * EclRepositoryManager::queryDependentRepository(IIdAtom * name, const char * defaultUrl)
{
assertex(name);
return queryRepository(name, defaultUrl, nullptr, false);
}

IEclPackage * EclRepositoryManager::queryRepositoryAsRoot(const char * defaultUrl, IEclSourceCollection * overrideSources)
{
return queryRepository(nullptr, defaultUrl, overrideSources, true);
}


static bool isEmptyDirectory(const char * path)
{
Owned<IDirectoryIterator> iter = createDirectoryIterator(path);
Expand Down
6 changes: 5 additions & 1 deletion ecl/hql/hqlrepository.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ class HQL_API EclRepositoryManager
unsigned __int64 getStatistic(StatisticKind kind) const;

void processArchive(IPropertyTree * archiveTree);
IEclPackage * queryDependentRepository(IIdAtom * name, const char * defaultUrl, IEclSourceCollection * overrideSources);
IEclPackage * queryDependentRepository(IIdAtom * name, const char * defaultUrl);
IEclPackage * queryRepositoryAsRoot(const char * defaultUrl, IEclSourceCollection * overrideSources);

void setOptions(const char * _eclRepoPath, const char * _gitUser, const char * _gitPasswordPath, const char * _defaultGitPrefix,
bool _fetchRepos, bool _updateRepos, bool _cleanRepos, bool _cleanInvalidRepos, bool _verbose)
{
Expand All @@ -80,12 +82,14 @@ class HQL_API EclRepositoryManager
IEclRepository * createRepository(IEclSourceCollection * source, const char * rootScopeFullName, bool includeInArchive);

unsigned runGitCommand(StringBuffer * output, const char *args, const char * cwd, bool needCredentials);
IEclPackage * queryRepository(IIdAtom * name, const char * defaultUrl, IEclSourceCollection * overrideSource, bool includeDefinitions);

private:
using DependencyInfo = std::pair<std::string, Shared<IEclPackage>>;
CIArrayOf<EclRepositoryMapping> repos;
std::vector<DependencyInfo> dependencies;
IArrayOf<IEclRepository> sharedSources; // plugins, std library, bundles
IArrayOf<IEclRepository> overrideSources; // -D options
IArrayOf<IEclRepository> allSources; // also includes -D options
cycle_t gitDownloadCycles = 0;

Expand Down

0 comments on commit 3e9b248

Please sign in to comment.