-
Notifications
You must be signed in to change notification settings - Fork 33
Merge SAT vars for each package #153
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
Draft
aszady
wants to merge
4
commits into
rmohr:main
Choose a base branch
from
aszady:collapse
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -170,7 +170,6 @@ func TestLoader_Load(t *testing.T) { | |
| x3 := bf.Var("x3") | ||
| x4 := bf.Var("x4") | ||
| x5 := bf.Var("x5") | ||
| x6 := bf.Var("x6") | ||
|
|
||
| t.Run("Trivial Loading", func(t *testing.T) { | ||
| model, _ := doSimpleLoad([]*api.Package{}, false) | ||
|
|
@@ -190,7 +189,7 @@ func TestLoader_Load(t *testing.T) { | |
| expectedPackages(g, model, map[string][]string{ | ||
| "A": []string{"0:1.0-1"}, | ||
| }) | ||
| expectedVars(g, model, "A-0:1.0-1(A)") | ||
| expectedVars(g, model, "A-0:1.0-1") | ||
| expectedBest(g, model, map[string]string{"A": "0:1.0-1"}) | ||
| expectedIgnores(g, model) | ||
| expectedAnds(g, model, | ||
|
|
@@ -206,7 +205,7 @@ func TestLoader_Load(t *testing.T) { | |
| expectedPackages(g, model, map[string][]string{ | ||
| "A": []string{"0:2.0-1"}, | ||
| }) | ||
| expectedVars(g, model, "A-0:2.0-1(A)") | ||
| expectedVars(g, model, "A-0:2.0-1") | ||
| expectedBest(g, model, map[string]string{"A": "0:2.0-1"}) | ||
| expectedIgnores(g, model) | ||
| expectedAnds(g, model, | ||
|
|
@@ -222,7 +221,7 @@ func TestLoader_Load(t *testing.T) { | |
| expectedPackages(g, model, map[string][]string{ | ||
| "A": []string{"0:1.0-1", "0:2.0-1"}, | ||
| }) | ||
| expectedVars(g, model, "A-0:1.0-1(A)", "A-0:2.0-1(A)") | ||
| expectedVars(g, model, "A-0:1.0-1", "A-0:2.0-1") | ||
| expectedBest(g, model, map[string]string{"A": "0:2.0-1"}) | ||
| expectedIgnores(g, model) | ||
| expectedAnds(g, model, | ||
|
|
@@ -245,9 +244,9 @@ func TestLoader_Load(t *testing.T) { | |
| expectedVars( | ||
| g, | ||
| m, | ||
| "pkg-a-0:1.0(pkg-a)", | ||
| "pkg-b-0:1.0(pkg-b)", | ||
| "pkg-c-0:1.0(pkg-c)", | ||
| "pkg-a-0:1.0", | ||
| "pkg-b-0:1.0", | ||
| "pkg-c-0:1.0", | ||
| ) | ||
| expectedBest(g, m, map[string]string{ | ||
| "pkg-a": "0:1.0", | ||
|
|
@@ -346,9 +345,8 @@ func TestLoader_Load(t *testing.T) { | |
| expectedVars( | ||
| g, | ||
| model, | ||
| "app-0:1.0(app)", // x1 | ||
| "toolkit-0:2.0(toolkit)", // x2 | ||
| "toolkit-0:2.0(/usr/bin/tool)", // x3 | ||
| "app-0:1.0", // x1 | ||
| "toolkit-0:2.0", // x2 | ||
| ) | ||
| expectedBest(g, model, map[string]string{ | ||
| "app": "0:1.0", | ||
|
|
@@ -358,7 +356,6 @@ func TestLoader_Load(t *testing.T) { | |
| expectedAnds(g, model, | ||
| x1, // Install: app | ||
| bf.Implies(x1, x2), // Requirement: app => toolkit | ||
| bf.Eq(x2, x3), // Equivalence (toolkit) | ||
| ) | ||
| }) | ||
|
|
||
|
|
@@ -377,11 +374,9 @@ func TestLoader_Load(t *testing.T) { | |
| expectedVars( | ||
| g, | ||
| model, | ||
| "apache-0:2.4(apache)", | ||
| "apache-0:2.4(webserver)", | ||
| "app-0:1.0(app)", | ||
| "nginx-0:1.2(nginx)", | ||
| "nginx-0:1.2(webserver)", | ||
| "apache-0:2.4", // x1 | ||
| "app-0:1.0", // x2 | ||
| "nginx-0:1.2", // x3 | ||
| ) | ||
| expectedBest(g, model, map[string]string{ | ||
| "app": "0:1.0", | ||
|
|
@@ -390,10 +385,8 @@ func TestLoader_Load(t *testing.T) { | |
| }) | ||
| expectedIgnores(g, model) | ||
| expectedAnds(g, model, | ||
| x3, // Install: app | ||
| bf.Implies(x3, bf.Or(x1, x4)), // Requirement: app => apache or nginx | ||
| bf.Eq(x1, x2), // Equivalence (apache) | ||
| bf.Eq(x4, x5), // Equivalence (nginx) | ||
| x2, // Install: app | ||
| bf.Implies(x2, bf.Or(x1, x3)), // Requirement: app => apache or nginx | ||
| ) | ||
| }) | ||
|
|
||
|
|
@@ -409,7 +402,7 @@ func TestLoader_Load(t *testing.T) { | |
| "B": []string{"0:1.0"}, | ||
| "C": []string{"0:1.0"}, | ||
| }) | ||
| expectedVars(g, model, "A-0:1.0(A)", "B-0:1.0(B)", "C-0:1.0(C)") | ||
| expectedVars(g, model, "A-0:1.0", "B-0:1.0", "C-0:1.0") | ||
| expectedBest(g, model, map[string]string{ | ||
| "A": "0:1.0", | ||
| "B": "0:1.0", | ||
|
|
@@ -433,8 +426,7 @@ func TestLoader_Load(t *testing.T) { | |
| expectedVars( | ||
| g, | ||
| model, | ||
| "platform-python-0:3.6(platform-python)", | ||
| "platform-python-0:3.6(/usr/libexec/platform-python)", | ||
| "platform-python-0:3.6", | ||
| ) | ||
| expectedBest( | ||
| g, | ||
|
|
@@ -443,7 +435,7 @@ func TestLoader_Load(t *testing.T) { | |
| ) | ||
| expectedIgnores(g, model) | ||
| expectedAnds(g, model, | ||
| bf.Eq(x1, x2), // Equivalence (platform-python) | ||
| bf.True, // Nothing to install | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what is causing this change and why is it desirable? |
||
| ) | ||
|
|
||
| // verify side effect | ||
|
|
@@ -461,7 +453,7 @@ func TestLoader_Load(t *testing.T) { | |
| expectedPackages(g, model, map[string][]string{ | ||
| "A": []string{"5:1.0-2"}, | ||
| }) | ||
| expectedVars(g, model, "A-5:1.0-2(A)") | ||
| expectedVars(g, model, "A-5:1.0-2") | ||
| expectedBest(g, model, map[string]string{"A": "5:1.0-2"}) | ||
| expectedAnds(g, model, | ||
| bf.True, // Nothing to install | ||
|
|
@@ -483,12 +475,9 @@ func TestLoader_Load(t *testing.T) { | |
| expectedVars( | ||
| g, | ||
| model, | ||
| "gcc-0:11.0(gcc)", // x1 | ||
| "gcc-0:11.0(gcc)", // x2 | ||
| "gcc11-0:11.0(gcc11)", // x3 | ||
| "gcc11-0:11.0(gcc)", // x4 | ||
| "gcc11-0:11.0(gcc11)", // x5 | ||
| "pkgX-0:1.0(pkgX)", // x6 | ||
| "gcc-0:11.0", // x1 | ||
| "gcc11-0:11.0", // x2 | ||
| "pkgX-0:1.0", // x3 | ||
| ) | ||
| expectedBest(g, model, map[string]string{ | ||
| "gcc": "0:11.0", | ||
|
|
@@ -497,12 +486,9 @@ func TestLoader_Load(t *testing.T) { | |
| }) | ||
|
|
||
| expectedAnds(g, model, | ||
| x6, // Install: pkgX | ||
| bf.Implies(x6, bf.Or(x1, x3)), // Requirement: pkgX => gcc or gcc11 | ||
| bf.Implies(x1, x3), // Requirement: gcc => gcc11 | ||
| bf.Eq(x1, x2), // Equivalence (gcc) | ||
| bf.Eq(x3, x4), // Equivalence (gcc11) | ||
| bf.Eq(x3, x5), // Equivalence (gcc11) | ||
| x3, // Install: pkgX | ||
| bf.Implies(x3, bf.Or(x1, x2)), // Requirement: pkgX => gcc or gcc11 | ||
| bf.Implies(x1, x2), // Requirement: gcc => gcc11 | ||
| ) | ||
|
|
||
| }) | ||
|
|
@@ -511,7 +497,7 @@ func TestLoader_Load(t *testing.T) { | |
| pkgA := newPackage("A", "1.0", nil, nil, []string{"A"}, nil) | ||
| model, _ := doLoad([]*api.Package{pkgA}, nil, nil, nil, false) | ||
|
|
||
| expectedVars(g, model, "A-0:1.0(A)") | ||
| expectedVars(g, model, "A-0:1.0") | ||
| expectedAnds(g, model, | ||
| bf.True, // Nothing to install | ||
| ) | ||
|
|
@@ -526,7 +512,7 @@ func TestLoader_Load(t *testing.T) { | |
| expectedPackages(g, model, map[string][]string{ | ||
| "A": []string{"0:1.0-1"}, | ||
| }) | ||
| expectedVars(g, model, "A-0:1.0-1(A)") | ||
| expectedVars(g, model, "A-0:1.0-1") | ||
| expectedAnds(g, model, | ||
| bf.Not(x1), // Can't install package `A` (missing dependency `B`). | ||
| ) | ||
|
|
@@ -582,7 +568,7 @@ func TestLoader_Load(t *testing.T) { | |
| expectedPackages(g, model, map[string][]string{ | ||
| "X": []string{selectedVersion}, | ||
| }) | ||
| expectedVars(g, model, "X-"+selectedVersion+"(X)") | ||
| expectedVars(g, model, "X-"+selectedVersion) | ||
| expectedBest(g, model, map[string]string{ | ||
| "X": selectedVersion, | ||
| }) | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This parenthesis requirement duplicates appears on real RPM requires, I feel dropping this from tests may actually break real resolution
Why are you dropping them?
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.
Not sure what do you mean :(
This follows directly from the change in
func (v Var) String() string, asVarno longer has info about specific resources the package provides.Is there some case not covered by tests?
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.
This is what I mean https://g.co/gemini/share/f453cd2e46af, as you can see an RPM may say it depends on
feature(modifier)I think we're dropping the modifier part with this change set, we will only notice the breaking change at runtime not while rendering the required RPMsThere 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.
I think that at no point
bazeldnfparses the content of provides/requires/conflicts name, so there's no place to drop that modifier.What this change does for e.g.
glibc-related SAT variables, would be this transformation of a debug string forVarstruct. For example:SAT variables:
glibc(libc.so.6(GLIBC_2.16))glibc(libc.so.6(GLIBC_2.17))will be replaced by single one:
glibc.The info about particular resource provided (e.g.
libc.so.6(GLIBC_2.16)) is now processed only at the previous stage of SAT construction – in theProvidedResourcestruct.The intention of this change is to keep behaviour the same, while simplifying the internals.
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.
I have to echo @manuelnaranjo 's comment - it looks like in some of the later tests we're previously expecting multiple distinct qualifiers for the same package? The belief is that theyre not being used?