Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#13426 closed bug (no change required)

Package Requires and Provides Version Range Comparison Broken

Reported by: AGMS Owned by: bonefish
Priority: normal Milestone: Unscheduled
Component: Servers/package_daemon Version: R1/Development
Keywords: version number range comparison Cc: agmsmith@…
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

The comparison of version numbers doesn't take into account that it is a range comparison, not just a single version number compared against a range. For example, if Application A's .PackageInfo has:

provides {
  A = 2.53 compatible >= 1.1
  app:A = 2.53 compatible >= 1.1
}

and Application B has:

requires {
  app:A >= 1.0
}

then pkgman will fail, saying "nothing provides app:A>=1.0 needed by B-..." though version 2.53 is >= 1.0. For that matter, A can do anything from 1.1 on up to 2.53, surely one of those versions in that range (like 1.42 to pick one possible one) satisfies B's app:A >= 1.0 requirement?

But make B require app:A >= 1.1 and then it suddenly works as expected.

Change History (4)

comment:1 in reply to:  description Changed 2 years ago by bonefish

Resolution: no change required
Status: newclosed

Replying to AGMS:

then pkgman will fail, saying "nothing provides app:A>=1.0 needed by B-..." though version 2.53 is >= 1.0. For that matter, A can do anything from 1.1 on up to 2.53, surely one of those versions in that range (like 1.42 to pick one possible one) satisfies B's app:A >= 1.0 requirement?

No. When A declares "compatible >= 1.1" it explicitly says that it doesn't provide (full) compatibility with earlier versions. When B declares that it requires "A >= 1.0", it says that it needs the functionality provided by version 1.0 -- which A 2.53 does not fully support.

comment:2 Changed 2 years ago by AGMS

Looks like I misremembered https://dev.haiku-os.org/wiki/PackageManagement/BuildingPackages where it says "The version_ref after the "compat"/"compatible" string specifies the oldest version the resolvable is backwards compatible with." Oops, sorry about the noise.

comment:3 Changed 2 years ago by AGMS

By the way, what does the version_operator do in:

required_entity		::= entity_name [ version_operator version_ref [ "base" ] ]

Doesn't seem to be documented, and doesn't work the way I expect (otherwise requires "app:A >= 1.0" would have been satisfied with 2.53).

comment:4 in reply to:  3 Changed 2 years ago by bonefish

Replying to AGMS:

Doesn't seem to be documented, and doesn't work the way I expect (otherwise requires "app:A >= 1.0" would have been satisfied with 2.53).

"app:A >= 1.0" means that version 1.0 of app:A or a newer version compatible with it is required. Since 2.53 explicitly declares itself not to be compatible with 1.0, it does not satisfy that requirement.

A bit of background: The "compatible >= ..." property was mainly intended as a means for library packages to declare their ABI compatibility. Given that clients of a library can't know how the library maintainers deal with backward compatibility (though most have a policy), the client package declares the minimum version it can work with and the library package is supposed to declare the minimum version it is backward compatible with.

The mechanism works, but given that our dependency resolution is based on libsolv, it is kind of superfluous. Since libsolv doesn't support having multiple installed packages with the same name, we have to choose the same route for supporting clients of different library version that is used by various Linux distributions: Use different package/resolvable names for the different incompatible versions of a library (e.g. libfoo1, libfoo2,...). And by doing that the "compatible >= ..." declaration becomes redundant.

Note: See TracTickets for help on using tickets.