Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cross-project-issues-dev] Throwing semantic versioning out the window with Require-Bundle/Import-Package with empty/single version

Hi there,

Recently I've discovered a binary incompatible change in one of p2
bundles [1] and the way p2 and Tycho specifically use version ranges
surprised me.

What is a justification, in context of OSGi and Eclipse in general, for
not using versions at all or just a specific single version when
importing bundles/packages like

    Import-Package: org.eclipse.equinox.internal.p2.core.helpers


    Require-Bundle: org.eclipse.equinox.p2.metadata.repository;bundle-version="1.2.100"
    Require-Bundle: org.eclipse.equinox.p2.metadata

OSGi Specification in 3.2.5 Version, 3.2.6 Version Ranges and 3.7.3
Semantic Versioning says:

    The default value for a version is 0.0.0.


    Examples of version ranges
    Example Predicate
    1.2.3   1.2.3 <= x


    Version ranges encode the assumptions about compatibility.

Which means that for version-less requirement any version apply and for
a single version requirement any version greater than or equal apply.

How to specify plug-in requirements [2] says the same:

    Plug-ins that require other plug-ins must qualify their requirements
    with a version range since the absence of a version range means that
    any version can satisfy the dependency. ... the recommended range
    includes the minimal required version up-to but not including the
    next major release.

Version-less or single version requirement effectively throw these
assumptions about compatibility out the window. Either I'm missing
something important and there reasons for this or ...?



Back to the top