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

rich dependencies (version range of same dependency) are not handled properly #182

Closed
ignatenkobrain opened this Issue Feb 19, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@ignatenkobrain
Copy link
Collaborator

ignatenkobrain commented Feb 19, 2017

repo system 0 testtags <inline>
#>=Pkg: rust-serde10-devel 0.10.0 1 noarch
#>=Prv: crate(serde) = 0.10.0
repo available 0 testtags <inline>
#>=Pkg: ripgrep 0.4.0 1 src
#>=Req: crate(clap) >= 2.18.0 & crate(clap) < 2.19.0
#>=Pkg: rust-clap-devel 2.18.5 1 noarch
#>=Prv: crate(clap) = 2.18.5
#>=Req: crate(vec_map) >= 0.6.0 & crate(vec_map) < 0.7.0
#>=Req: crate(clippy) >= 0.0.112 & crate(clippy) < 0.0.113
#>=Pkg: rust-vec_map-devel 0.6.0 1 noarch
#>=Prv: crate(vec_map) = 0.6.0
#>=Req: crate(serde) >= 0.6.0 & crate(serde) < 0.7.0
#>=Pkg: rust-clippy-devel 0.0.112 1 noarch
#>=Prv: crate(clippy) = 0.0.112
#>=Req: crate(serde) >= 0.9.0 & crate(serde) < 0.10.0
#>=Pkg: rust-serde-devel 0.9.1 1 noarch
#>=Prv: crate(serde) = 0.9.1
#>=Pkg: rust-serde6-devel 0.6.0 1 noarch
#>=Prv: crate(serde) = 0.6.0
system x86_64 rpm system
poolflags implicitobsoleteusescolors
solverflags allowvendorchange keepexplicitobsoletes bestobeypolicy keeporphans yumobsoletes
job install pkg ripgrep-0.4.0-1.src@available
result transaction,problems <inline>
#>install ripgrep-0.4.0-1.src@available
#>install rust-clap-devel-2.18.5-1.noarch@available
#>install rust-clippy-devel-0.0.112-1.noarch@available
#>install rust-serde-devel-0.9.1-1.noarch@available
#>install rust-serde6-devel-0.6.0-1.noarch@available
#>install rust-vec_map-devel-0.6.0-1.noarch@available

Apparently,

Results differ:
-install rust-serde-devel-0.9.1-1.noarch@available
@ignatenkobrain

This comment has been minimized.

Copy link
Collaborator Author

ignatenkobrain commented Feb 19, 2017

There's some another example which makes libsolv to produce somewhat weird result:

repo system 0 testtags <inline>
repo available 0 testtags <inline>
#>=Pkg: foo1 1 1 noarch
#>=Prv: foo = 1
#>=Pkg: foo4 4 1 noarch
#>=Prv: foo = 4
#>=Pkg: bar 1 1 noarch
#>=Req: foo >= 2 & foo <= 3
system x86_64 rpm system
poolflags implicitobsoleteusescolors
solverflags allowvendorchange keepexplicitobsoletes bestobeypolicy keeporphans yumobsoletes
job install name bar
result transaction,problems <inline>
+install bar-1-1.noarch@available
+install foo1-1-1.noarch@available
+install foo4-4-1.noarch@available

but it needs only one foo to satisfy dependency.

@ignatenkobrain ignatenkobrain changed the title rich dependencies are not handled properly rich dependencies (version range of same dependency) are not handled properly Feb 19, 2017

@mlschroe

This comment has been minimized.

Copy link
Member

mlschroe commented Feb 20, 2017

libsolv is correct, of course. ;-)

With your first testcase, the installed system after the transaction will have both rust-serde10-devel-0.10.0-1 (providing crate(serde) = 0.10.0) and rust-serde6-devel-0.6.0-1 (providing crate(serde) = 0.6.0) installed. Thus the requirement "crate(serde) >= 0.9.0 & crate(serde) < 0.10.0" is satisfied.

Your "and" type rich dependencies aren't very useful in this case. The require from above is exactly equivalent to this

Requires: crate(serde) >= 0.9.0
Requires: crate(serde) < 0.10.0

I.e. there is no need to use rich dependencies at all.

What you're looking for is libsolv's "with" dependency type, '+' in testcase syntax:

#>Req: crate(serde) >= 0.9.0 + crate(serde) < 0.10.0

The semantics is that the requirement must be fulfilled by the same package. I also suggested that for rpm rich dependencies, but there wasn't much interest in having that.

As for your second testcase, there is no single foo that provides both "foo >= 2" and "foo <= 3", because just version 1 and 4 is provided.

@mlschroe mlschroe closed this Feb 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.