-
Notifications
You must be signed in to change notification settings - Fork 14
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
Excluded or overriden transitive dependencies break topological sort #7
Comments
yup, i am aware of this problem. my idea to fix it is basically work with an unresolved dependency tree if that makes sense. so if a certain library occures multiple times in the tree say once as a transient dependency and once as a direct dependency i would rewrite and include it twice. hope this makes sense... |
As in, you wouldn't change the current topological sort, but also pass around another tree that includes the "actual" dependencies? Do you get this unresolved tree from Aether by just deleting the And does this mean you would mangle core.cache requires twice? Once for core.cache, then again when you discover core.memoize also depends on it? |
i want to cheat in the sense that i would loop through the direct depedencies and pretend that they are the only dependency. in other words work with the one tree per direct dependency. (i have not proven that this would work yet)
i guess not because it would still 'solve' clashing versions etc
this would only make sense if i separated the processing of the above mentioned trees. can get tricky when i replace the references in the original project code. this might result in a system which does not allow you to use transient dependencies directly in your code -- which may be a good thing tbh |
Your cheat sounds like the easiest solution. |
let me know if you have some ideas around this tho |
It seems like if we fiddle with the topological map from Aether this fix would be a one liner. My idea was to grab the resolved topological map, then walk over it, adding dependencies that have been overriden and reordering as needed. Then just plug this new topological map into the original functions. |
i guess the tricky thing with 'cheat' would be (1) seperating the trees (quite a bit hassling with directories etc) and (2) updating the references at the right places only |
the possible problems with my approach:
|
- resolve direct dependencies one by one - walk the resulting tree and count all occurrances of dependencies - order the first level dependencies according to their number of occurrence, if they occure multiple times they will be resolved later
I came up with a hybrid solution where as a best effort I order the primary dependencies according to how many times they occur in the dependency tree: more times they occur the later they get resolved. I guess this approach fails if primary dependency A occurs more times than B but A actually depends on B. However, this solution solves the simpler cases (the one which pending on mranderson for long time in refactor-nrepl for example). Let me know what you think. 0.4.4-SNAPSHOT is on clojars btw if you want to play with it |
had to revert my failing try to sort deps. i guess options still are
|
this is now fixed in two different ways in this commit. firstly there is secondly in the default mode where mranderson works on a resolved dependency tree flatten out the resolved tree and sort it by the topological order of the fully expanded tree. Also use a not closing this issue as the above is not merged into master yet or released. pretty much alpha really. |
0.5.0 released |
A project.clj such as this:
ignores the fact that core.memoize must be processed before core.cache because pomegranate thinks core.cache does not appear in the dependencies of core.memoize.
This means core.memoize ends up with calls to
clojure.core.cache
, since core.cache can be processed first.The text was updated successfully, but these errors were encountered: