Avoid checking for failed dependencies when processing the last package of batch

This commit is contained in:
Martchus 2021-02-13 12:54:01 +01:00
parent 97001740e2
commit f040418bdd
2 changed files with 6 additions and 4 deletions

View File

@ -554,7 +554,8 @@ private:
PackageBuildProgress &packageProgress, const std::string &buildDirectory); PackageBuildProgress &packageProgress, const std::string &buildDirectory);
InvocationResult invokeMakepkgToMakeSourcePackage(const BatchProcessingSession::SharedPointerType &downloadsSession, InvocationResult invokeMakepkgToMakeSourcePackage(const BatchProcessingSession::SharedPointerType &downloadsSession,
const std::string &packageName, PackageBuildProgress &packageProgress, const std::string &buildDirectory); const std::string &packageName, PackageBuildProgress &packageProgress, const std::string &buildDirectory);
InvocationResult invokeMakechrootpkg(const BatchProcessingSession::SharedPointerType &makepkgchrootSession, const std::string &packageName); InvocationResult invokeMakechrootpkg(
const BatchProcessingSession::SharedPointerType &makepkgchrootSession, const std::string &packageName, bool hasFailuresInPreviousBatches);
void addPackageToRepo( void addPackageToRepo(
const BatchProcessingSession::SharedPointerType &makepkgchrootSession, const std::string &packageName, PackageBuildProgress &packageProgress); const BatchProcessingSession::SharedPointerType &makepkgchrootSession, const std::string &packageName, PackageBuildProgress &packageProgress);
void checkDownloadErrorsAndMakePackages(BatchProcessingSession::ContainerType &&failedPackages); void checkDownloadErrorsAndMakePackages(BatchProcessingSession::ContainerType &&failedPackages);

View File

@ -689,11 +689,12 @@ void ConductBuild::enqueueMakechrootpkg(const BatchProcessingSession::SharedPoin
} }
assert(maxParallelInvocations == 1); // FIXME: parallel builds not implemented yet (required unique working copies and locking repo-add) assert(maxParallelInvocations == 1); // FIXME: parallel builds not implemented yet (required unique working copies and locking repo-add)
for (std::size_t invocations = 0; invocations < maxParallelInvocations;) { for (std::size_t invocations = 0; invocations < maxParallelInvocations;) {
const auto hasFailuresInPreviousBatches = makepkgchrootSession->hasFailuresInPreviousBatches();
const auto *const packageName = makepkgchrootSession->getCurrentPackageNameIfValidAndRelevantAndSelectNext(); const auto *const packageName = makepkgchrootSession->getCurrentPackageNameIfValidAndRelevantAndSelectNext();
if (!packageName) { if (!packageName) {
break; break;
} }
switch (invokeMakechrootpkg(makepkgchrootSession, *packageName)) { switch (invokeMakechrootpkg(makepkgchrootSession, *packageName, hasFailuresInPreviousBatches)) {
case InvocationResult::Ok: case InvocationResult::Ok:
invocations += 1; invocations += 1;
break; break;
@ -823,7 +824,7 @@ InvocationResult ConductBuild::invokeMakepkgToMakeSourcePackage(const BatchProce
} }
InvocationResult ConductBuild::invokeMakechrootpkg( InvocationResult ConductBuild::invokeMakechrootpkg(
const BatchProcessingSession::SharedPointerType &makepkgchrootSession, const std::string &packageName) const BatchProcessingSession::SharedPointerType &makepkgchrootSession, const std::string &packageName, bool hasFailuresInPreviousBatches)
{ {
auto lock = lockToRead(); auto lock = lockToRead();
auto &packageProgress = m_buildProgress.progressByPackage[packageName]; auto &packageProgress = m_buildProgress.progressByPackage[packageName];
@ -847,7 +848,7 @@ InvocationResult ConductBuild::invokeMakechrootpkg(
// check whether we can build this package when building as far as possible or when the build order has been // check whether we can build this package when building as far as possible or when the build order has been
// manuall specified (otherwise we don't need to check because we take it as given that all packages in the // manuall specified (otherwise we don't need to check because we take it as given that all packages in the
// previous batch have been built and that the order batch compution is correct) // previous batch have been built and that the order batch compution is correct)
if ((m_buildAsFarAsPossible || m_buildPreparation.manuallyOrdered) && makepkgchrootSession->hasFailuresInPreviousBatches()) { if ((m_buildAsFarAsPossible || m_buildPreparation.manuallyOrdered) && hasFailuresInPreviousBatches) {
const auto &buildData = m_buildPreparation.buildData[packageName]; const auto &buildData = m_buildPreparation.buildData[packageName];
std::vector<const std::vector<LibPkg::Dependency> *> dependencies; std::vector<const std::vector<LibPkg::Dependency> *> dependencies;
dependencies.reserve(buildData.packages.size() + 2); dependencies.reserve(buildData.packages.size() + 2);