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

Use fine-grained dependencies to eliminate stanza from FlaggedDeps? #3263

Open
ezyang opened this issue Mar 31, 2016 · 4 comments
Open

Use fine-grained dependencies to eliminate stanza from FlaggedDeps? #3263

ezyang opened this issue Mar 31, 2016 · 4 comments

Comments

@ezyang
Copy link
Contributor

ezyang commented Mar 31, 2016

@edsko, I'd quite like to know what you think about this.

In a5a823d, 6b77ea2 and 87a79be you modified the solver to keep track of which component a dependency came from. However, as far as I can tell, the solver doesn't actually use this information; it just makes sure it gets passed along.

At the same time, there is an orthogonal mechanism, Stanza in FlaggedDep, which lets you conditionalize a dependency tree on whether or not a stanza is enabled. This code substantially predates fine-grained dependencies, and I am now wondering whether or not we need it anymore: why can't we just look at the stored Component when building the search tree to decide how to branch? In this way, we automatically get the ability to conditionalize on executables too.

@edsko
Copy link
Contributor

edsko commented Apr 4, 2016

The solver uses the fine grained dependencies to decide where to introduce qualifiers (i.e., which goals are in independent), but other than that, just makes sure the information is not forgotten.

I'm not entirely sure I understand what you are proposing though. Can you give a concrete example?

@ezyang
Copy link
Contributor Author

ezyang commented Apr 4, 2016

The proposal is to get rid of Stanza altogether. So instead of adding Stanzas when we are converting source packages to the solver format, don't bother and have the solver just look at the fine grained dependencies.

@edsko
Copy link
Contributor

edsko commented Apr 4, 2016

So instead of

data FlaggedDep comp qpn =
    Flagged (FN qpn) FInfo (TrueFlaggedDeps qpn) (FalseFlaggedDeps qpn)
  | Stanza  (SN qpn)       (TrueFlaggedDeps qpn)
  | Simple (Dep qpn) comp
  deriving (Eq, Show)

we have

data FlaggedDep comp qpn =
    Flagged (FN qpn) FInfo (TrueFlaggedDeps qpn) (FalseFlaggedDeps qpn)
  | Simple (Dep qpn) comp
  deriving (Eq, Show)

Yes, it would seem that those two are in fact isomorphic. Yeah, I think the simplification you propose makes sense.

@ezyang
Copy link
Contributor Author

ezyang commented Apr 4, 2016

OK, good. It's not hotpath for me but if I need to touch this code a lot later I'll clean this up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants