Skip to content

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

Open

Description

@ezyang

@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.

Activity

  1. edsko commented on Apr 4, 2016

    @edsko
    Contributor

    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?

  2. ezyang commented on Apr 4, 2016

    @ezyang
    ContributorAuthor

    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.

  3. edsko commented on Apr 4, 2016

    @edsko
    Contributor

    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.

  4. ezyang commented on Apr 4, 2016

    @ezyang
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions