Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No check optional deps #832

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions source/dub/dependencyresolver.d
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,17 @@ class DependencyResolver(CONFIGS, CONFIG) {
pidx = *pi;
configs = all_configs[*pi];
} else {
if (basepack == root_base_pack) configs = [root.config];
else configs = getAllConfigs(basepack);
all_configs ~= configs;
package_indices[basepack] = pidx;
package_names[pidx] = basepack;
if (basepack == root_base_pack) configs = [root.config];
else if(ch.depType == DependencyType.required)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at

dub/source/dub/dub.d

Lines 1218 to 1227 in 9a37109

if (m_options & UpgradeOptions.upgrade || !m_selectedVersions || !m_selectedVersions.hasSelectedVersion(dbasename)) {
// keep deselected dependencies deselected by default
if (m_selectedVersions && !m_selectedVersions.bare && dt == DependencyType.optionalDefault)
dt = DependencyType.optional;
ret ~= TreeNodes(d.name, d.spec.mapToPath(pack.path), dt);
} else {
// keep already selected optional dependencies if possible
if (dt == DependencyType.optional) dt = DependencyType.optionalDefault;
ret ~= TreeNodes(d.name, m_selectedVersions.getSelectedVersion(dbasename), dt);
}
, this should be ch.depType != DependencyType.optional.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also there should be a space after the if.

configs = getAllConfigs(basepack);
else
configs = [];
package_indices[basepack] = pidx;
package_names[pidx] = basepack;
all_configs ~= configs;
}


foreach (c; getSpecificConfigs(basepack, ch))
if (!configs.canFind(c))
configs = c ~ configs;
Expand Down
2 changes: 0 additions & 2 deletions source/dub/version_.d

This file was deleted.