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

[MER][T11|T12|T13|T14] Creating the initial problems graph #1891

Merged
merged 30 commits into from
Oct 13, 2022

Conversation

crogoz
Copy link
Contributor

@crogoz crogoz commented Aug 31, 2022

Graph creation implementation for #1878 (we only implemented the graph creation for a subset of the libsolv problems)

  • DependencyInfo - contains the info about a dependency name & the range
  • ProblemsGraph - A directed graph of the packages involved in libsolv conflicts. A node can be: RootNode (a "virtual" node that has edges to the packages a user requested that are in conflict), PackageNode (a resolved package node), UnresolvedDependencyNode (a dependency that couldn't be found), ConstraintNode (an optional dependency for a package that is in conflict)
  • The ProblemsGraph contains a map between direct package conflicts (eg. a pair of the format: <python2.7.1, python3.6.0>).

We create the graph using the libsolv problems list. We will only add the nodes in the graph if they haven't been added already. In order to check if a specific package is in the graph or not, we store a mapping between the SolveId (a unique identifier from libsolv) and Id (the unique node identifier for a node in the graph).
Because a solvable can appear in multiple libsolv problems, we might need to update the information for the node.
eg.

  • Problem1: pkgA requires pkgB -> we create a PackgeInfo type for pkgB
  • Problem1: pkgB is not installable-> we need to update the pkgB info with the new problem type

@crogoz crogoz changed the title [MER][T13|T14] Creating the initial problems graph [MER][T11|T12T13|T14] Creating the initial problems graph Aug 31, 2022
@crogoz crogoz changed the title [MER][T11|T12T13|T14] Creating the initial problems graph [MER][T11|T12|T13|T14] Creating the initial problems graph Aug 31, 2022
Copy link
Member

@AntoinePrv AntoinePrv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @syslaila,

Thank you for this PR! I think we can remove some of the classes to make it more transparent.
Happy to send a PR, but I would need your input on some of the questions.

libmamba/include/mamba/core/problems_graph_util.hpp Outdated Show resolved Hide resolved
libmamba/include/mamba/core/problems_graph_util.hpp Outdated Show resolved Hide resolved
libmamba/include/mamba/core/problems_graph_util.hpp Outdated Show resolved Hide resolved
libmamba/include/mamba/core/problems_graph_util.hpp Outdated Show resolved Hide resolved
libmamba/include/mamba/core/problems_graph_util.hpp Outdated Show resolved Hide resolved
libmamba/include/mamba/core/problems_graph_creator.hpp Outdated Show resolved Hide resolved
libmamba/include/mamba/core/problems_graph_creator.hpp Outdated Show resolved Hide resolved
libmamba/src/core/problems_graph_creator.cpp Outdated Show resolved Hide resolved
libmamba/src/core/problems_graph_util.cpp Outdated Show resolved Hide resolved
libmamba/include/mamba/core/problems_graph_creator.hpp Outdated Show resolved Hide resolved
@crogoz crogoz marked this pull request as ready for review October 6, 2022 15:49
crogoz and others added 18 commits October 6, 2022 15:56
Co-authored-by: Antoine Prouvost <AntoinePrv@users.noreply.github.com>

Update libmamba/include/mamba/core/problems_graph_util.hpp

Co-authored-by: Antoine Prouvost <AntoinePrv@users.noreply.github.com>

Update libmamba/include/mamba/core/problems_graph_util.hpp

Co-authored-by: Antoine Prouvost <AntoinePrv@users.noreply.github.com>

Update libmamba/include/mamba/core/problems_graph_util.hpp

Co-authored-by: Antoine Prouvost <AntoinePrv@users.noreply.github.com>

Update libmamba/src/core/problems_graph_util.cpp

Co-authored-by: Antoine Prouvost <AntoinePrv@users.noreply.github.com>

Update libmamba/include/mamba/core/problems_graph_util.hpp

Co-authored-by: Antoine Prouvost <AntoinePrv@users.noreply.github.com>

Update libmamba/src/core/problems_graph_util.cpp

Co-authored-by: Antoine Prouvost <AntoinePrv@users.noreply.github.com>

Update libmamba/include/mamba/core/problems_graph_creator.hpp

Co-authored-by: Antoine Prouvost <AntoinePrv@users.noreply.github.com>

Update libmamba/src/core/problems_graph_util.cpp

Co-authored-by: Antoine Prouvost <AntoinePrv@users.noreply.github.com>

Update libmamba/include/mamba/core/problems_graph_util.hpp

Co-authored-by: Antoine Prouvost <AntoinePrv@users.noreply.github.com>
@AntoinePrv
Copy link
Member

I seems like the last failing test is due to a temporary connection error

HTTP request sent, awaiting response... 503 Service Unavailable

@wolfv
Copy link
Member

wolfv commented Oct 7, 2022

Awesome stuff. It all looks good to me (except for two changes that could be their own PR: in util_random.cpp and in subdirdata.cpp – both don't seem related to the core of this PR :)

The other remark I had was that it could be nice to add more comments in the parse_problems function and explain more what all of the different solver errors are etc.

libmamba/include/mamba/core/satisfiability_error.hpp Outdated Show resolved Hide resolved
libmamba/include/mamba/core/satisfiability_error.hpp Outdated Show resolved Hide resolved
libmamba/include/mamba/core/satisfiability_error.hpp Outdated Show resolved Hide resolved
libmamba/src/core/satisfiability_error.cpp Outdated Show resolved Hide resolved
libmamba/src/core/satisfiability_error.cpp Outdated Show resolved Hide resolved
libmamba/src/core/satisfiability_error.cpp Show resolved Hide resolved
libmamba/src/core/satisfiability_error.cpp Outdated Show resolved Hide resolved
libmamba/src/core/satisfiability_error.cpp Outdated Show resolved Hide resolved
libmamba/src/core/satisfiability_error.cpp Outdated Show resolved Hide resolved
@JohanMabille JohanMabille merged commit e3ab841 into mamba-org:main Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants