-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
base: master
Are you sure you want to change the base?
Conversation
package_indices[basepack] = pidx; | ||
package_names[pidx] = basepack; | ||
if (basepack == root_base_pack) configs = [root.config]; | ||
else if(ch.depType == DependencyType.required) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at
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); | |
} |
ch.depType != DependencyType.optional
.
There was a problem hiding this comment.
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
.
Looks like we overlooked a valid case for the meta data cache. I'm not fully sure about it in general, yet, but one issue with this change is that it doesn't work correctly in all cases (in particular the case when there is a second non-optional dependency to the same package must be handled). |
Can we get the configs lazily once an optional package is required as dependency? |
Should we defer resolution of this bug until we rework the dependency resolver? |
Yes, let's defer this to 1.0.0. It's annoying with no/slow internet connection, but can be worked around with the |
@s-ludwig Well, thanks for fixing it. I don't care what approach as long as it works. I just wrote this attempt to avoid being a totally useless lump over in the issue section. |
Definitely appreciated! My fix doesn't catch all the cases that this one does, so if it doesn't accidentally break something, it makes sense to integrate it. |
I just thought of an issue with this approach: If the same package is referenced twice, once optional and once non-optional, if the optional dependency is visited first, it will end up with no version candidates, even though there is the other non-optional dependency. This could probably be fixed with a |
One could try to overwrite the configs of earlier optional packages of they are required later on. I don't think we support resolving an optional dependency conflicting with a mandatory dependency of the same package. |
Avoid stalling on polling online servers for versions of dependencies that we aren't going to use. Related to #831
Not sure if I did this right... works for stopping optional deps, but I don't have an optional dependency to actually select, to test if that sets
depType
torequired
early enough.