-
Notifications
You must be signed in to change notification settings - Fork 371
Really compute transitive dependencies in opam_mk_repo (Close: #976). #977
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
Conversation
if OpamPackage.Set.mem nv set then | ||
set | ||
else | ||
OpamPackage.Set.union |
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.
It's simpler to write:
OpamPackage.Set.(add nv (union (get_dependencies nv) set))
Woops... Thanks for the fix! Can you just correct that minor remark ? |
After some thoughts I'm not totally convinced by your fix. I think it will be safer to simply add |
If nv is already in the set, it means that it has already been visited, so there is no reason to go through it once again. That is the reason of the if then else. Adding the element to the get_dependencies, change slightly the meaning of the function since it will return not only the deps but the deps and itself (but that may be fine). Doing it without the if then else, is fine. BUT not good in term of complexity because the set keep expanding with each recursive call and even if you already have computed deps you will try again to get it again and again... But this is just my 2 cents and my 2 min hack done done late at night, I may have some bugs here. |
Well not necessary; if |
Oh god, you are right in fact. I was mislead but the fact that we have only one set. We should visited and to_visit set, and the end condition is that to_visit set must be empty. |
will fix that tonight, but the former algo was wrong anyway and the complexity argument stands. |
I think this is fixed, please take another look. |
Really compute transitive dependencies in opam_mk_repo (Close: #976).
Thanks! |
No description provided.