don't care about cyclic deps when a binary from previous build is
available
This commit is contained in:
parent
3092965d49
commit
503eef27ed
|
@ -35,6 +35,8 @@ public:
|
|||
bool isVisited() const;
|
||||
bool isOnlyDependency() const;
|
||||
void setIsOnlyDependency(bool isOnlyDependency);
|
||||
bool isBinaryAvailable() const;
|
||||
void setBinaryAvailable(bool binaryAvailable);
|
||||
bool isPackageRequested() const;
|
||||
void setPackageRequested();
|
||||
QSet<Dependency> requiredFor() const;
|
||||
|
@ -51,6 +53,7 @@ private:
|
|||
bool m_done;
|
||||
bool m_visited;
|
||||
bool m_onlyDep;
|
||||
bool m_binaryAvailable;
|
||||
bool m_pkgRequested;
|
||||
QSet<Dependency> m_requiredFor;
|
||||
Package *m_associatedPackage;
|
||||
|
@ -65,6 +68,7 @@ inline TaskInfo::TaskInfo(const QString &name, bool onlyDependency, const QSet<T
|
|||
m_done(false),
|
||||
m_visited(false),
|
||||
m_onlyDep(onlyDependency),
|
||||
m_binaryAvailable(false),
|
||||
m_pkgRequested(false),
|
||||
m_associatedPackage(nullptr)
|
||||
{}
|
||||
|
@ -138,6 +142,25 @@ inline void TaskInfo::setIsOnlyDependency(bool isOnlyDependency)
|
|||
m_onlyDep = isOnlyDependency;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns whether a binary for the task is already available (from previous build).
|
||||
* \remarks If a binary is available the resolver won't complain if this package is a
|
||||
* cyclic dependency.
|
||||
*/
|
||||
inline bool TaskInfo::isBinaryAvailable() const
|
||||
{
|
||||
return m_binaryAvailable;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Sets whether a binary for the task is already available (from previous build).
|
||||
* \sa isBinaryAvailable()
|
||||
*/
|
||||
inline void TaskInfo::setBinaryAvailable(bool binaryAvailable)
|
||||
{
|
||||
m_binaryAvailable = binaryAvailable;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns whether the package for this task has been requested yet.
|
||||
*
|
||||
|
@ -190,8 +213,9 @@ void TaskInfo::add(QList<TaskInfo *> &results)
|
|||
if(!isDone()) {
|
||||
if(isVisited()) {
|
||||
// cyclic dependency
|
||||
if(isOnlyDependency()) {
|
||||
if(isOnlyDependency() || isBinaryAvailable()) {
|
||||
// if this is only a dependency (which we don't want to build) don't care about it
|
||||
// if there is already a binary (from previous build) don't care about it either
|
||||
return;
|
||||
} else {
|
||||
throw *this;
|
||||
|
@ -429,8 +453,12 @@ bool BuildOrderResolver::addDependenciesToTask(TaskInfo *task)
|
|||
if(const auto pkg = findPackageForDependency(dep)) {
|
||||
task->addRequiredFor(dep);
|
||||
if(task->associatePackage(pkg)) {
|
||||
if(m_addSourceOnlyDeps && pkg->repository()->isSourceOnly()) {
|
||||
task->setIsOnlyDependency(false);
|
||||
if(pkg->repository()->isSourceOnly()) {
|
||||
if(m_addSourceOnlyDeps) {
|
||||
task->setIsOnlyDependency(false);
|
||||
}
|
||||
} else {
|
||||
task->setBinaryAvailable(true);
|
||||
}
|
||||
// add dependencies to task
|
||||
if(!addDependenciesToTask(task, pkg->allDependencies())) {
|
||||
|
@ -482,8 +510,12 @@ bool BuildOrderResolver::addDependenciesToTask(TaskInfo *task, const QList<const
|
|||
depTask->addRequiredFor(dep);
|
||||
if(depPkg) {
|
||||
if(depTask->associatePackage(depPkg)) {
|
||||
if(m_addSourceOnlyDeps && depPkg->repository() && depPkg->repository()->isSourceOnly()) {
|
||||
depTask->setIsOnlyDependency(false);
|
||||
if(depPkg->repository()->isSourceOnly()) {
|
||||
if(m_addSourceOnlyDeps) {
|
||||
depTask->setIsOnlyDependency(false);
|
||||
}
|
||||
} else {
|
||||
depTask->setBinaryAvailable(true);
|
||||
}
|
||||
if(newTask) {
|
||||
// add dependencies of the dependency
|
||||
|
|
Loading…
Reference in New Issue