Skip the current package when checking for failed dependencies
We usually wouldn't expect a package to depend on itself but the different packages build as part of one split-package might do.
This commit is contained in:
parent
3fe15fb081
commit
b556c39cd7
|
@ -548,7 +548,8 @@ private:
|
||||||
void downloadSourcesAndContinueBuilding();
|
void downloadSourcesAndContinueBuilding();
|
||||||
void enqueueDownloads(const BatchProcessingSession::SharedPointerType &downloadsSession, std::size_t maxParallelDownloads);
|
void enqueueDownloads(const BatchProcessingSession::SharedPointerType &downloadsSession, std::size_t maxParallelDownloads);
|
||||||
void enqueueMakechrootpkg(const BatchProcessingSession::SharedPointerType &makepkgchrootSession, std::size_t maxParallelInvocations);
|
void enqueueMakechrootpkg(const BatchProcessingSession::SharedPointerType &makepkgchrootSession, std::size_t maxParallelInvocations);
|
||||||
bool checkForFailedDependency(const std::vector<const std::vector<LibPkg::Dependency> *> &dependencies) const;
|
bool checkForFailedDependency(
|
||||||
|
const std::string &packageNameToCheck, const std::vector<const std::vector<LibPkg::Dependency> *> &dependencies) const;
|
||||||
InvocationResult invokeUpdatePkgSums(const BatchProcessingSession::SharedPointerType &downloadsSession, const std::string &packageName,
|
InvocationResult invokeUpdatePkgSums(const BatchProcessingSession::SharedPointerType &downloadsSession, const std::string &packageName,
|
||||||
PackageBuildProgress &packageProgress, const std::string &buildDirectory);
|
PackageBuildProgress &packageProgress, const std::string &buildDirectory);
|
||||||
InvocationResult invokeMakepkgToMakeSourcePackage(const BatchProcessingSession::SharedPointerType &downloadsSession,
|
InvocationResult invokeMakepkgToMakeSourcePackage(const BatchProcessingSession::SharedPointerType &downloadsSession,
|
||||||
|
|
|
@ -714,10 +714,15 @@ void ConductBuild::enqueueMakechrootpkg(const BatchProcessingSession::SharedPoin
|
||||||
dumpBuildProgress();
|
dumpBuildProgress();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ConductBuild::checkForFailedDependency(const std::vector<const std::vector<LibPkg::Dependency> *> &dependencies) const
|
bool ConductBuild::checkForFailedDependency(
|
||||||
|
const std::string &packageNameToCheck, const std::vector<const std::vector<LibPkg::Dependency> *> &dependencies) const
|
||||||
{
|
{
|
||||||
// check whether any of the specified dependencies are provided by packages which are supposed to be built but failed
|
// check whether any of the specified dependencies are provided by packages which are supposed to be built but failed
|
||||||
for (const auto &[packageName, buildData] : m_buildPreparation.buildData) {
|
for (const auto &[packageName, buildData] : m_buildPreparation.buildData) {
|
||||||
|
// ignore the package we're checking for failed dependencies
|
||||||
|
if (packageName == packageNameToCheck) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// ignore packages which have been added to the repository successfully and treat any other packages as failed
|
// ignore packages which have been added to the repository successfully and treat any other packages as failed
|
||||||
const auto buildProgress = m_buildProgress.progressByPackage.find(packageName);
|
const auto buildProgress = m_buildProgress.progressByPackage.find(packageName);
|
||||||
if (buildProgress != m_buildProgress.progressByPackage.end() && buildProgress->second.addedToRepo) {
|
if (buildProgress != m_buildProgress.progressByPackage.end() && buildProgress->second.addedToRepo) {
|
||||||
|
@ -850,7 +855,7 @@ InvocationResult ConductBuild::invokeMakechrootpkg(
|
||||||
for (const auto &package : buildData.packages) {
|
for (const auto &package : buildData.packages) {
|
||||||
dependencies.emplace_back(&package->dependencies);
|
dependencies.emplace_back(&package->dependencies);
|
||||||
}
|
}
|
||||||
if (checkForFailedDependency(dependencies)) {
|
if (checkForFailedDependency(packageName, dependencies)) {
|
||||||
const auto writeLock = lockToWrite(lock);
|
const auto writeLock = lockToWrite(lock);
|
||||||
packageProgress.error = "unable to build because dependency failed";
|
packageProgress.error = "unable to build because dependency failed";
|
||||||
return InvocationResult::Error;
|
return InvocationResult::Error;
|
||||||
|
|
Loading…
Reference in New Issue