-
Notifications
You must be signed in to change notification settings - Fork 843
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
Add --external flag to stack dot
#437
Conversation
as discussed in #431, should we make --external the default (without command option) and come up with an other option name (like anyway, that's quite minor. |
I'd rather have the current behavior as default, with flags to force it either direction. Then we can change the default in the future and people can keep backwards compatibility easily. Let me review this patch. I can make the addition of a |
I don't think this is working as intended: it currently only goes one level deep. For example, when run on the stack repo, it tells you all of the packages that stack depends on, but not the packages that they depend on as well. Am I correct in understanding that that was the desired behavior? |
I did not find an easy way to resolve the PackageName into something we can use to extract further dependencies without changing even more of the original version. So currently the intended behavior is that only one level is shown. But I agree that it would be very cool to get a full dependency graph generated. Maybe that could be done as an extension though I don't know how much work it will be. |
I can probably either add that myself tomorrow or, if you'd prefer, add information to this issue explaining where to get the missing information. |
If you want to explain it that's great because then I can give it a shot
|
OK, I'll give more details tomorrow when I'm at my computer instead of on my phone. Probably the Stack.Build.Sources module is the right place to start. |
Alright, a bit more information:
I hope that helps, let me know if you have any questions |
Yes thanks that definitely helps. I think I will have something working soon, I'll let you know. |
This is looking awesome. On my phone so I can't review properly, I'll provide feedback later. |
It looks like this doesn't build with GHC 7.8 due to lack of Applicative => Monad. |
Yeah that trips me up every time because I currently only have ghc 7.10 installed :) |
You could just use |
Did I mention that my internet is SUPER slow? About 30 kB/s is the normal rate :P |
@@ -87,7 +88,13 @@ mkBaseConfigOpts bopts = do | |||
} | |||
|
|||
-- | Provide a function for loading package information from the package index | |||
withLoadPackage :: M env m | |||
withLoadPackage :: ( MonadIO m |
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.
👍
Ouch, I think I'd go crazy at that rate :( The patch looks good, barring the 7.8 issues I'd be happy to merge it. I don't mind fixing those up myself, would you like me to? And thanks again for the contributions, not sure if you noticed, but: Achievement Unlocked: Commit Bit |
The 7.8 issue should be fixed. There is still a problem with packages included with And I would like to add some tests for the graph building before this is merged. |
I'm not sure how useful it is to include dependencies of wired-in packages (those that are tied into the compiler), since their dependencies are somewhat irrelevant (they can never be reinstalled). I'd say showing the I'll hold off on the merge then. |
Is there an easy way to check whether it is wired-in? Or is checking for an empty dependency set enough? |
It's not exactly the same thing, but I'd just trust that empty dependency set means it should be displayed as a leaf. This will apply to some non-wired-in packages that are in the global database as well if I'm not mistaken. But to answer your question much more directly: look at |
- replace type alias `M` with minimal set of required constraints
d0aa685
to
98ea4de
Compare
- new flag --[no-]external to include external dependencies - new flag --[no-]include-base to toggle edges to base package - new flag --depth to limit depth of external dependencies shown
Okay I think this can be merged. Packages from I also added some tests although not as many as I would like to have because for that I would need to also create I split the pr into 3 commits but if you want I can also just squash them into one. Best, |
Add --external flag to `stack dot`
Thanks! |
When given
--external
,stack dot
will include external dependencies.By default it keeps the old behavior and only includes local packages and their interdependencies.
If
--external
is activated local packages will have the "dashed" line attribute so that one can distinguish local packages from external dependencies.As an example, given a tree like this with two projects
one
andtwo
:stack dot
will produce:while
stack dot --external
will produce:This would also fix #431.